diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-08-29 15:32:52 +0800 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-08-29 15:32:52 +0800 |
commit | 88291745747ffb200b55ca62e1054d1d2c4315d3 (patch) | |
tree | 493d0cfe13d53c0720a25d30ced2b0d8d4f39d1a /public/ng/js | |
parent | 6558990e3a1e3d5aac595e0f0b525a834d708647 (diff) | |
download | gitea-88291745747ffb200b55ca62e1054d1d2c4315d3.tar.gz gitea-88291745747ffb200b55ca62e1054d1d2c4315d3.zip |
Finish new admin users pages
Diffstat (limited to 'public/ng/js')
-rw-r--r-- | public/ng/js/gogs.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js index d4c3224eee..69ac380fd9 100644 --- a/public/ng/js/gogs.js +++ b/public/ng/js/gogs.js @@ -427,6 +427,31 @@ function initTeamRepositoriesList() { }); } +function initAdmin() { + // Create account. + $('#login-type').on("change",function(){ + var v = $(this).val(); + if(v.indexOf("0-")+1){ + $('.auth-name').toggleHide(); + $(".pwd").find("input").attr("required","required") + .end().toggleShow(); + }else{ + $(".pwd").find("input").removeAttr("required") + .end().toggleHide(); + $('.auth-name').toggleShow(); + } + }); + // Delete account. + $('#user-delete').click(function (e) { + if (!confirm('This account is going to be deleted, do you want to continue?')) { + e.preventDefault(); + return true; + } + var $form = $('user-profile-form'); + $form.attr('action', $form.data('delete-url')); + }); +} + $(document).ready(function () { initCore(); if ($('#user-profile-setting').length) { @@ -453,6 +478,9 @@ $(document).ready(function () { if ($('#team-repositories-list').length) { initTeamRepositoriesList(); } + if ($('#admin-setting').length) { + initAdmin(); + } Tabs('#dashboard-sidebar-menu'); |