1
0
Fork 0
forked from forgejo/forgejo

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
This commit is contained in:
David Svantesson 2019-11-09 01:39:37 +01:00 committed by Lunny Xiao
parent d2aee2a3e2
commit 9ae4c17cb1
7 changed files with 175 additions and 45 deletions

View file

@ -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}

View file

@ -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 = ['${', '}'];

View file

@ -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;
}
}
}