forked from forgejo/forgejo
#1146 finsih UI work for access mode of collaborators
Collaborators have write access as default, and can be changed via repository collaboration settings page to change between read, write and admin.
This commit is contained in:
parent
05d8664f15
commit
045f14fbd0
16 changed files with 292 additions and 164 deletions
|
@ -458,6 +458,20 @@ function initRepository() {
|
|||
}
|
||||
}
|
||||
|
||||
function initRepositoryCollaboration(){
|
||||
console.log('initRepositoryCollaboration');
|
||||
|
||||
// Change collaborator access mode
|
||||
$('.access-mode.menu .item').click(function(){
|
||||
var $menu = $(this).parent();
|
||||
$.post($menu.data('url'), {
|
||||
"_csrf": csrf,
|
||||
"uid": $menu.data('uid'),
|
||||
"mode": $(this).data('value')
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function initWiki() {
|
||||
if ($('.repository.wiki').length == 0) {
|
||||
return;
|
||||
|
@ -964,7 +978,8 @@ $(document).ready(function () {
|
|||
initAdmin();
|
||||
|
||||
var routes = {
|
||||
'div.user.settings': initUserSettings
|
||||
'div.user.settings': initUserSettings,
|
||||
'div.repository.settings.collaboration': initRepositoryCollaboration
|
||||
};
|
||||
|
||||
var selector;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue