aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-14 14:12:21 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-14 14:12:21 +0800
commit5acc948562547b393ba1e89b012e7421143c6dd8 (patch)
tree657653112b206fb01ff184bd30cb680b5b5a21fa /public
parent2935ee440c82a7f998a74159255cc38924f6e0bc (diff)
Page: `/org/:orgname/settings`
Diffstat (limited to 'public')
3 files changed, 56 insertions, 31 deletions
diff --git a/public/ng/css/gogs.css b/public/ng/css/gogs.css
index e69e4b66..93a5d2f8 100644
--- a/public/ng/css/gogs.css
+++ b/public/ng/css/gogs.css
@@ -1348,26 +1348,32 @@ The register and sign-in page style
.setting-content {
margin-left: 32px;
}
+#org-setting-form,
#repo-setting-form,
#user-profile-form {
background-color: #FFF;
padding: 30px 0;
}
+#org-setting-form textarea,
#repo-setting-form textarea,
#user-profile-form textarea {
margin-left: 4px;
height: 100px;
}
+#org-setting-form label,
#repo-setting-form label,
#user-profile-form label,
+#org-setting-form .form-label,
#repo-setting-form .form-label,
#user-profile-form .form-label {
width: 240px;
}
+#org-setting-form .ipt,
#repo-setting-form .ipt,
#user-profile-form .ipt {
width: 360px;
}
+#org-setting-form .field,
#repo-setting-form .field,
#user-profile-form .field {
margin-bottom: 24px;
diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js
index 473997e9..ad8df997 100644
--- a/public/ng/js/gogs.js
+++ b/public/ng/js/gogs.js
@@ -225,6 +225,30 @@ function initCore() {
Gogs.renderCodeView();
}
+function initUserSetting() {
+ // Confirmation of change username in user profile page.
+ $('#user-profile-form').submit(function (e) {
+ var $username = $('#username');
+ if (($username.data('uname') != $username.val()) && !confirm('Username has been changed, do you want to continue?')) {
+ e.preventDefault();
+ return true;
+ }
+ });
+
+ // Show add SSH key panel.
+ $('#ssh-add').click(function () {
+ $('#user-ssh-add-form').removeClass("hide");
+ });
+
+ // Confirmation of delete account.
+ $('#delete-account-button').click(function (e) {
+ if (!confirm('This account is going to be deleted, do you want to continue?')) {
+ e.preventDefault();
+ return true;
+ }
+ });
+}
+
function initRepoCreate() {
// Owner switch menu click.
$('#repo-create-owner-list').on('click', 'li', function () {
@@ -286,21 +310,43 @@ function initRepoSetting() {
});
}
+function initOrgSetting() {
+ // Options.
+ // Confirmation of changing organization name.
+ $('#org-setting-form').submit(function (e) {
+ var $orgname = $('#orgname');
+ if (($orgname.data('orgname') != $orgname.val()) && !confirm('Organization name has been changed, do you want to continue?')) {
+ e.preventDefault();
+ return true;
+ }
+ });
+ // Confirmation of delete organization.
+ $('#delete-org-button').click(function (e) {
+ if (!confirm('This organization is going to be deleted, do you want to continue?')) {
+ e.preventDefault();
+ return true;
+ }
+ });
+}
+
$(document).ready(function () {
initCore();
+ if ($('#user-profile-setting').length) {
+ initUserSetting();
+ }
if ($('#repo-create-form').length || $('#repo-migrate-form').length) {
initRepoCreate();
}
if ($('#repo-setting').length) {
initRepoSetting();
}
+ if ($('#org-setting').length) {
+ initOrgSetting();
+ }
Tabs('#dashboard-sidebar-menu');
homepage();
- settingsProfile();
- settingsSSHKeys();
- settingsDelete();
// Fix language drop-down menu height.
var l = $('#footer-lang li').length;
@@ -328,32 +374,4 @@ function homepage() {
}
$('#promo-form').attr('action', '/user/sign_up');
});
-}
-
-function settingsProfile() {
- // Confirmation of change username in user profile page.
- $('#user-profile-form').submit(function (e) {
- var $username = $('#username');
- if (($username.data('uname') != $username.val()) && !confirm('Username has been changed, do you want to continue?')) {
- e.preventDefault();
- return true;
- }
- });
-}
-
-function settingsSSHKeys() {
- // Show add SSH key panel.
- $('#ssh-add').click(function () {
- $('#user-ssh-add-form').removeClass("hide");
- });
-}
-
-function settingsDelete() {
- // Confirmation of delete account.
- $('#delete-account-button').click(function (e) {
- if (!confirm('This account is going to deleted, do you want to continue?')) {
- e.preventDefault();
- return true;
- }
- });
} \ No newline at end of file
diff --git a/public/ng/less/gogs/settings.less b/public/ng/less/gogs/settings.less
index 1a492b03..ad50e4ff 100644
--- a/public/ng/less/gogs/settings.less
+++ b/public/ng/less/gogs/settings.less
@@ -31,6 +31,7 @@
margin-left: 32px;
}
+#org-setting-form,
#repo-setting-form,
#user-profile-form {
background-color: #FFF;