aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-02-17 15:10:50 -0500
committerUnknwon <u@gogs.io>2017-02-17 15:10:50 -0500
commit7e09d210ba421a1baf03ef7ba8770bebe8d28b72 (patch)
tree1d209f6175c3e4d7e21c4bda62e65db0ac4608f5 /public
parentdab768212af15f4e671e5403ad3def455117f699 (diff)
Initial version of protected branches (#776)
- Able to restrict force push and deletion - Able to restrict direct push
Diffstat (limited to 'public')
-rw-r--r--public/css/gogs.css19
-rw-r--r--public/js/gogs.js12
-rw-r--r--public/less/_repository.less28
3 files changed, 57 insertions, 2 deletions
diff --git a/public/css/gogs.css b/public/css/gogs.css
index 3b90c8cd..64baf104 100644
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -1225,7 +1225,6 @@ footer .ui.language .menu {
}
.repository.file.list #file-buttons {
font-weight: normal;
- margin-top: -3px;
}
.repository.file.list #file-buttons .ui.button {
padding: 8px 10px;
@@ -2274,6 +2273,24 @@ footer .ui.language .menu {
margin-left: 5px;
margin-top: -3px;
}
+.repository.settings.branches .protected-branches .selection.dropdown {
+ width: 300px;
+}
+.repository.settings.branches .protected-branches .item {
+ border: 1px solid #eaeaea;
+ padding: 10px 15px;
+}
+.repository.settings.branches .protected-branches .item:not(:last-child) {
+ border-bottom: 0;
+}
+.repository.settings.branches .branch-protection .help {
+ margin-left: 26px;
+ padding-top: 0;
+}
+.repository.settings.branches .branch-protection .fields {
+ margin-left: 20px;
+ display: block;
+}
.repository.settings.webhook .events .column {
padding-bottom: 0;
}
diff --git a/public/js/gogs.js b/public/js/gogs.js
index 45b11fe7..58fed2cc 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -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
diff --git a/public/less/_repository.less b/public/less/_repository.less
index 066c58fd..9501d99c 100644
--- a/public/less/_repository.less
+++ b/public/less/_repository.less
@@ -161,7 +161,7 @@
}
#file-buttons {
font-weight: normal;
- margin-top: -3px;
+
.ui.button {
padding: 8px 10px;
font-weight: normal;
@@ -1303,6 +1303,32 @@
}
}
+ &.branches {
+ .protected-branches {
+ .selection.dropdown {
+ width: 300px;
+ }
+ .item {
+ border: 1px solid #eaeaea;
+ padding: 10px 15px;
+
+ &:not(:last-child) {
+ border-bottom: 0;
+ }
+ }
+ }
+ .branch-protection {
+ .help {
+ margin-left: 26px;
+ padding-top: 0;
+ }
+ .fields {
+ margin-left: 20px;
+ display: block;
+ }
+ }
+ }
+
&.webhook {
.events {
.column {