Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
two-pane-settings-css: Setup structure for multiple button groups.
PieterCK630d93a18fdc
diff --git a/web/src/stream_settings_components.ts b/web/src/stream_settings_components.tsindex 3dbce2872b7..e769222eda8 100644--- a/web/src/stream_settings_components.ts+++ b/web/src/stream_settings_components.ts@@ -37,7 +37,7 @@ export let archived_status_filter_dropdown_widget: DropdownWidget;export let channel_creation_privacy_widget: DropdownWidget;let folder_filter_dropdown_widget: DropdownWidget;-function set_visibility_for_archive_and_unarchive_buttons(sub: StreamSubscription): void {+function set_visibility_for_stream_title_buttons(sub: StreamSubscription): void {// This is for the Archive/Unarchive button in the right panel.const $archive_button = $(`.stream-title-buttons[data-stream-id='${CSS.escape(sub.stream_id.toString())}'] .deactivate`,@@ -78,7 +78,7 @@ export function set_right_panel_title(sub: StreamSubscription): void {}),).toggleClass("new-channel-members-title", false);- set_visibility_for_archive_and_unarchive_buttons(sub);+ set_visibility_for_stream_title_buttons(sub);}export const show_subs_pane = {diff --git a/web/styles/subscriptions.css b/web/styles/subscriptions.cssindex 71b33cd136c..0e143c74609 100644--- a/web/styles/subscriptions.css+++ b/web/styles/subscriptions.css@@ -487,11 +487,12 @@ h4.user_group_setting_subsection_title {width: unset;}+ /* The right pane header/title for user group and channel setting menu has+ two major components, The group/channel name section and the button groups. */.selected-group-title,.selected-stream-title {display: flex;width: 100%;- justify-content: space-between;.selected-stream,.selected-group {@@ -500,6 +501,18 @@ h4.user_group_setting_subsection_title {white-space: nowrap;}+ /* These contain two button groups, the left group should stick to the+ right side of the group/channel title name, and the right group that+ should stick to the rightmost side of the right pane header. */+ .selected-group-buttons,+ .stream-title-buttons {+ display: flex;+ justify-content: space-between;+ /* Make the button groups stretch and take the rest of the right pane+ header */+ flex-grow: 1;+ }+.button-group {height: 1.25em;display: flex;diff --git a/web/templates/stream_settings/selected_stream_title.hbs b/web/templates/stream_settings/selected_stream_title.hbsindex 15a70c8f216..1ab588b47df 100644--- a/web/templates/stream_settings/selected_stream_title.hbs+++ b/web/templates/stream_settings/selected_stream_title.hbs@@ -19,46 +19,50 @@</template>{{#with sub}}<div class="button-group stream-title-buttons" data-stream-id="{{stream_id}}">- <div class="sub_unsub_button_wrapper inline-block {{#unless should_display_subscription_button }}cannot-subscribe-tooltip{{/unless}}" data-tooltip-template-id="cannot-subscribe-tooltip-template">- <template id="cannot-subscribe-tooltip-template">- <span>- {{#tr}}- Cannot subscribe to private channel <z-stream></z-stream>- {{#*inline "z-stream"}}{{> ../decorated_channel_name inline_with_text=true stream=../sub}}{{/inline}}- {{/tr}}- </span>- </template>- <button class="action-button subscribe-button sub_unsub_button {{#if subscribed}}action-button-subtle-neutral{{else}}action-button-subtle-brand{{/if}} {{#if should_display_subscription_button}}toggle-subscription-tooltip{{/if}} {{#unless subscribed }}unsubscribed{{/unless}}" type="button" name="button" data-tooltip-template-id="toggle-subscription-tooltip-template" {{#unless should_display_subscription_button}}disabled="disabled"{{/unless}}>- <span class="action-button-label">- {{#if subscribed }}- {{t "Unsubscribe" }}- {{else}}- {{t "Subscribe" }}- {{/if}}- </span>- </button>+ <div class="left-end button-group">+ </div>+ <div class="right-end button-group">+ <div class="sub_unsub_button_wrapper inline-block {{#unless should_display_subscription_button }}cannot-subscribe-tooltip{{/unless}}" data-tooltip-template-id="cannot-subscribe-tooltip-template">+ <template id="cannot-subscribe-tooltip-template">+ <span>+ {{#tr}}+ Cannot subscribe to private channel <z-stream></z-stream>+ {{#*inline "z-stream"}}{{> ../decorated_channel_name inline_with_text=true stream=../sub}}{{/inline}}+ {{/tr}}+ </span>+ </template>+ <button class="action-button subscribe-button sub_unsub_button {{#if subscribed}}action-button-subtle-neutral{{else}}action-button-subtle-brand{{/if}} {{#if should_display_subscription_button}}toggle-subscription-tooltip{{/if}} {{#unless subscribed }}unsubscribed{{/unless}}" type="button" name="button" data-tooltip-template-id="toggle-subscription-tooltip-template" {{#unless should_display_subscription_button}}disabled="disabled"{{/unless}}>+ <span class="action-button-label">+ {{#if subscribed }}+ {{t "Unsubscribe" }}+ {{else}}+ {{t "Subscribe" }}+ {{/if}}+ </span>+ </button>+ </div>+ {{> ../components/action_button+ icon="eye"+ variant="subtle"+ intent="neutral"+ custom_classes="tippy-zulip-delayed-tooltip"+ data-tooltip-template-id="view-stream-tooltip-template"+ id="preview-stream-button"+ hidden=(not should_display_preview_button)+ }}+ {{> ../components/icon_button+ icon="archive"+ intent="danger"+ custom_classes="tippy-zulip-delayed-tooltip deactivate"+ data-tippy-content=(t 'Archive channel')+ }}+ {{> ../components/icon_button+ icon="unarchive"+ intent="success"+ custom_classes="tippy-zulip-delayed-tooltip reactivate"+ data-tippy-content=(t 'Unarchive channel')+ }}</div>- {{> ../components/action_button- icon="eye"- variant="subtle"- intent="neutral"- custom_classes="tippy-zulip-delayed-tooltip"- data-tooltip-template-id="view-stream-tooltip-template"- id="preview-stream-button"- hidden=(not should_display_preview_button)- }}- {{> ../components/icon_button- icon="archive"- intent="danger"- custom_classes="tippy-zulip-delayed-tooltip deactivate"- data-tippy-content=(t 'Archive channel')- }}- {{> ../components/icon_button- icon="unarchive"- intent="success"- custom_classes="tippy-zulip-delayed-tooltip reactivate"- data-tippy-content=(t 'Unarchive channel')- }}</div>{{/with}}</div>diff --git a/web/templates/user_group_settings/selected_group_title.hbs b/web/templates/user_group_settings/selected_group_title.hbsindex f0cbc1f8a8f..4b07e743ec1 100644--- a/web/templates/user_group_settings/selected_group_title.hbs+++ b/web/templates/user_group_settings/selected_group_title.hbs@@ -6,7 +6,10 @@<span class="selected-group-name" data-tippy-content="{{group_name}}">{{group_name}}</span></span>{{#unless is_system_group}}- <div class="button-group selected-group-buttons" data-group-id="{{group_id}}">+ <div class="button-group selected-group-buttons" data-group-id="{{group_id}}">+ <div class="left-end button-group">+ </div>+ <div class="right-end button-group"><div class="join_leave_button_wrapper inline-block">{{#if is_direct_member}}{{> ../components/action_button label=(t "Leave group") custom_classes="join_leave_button" type="button"@@ -21,5 +24,6 @@{{> ../components/icon_button icon="user-group-plus" intent="success" custom_classes="reactivate-group-button reactivate tippy-zulip-delayed-tooltip"data-tippy-content=(t 'Reactivate group') }}</div>+ </div>{{/unless}}</div>