stream settings: Improve title for stream settings based on content.

We had a common title `stream settings` for two cases
when no stream was selected and also when settings for
a particular stream were shown.

To improve this situation we now show `Settings for {stream_name}`
when settings for a particular stream are shown.
This commit is contained in:
m-e-l-u-h-a-n 2021-07-04 21:42:08 +05:30 committed by Tim Abbott
parent cb4797e3b7
commit e8030fadc6
2 changed files with 7 additions and 2 deletions

View File

@ -182,7 +182,7 @@ export function open_edit_panel_for_row(stream_row) {
const sub = get_sub_for_target(stream_row);
$(".stream-row.active").removeClass("active");
subs.show_subs_pane.settings();
subs.show_subs_pane.settings(sub.name);
$(stream_row).addClass("active");
setup_subscriptions_stream_hash(sub);
setup_stream_settings(stream_row);

View File

@ -41,14 +41,19 @@ export const show_subs_pane = {
nothing_selected() {
$(".stream-info-title, .settings, #stream-creation").hide();
$("#stream_settings_title, .nothing-selected").show();
$("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Stream settings"}));
},
settings() {
settings(stream_name) {
$(".stream-info-title, .settings, #stream-creation").hide();
$("#stream_settings_title, .settings").show();
$("#subscription_overlay .stream-info-title").text(
$t({defaultMessage: "Settings for #{stream_name}"}, {stream_name}),
);
},
create_stream() {
$(".stream-info-title, .nothing-selected, .settings, #stream-creation").hide();
$("#add_new_stream_title, #stream-creation").show();
$("#subscription_overlay .stream-info-title").text($t({defaultMessage: "Create stream"}));
},
};