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

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