diff options
author | David Svantesson <davidsvantesson@gmail.com> | 2019-11-09 01:39:37 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-09 08:39:37 +0800 |
commit | 9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa (patch) | |
tree | 0a62a8bd50dcb4d067f915d02b24207e2a714e5f /public | |
parent | d2aee2a3e259de0d9dfd20452d55eb0c34ccc874 (diff) | |
download | gitea-9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa.tar.gz gitea-9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa.zip |
Allow to add and remove all repositories to/from team. (#8867)
* Allow to add and remove all repositories to team.
* Change style, buttons on same row.
* Apply suggestions from code review
Grammar
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Move set num repos to lower function.
* Make general language sentences
Diffstat (limited to 'public')
-rw-r--r-- | public/css/index.css | 5 | ||||
-rw-r--r-- | public/js/index.js | 30 | ||||
-rw-r--r-- | public/less/_organization.less | 5 |
3 files changed, 38 insertions, 2 deletions
diff --git a/public/css/index.css b/public/css/index.css index 3ec47eb85c..1a6032cf3e 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -945,8 +945,9 @@ tbody.commit-list{vertical-align:baseline} .organization.teams .members .item,.organization.teams .repositories .item{padding:10px 20px;line-height:32px} .organization.teams .members .item:not(:last-child),.organization.teams .repositories .item:not(:last-child){border-bottom:1px solid #ddd} .organization.teams .members .item .button,.organization.teams .repositories .item .button{padding:9px 10px} -.organization.teams #add-member-form input,.organization.teams #add-repo-form input{margin-left:0} -.organization.teams #add-member-form .ui.button,.organization.teams #add-repo-form .ui.button{margin-left:5px;margin-top:-3px} +.organization.teams #add-member-form input,.organization.teams #add-repo-form input,.organization.teams #repo-multiple-form input{margin-left:0} +.organization.teams #add-member-form .ui.button,.organization.teams #add-repo-form .ui.button,.organization.teams #repo-multiple-form .ui.button{margin-left:5px;margin-top:-3px} +.organization.teams #repo-top-segment{height:60px} .user:not(.icon){padding-top:15px} .user.profile .ui.card .username{display:block} .user.profile .ui.card .extra.content{padding:0} diff --git a/public/js/index.js b/public/js/index.js index 53650890f0..93ac6a2178 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2263,6 +2263,7 @@ $(document).ready(function () { // Helpers. $('.delete-button').click(showDeletePopup); + $('.add-all-button').click(showAddAllPopup); $('.delete-branch-button').click(showDeletePopup); @@ -2501,6 +2502,35 @@ function showDeletePopup() { return false; } +function showAddAllPopup() { + const $this = $(this); + let filter = ""; + if ($this.attr("id")) { + filter += "#" + $this.attr("id") + } + + const dialog = $('.addall.modal' + filter); + dialog.find('.name').text($this.data('name')); + + dialog.modal({ + closable: false, + onApprove: function() { + if ($this.data('type') == "form") { + $($this.data('form')).submit(); + return; + } + + $.post($this.data('url'), { + "_csrf": csrf, + "id": $this.data("id") + }).done(function(data) { + window.location.href = data.redirect; + }); + } + }).modal('show'); + return false; +} + function initVueComponents(){ const vueDelimeters = ['${', '}']; diff --git a/public/less/_organization.less b/public/less/_organization.less index 27dc7544fd..6071604cbc 100644 --- a/public/less/_organization.less +++ b/public/less/_organization.less @@ -152,6 +152,7 @@ } #add-repo-form, + #repo-multiple-form, #add-member-form { input { margin-left: 0; @@ -162,5 +163,9 @@ margin-top: -3px; } } + + #repo-top-segment { + height: 60px; + } } } |