diff options
author | Unknwon <u@gogs.io> | 2016-03-05 18:08:42 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-05 18:08:42 -0500 |
commit | 045f14fbd0e3553521f5092cf839be363c74a090 (patch) | |
tree | 9c82f5111c5c5262c97bd7936462fa4170e76b4f /public/js/gogs.js | |
parent | 05d8664f15013b0159b3689bda84e89dd7be22fd (diff) | |
download | gitea-045f14fbd0e3553521f5092cf839be363c74a090.tar.gz gitea-045f14fbd0e3553521f5092cf839be363c74a090.zip |
#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.
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r-- | public/js/gogs.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index cad4ba75b2..33da034551 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -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; |