settings: Fix header in settings overlay.

Previously the header of settings overlay
was 'SETTINGS / {name_of_section}'.

This commit changes it to be one of the two
mentioned below according to the opened
section-
1. 'PERSONAL SETTINGS / {name_of_section}'
2. 'ORGANIZATION SETTINGS / {name_of_section}'

Note - Have kept the header as original in
case of mobile as the above text will be
too long.
This commit is contained in:
sahil839 2021-07-01 15:08:38 +05:30 committed by Tim Abbott
parent cdaf9bf87a
commit 8290a6fd8f
2 changed files with 8 additions and 1 deletions

View File

@ -148,6 +148,13 @@ export function launch(section) {
} }
export function set_settings_header(key) { export function set_settings_header(key) {
const selected_tab_key = $("#settings_page .tab-switcher .selected").data("tab-key");
let header_prefix = $t_html({defaultMessage: "Personal settings"});
if (selected_tab_key === "organization") {
header_prefix = $t_html({defaultMessage: "Organization settings"});
}
$(".settings-header h1 .header-prefix").text(header_prefix);
const header_text = $( const header_text = $(
`#settings_page .sidebar-list [data-section='${CSS.escape(key)}'] .text`, `#settings_page .sidebar-list [data-section='${CSS.escape(key)}'] .text`,
).text(); ).text();

View File

@ -178,7 +178,7 @@
</div> </div>
<div class="content-wrapper right"> <div class="content-wrapper right">
<div class="settings-header"> <div class="settings-header">
<h1>{{ _('Settings') }}<span class="section"></span></h1> <h1><span class="header-prefix"></span><span class="section"></span></h1>
<div class="exit"> <div class="exit">
<span class="exit-sign">&times;</span> <span class="exit-sign">&times;</span>
</div> </div>