summaryrefslogtreecommitdiffstats
path: root/web_src/js/index.js
diff options
context:
space:
mode:
authorAndrew Bezold <andrew.bezold@gmail.com>2021-01-24 10:23:05 -0500
committerGitHub <noreply@github.com>2021-01-24 16:23:05 +0100
commitbc05ddc0ebd6fdc826ef2beec99304bac60ddd8a (patch)
tree03d52e07feedd37e169a04980f9efbb8bd1aca65 /web_src/js/index.js
parent4f608ad31f538cb45411ff9a2238db812b5ca414 (diff)
downloadgitea-bc05ddc0ebd6fdc826ef2beec99304bac60ddd8a.tar.gz
gitea-bc05ddc0ebd6fdc826ef2beec99304bac60ddd8a.zip
Redirect on changed user and org name (#11649)
* Add redirect for user * Add redirect for orgs * Add user redirect test * Appease linter * Add comment to DeleteUserRedirect function * Fix locale changes * Fix GetUserByParams * Fix orgAssignment * Remove debug logging * Add redirect prompt * Dont Export DeleteUserRedirect & only use it within a session * Unexport newUserRedirect * cleanup * Fix & Dedub API code * Format Template * Add Migration & rm dublicat * Refactor: unexport newRepoRedirect() & rm dedub del exec * if this fails we'll need to re-rename the user directory Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'web_src/js/index.js')
-rw-r--r--web_src/js/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 16bb412f09..f5f4841410 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1736,10 +1736,13 @@ function initOrganization() {
if ($('.organization.settings.options').length > 0) {
$('#org_name').on('keyup', function () {
const $prompt = $('#org-name-change-prompt');
+ const $prompt_redirect = $('#org-name-change-redirect-prompt');
if ($(this).val().toString().toLowerCase() !== $(this).data('org-name').toString().toLowerCase()) {
$prompt.show();
+ $prompt_redirect.show();
} else {
$prompt.hide();
+ $prompt_redirect.hide();
}
});
}
@@ -1755,10 +1758,13 @@ function initUserSettings() {
if ($('.user.settings.profile').length > 0) {
$('#username').on('keyup', function () {
const $prompt = $('#name-change-prompt');
+ const $prompt_redirect = $('#name-change-redirect-prompt');
if ($(this).val().toString().toLowerCase() !== $(this).data('name').toString().toLowerCase()) {
$prompt.show();
+ $prompt_redirect.show();
} else {
$prompt.hide();
+ $prompt_redirect.hide();
}
});
}