Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Move timezone setting from display settings to profile.

sahil839b94d6c1a205f
diff --git a/static/js/settings_account.js b/static/js/settings_account.js
index 785daa2075b..2b15d3c7bb5 100644
--- a/static/js/settings_account.js
+++ b/static/js/settings_account.js
@@ -665,4 +665,20 @@ export function set_up() {
}
avatar.build_user_avatar_widget(upload_avatar);
+
+ $("#user_timezone").val(page_params.timezone);
+
+ $("#user_timezone").on("change", function (e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ const data = {timezone: this.value};
+
+ settings_ui.do_settings_change(
+ channel.patch,
+ "/json/settings/display",
+ data,
+ $(".timezone-setting-status").expectOne(),
+ );
+ });
}
diff --git a/static/js/settings_display.js b/static/js/settings_display.js
index 5fa0cebc373..563056bd673 100644
--- a/static/js/settings_display.js
+++ b/static/js/settings_display.js
@@ -48,8 +48,6 @@ export function set_up() {
meta.loaded = true;
$("#display-settings-status").hide();
- $("#user_timezone").val(page_params.timezone);
-
$("#demote_inactive_streams").val(page_params.demote_inactive_streams);
$("#color_scheme").val(page_params.color_scheme);
@@ -145,10 +143,6 @@ export function set_up() {
change_display_setting(data, "#time-settings-status");
});
- $("#user_timezone").on("change", function () {
- const data = {timezone: this.value};
- change_display_setting(data, "#time-settings-status");
- });
$(".emojiset_choice").on("click", function () {
const data = {emojiset: $(this).val()};
const current_emojiset = page_params.emojiset;
diff --git a/static/styles/settings.css b/static/styles/settings.css
index e8796259bfb..c1d0f6e9a1e 100644
--- a/static/styles/settings.css
+++ b/static/styles/settings.css
@@ -589,12 +589,14 @@ input[type="checkbox"] {
#profile-settings {
.custom-profile-fields-form .custom_user_field label,
- .full-name-change-form label {
+ .full-name-change-form label,
+ .timezone-setting-form label {
min-width: fit-content;
}
.alert-notification.custom-field-status,
- .alert-notification.full-name-status {
+ .alert-notification.full-name-status,
+ .alert-notification.timezone-setting-status {
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
diff --git a/static/templates/settings/display_settings.hbs b/static/templates/settings/display_settings.hbs
index 99ad6dfae10..fcd9b2fbab2 100644
--- a/static/templates/settings/display_settings.hbs
+++ b/static/templates/settings/display_settings.hbs
@@ -68,19 +68,6 @@
{{/each}}
</select>
</div>
-
- <div class="input-group">
- <label for="timezone" class="dropdown-title">{{t "Time zone" }}</label>
- <select name="timezone" id="user_timezone">
- {{#unless page_params.timezone}}
- <option></option>
- {{/unless}}
-
- {{#each timezones}}
- <option value="{{ this }}">{{ this }}</option>
- {{/each}}
- </select>
- </div>
</div>
<div id="user-emoji-settings">
diff --git a/static/templates/settings/profile_settings.hbs b/static/templates/settings/profile_settings.hbs
index 562be7ec69f..0f3a81f5991 100644
--- a/static/templates/settings/profile_settings.hbs
+++ b/static/templates/settings/profile_settings.hbs
@@ -18,6 +18,23 @@
</div>
</div>
</form>
+ <form class="form-horizontal timezone-setting-form">
+ <div class="input-group grid">
+ <label for="timezone" class="dropdown-title inline-block">{{t "Time zone" }}</label>
+ <div class="alert-notification timezone-setting-status"></div>
+ <div class="timezone-input">
+ <select name="timezone" id="user_timezone" class>
+ {{#unless page_params.timezone}}
+ <option></option>
+ {{/unless}}
+
+ {{#each timezones}}
+ <option value="{{ this }}">{{ this }}</option>
+ {{/each}}
+ </select>
+ </div>
+ </div>
+ </form>
<form class="form-horizontal custom-profile-fields-form grid"></form>
<button class="button rounded sea-green w-200 block" id="show_my_user_profile_modal">
diff --git a/templates/zerver/help/change-your-timezone.md b/templates/zerver/help/change-your-timezone.md
index 73a0f876307..a3d04433dbc 100644
--- a/templates/zerver/help/change-your-timezone.md
+++ b/templates/zerver/help/change-your-timezone.md
@@ -12,8 +12,8 @@ You can change the timezone Zulip displays to others.
{start_tabs}
-{settings_tab|display-settings}
+{settings_tab|profile}
-2. Under **Time settings**, select a timezone.
+2. Under **Profile**, select a timezone.
{end_tabs}