From 045f14fbd0e3553521f5092cf839be363c74a090 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 5 Mar 2016 18:08:42 -0500 Subject: #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. --- public/js/gogs.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'public/js') diff --git a/public/js/gogs.js b/public/js/gogs.js index cad4ba75..33da0345 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; -- cgit v1.2.3