mirror of
https://github.com/gogs/gogs.git
synced 2025-12-20 07:09:58 +01:00
Initial version of protected branches (#776)
- Able to restrict force push and deletion - Able to restrict direct push
This commit is contained in:
@@ -341,6 +341,18 @@ function initRepository() {
|
||||
});
|
||||
}
|
||||
|
||||
// Branches
|
||||
if ($('.repository.settings.branches').length > 0) {
|
||||
initFilterSearchDropdown('.protected-branches .dropdown');
|
||||
$('.enable-protection').change(function () {
|
||||
if (this.checked) {
|
||||
$($(this).data('target')).removeClass('disabled');
|
||||
} else {
|
||||
$($(this).data('target')).addClass('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Labels
|
||||
if ($('.repository.labels').length > 0) {
|
||||
// Create label
|
||||
|
||||
Reference in New Issue
Block a user