mirror of https://github.com/zulip/zulip.git
templates: Wrap subscription settings into 3 respective sections.
We wrap the general stream name, description and type properties in a "general_settings" div. The "regular_subscription_settings" div was already present, so the only change made was renaming this to "personal_settings". We also wrap the email and adding of members settings in a new "subscriber_settings" div. This is a prep commit which will be helpful when we want to display only one section and hide the other two. Co-authored-by: Ryan Rehman <ryanrehman99@gmail.com>
This commit is contained in:
parent
9cb8e1b286
commit
c0afe9d8f4
|
@ -81,9 +81,9 @@ export function update_regular_sub_settings(sub) {
|
|||
$settings.find(".email-address").text(sub.email_address);
|
||||
$settings.find(".stream-email-box").show();
|
||||
}
|
||||
$settings.find(".regular_subscription_settings").addClass("in");
|
||||
$settings.find(".personal_settings").addClass("in");
|
||||
} else {
|
||||
$settings.find(".regular_subscription_settings").removeClass("in");
|
||||
$settings.find(".personal_settings").removeClass("in");
|
||||
// Clear email address widget
|
||||
$settings.find(".email-address").html("");
|
||||
}
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
<div class="subscription_settings" data-stream-id="{{sub.stream_id}}">
|
||||
<div class="inner-box">
|
||||
|
||||
{{#with sub}}
|
||||
<div class="stream-header">
|
||||
{{> subscription_privacy
|
||||
invite_only=invite_only
|
||||
is_web_public=is_web_public }}
|
||||
<div class="stream-name">
|
||||
<span class="sub-stream-name" title="{{name}}">{{name}}</span>
|
||||
</div>
|
||||
<div class="stream_change_property_info alert-notification"></div>
|
||||
<div class="button-group">
|
||||
<button id="open_stream_info_modal" class="button rounded small btn-warning" title="{{t 'Change stream info' }}">
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||
</button>
|
||||
<div class="sub_unsub_button_wrapper inline-block">
|
||||
<button class="button small rounded subscribe-button sub_unsub_button {{#unless subscribed }}unsubscribed{{/unless}}" type="button" name="button" {{#if should_display_subscription_button}}title="{{t 'Toggle subscription'}} (S)" {{else}}disabled="disabled"{{/if}}>
|
||||
{{#if subscribed }}{{t "Unsubscribe"}}{{else}}{{t "Subscribe"}}{{/if}}</button>
|
||||
<div class="general_settings">
|
||||
{{#with sub}}
|
||||
<div class="stream-header">
|
||||
{{> subscription_privacy
|
||||
invite_only=invite_only
|
||||
is_web_public=is_web_public }}
|
||||
<div class="stream-name">
|
||||
<span class="sub-stream-name" title="{{name}}">{{name}}</span>
|
||||
</div>
|
||||
<div class="stream_change_property_info alert-notification"></div>
|
||||
<div class="button-group">
|
||||
<button id="open_stream_info_modal" class="button rounded small btn-warning" title="{{t 'Change stream info' }}">
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||
</button>
|
||||
<div class="sub_unsub_button_wrapper inline-block">
|
||||
<button class="button small rounded subscribe-button sub_unsub_button {{#unless subscribed }}unsubscribed{{/unless}}" type="button" name="button" {{#if should_display_subscription_button}}title="{{t 'Toggle subscription'}} (S)" {{else}}disabled="disabled"{{/if}}>
|
||||
{{#if subscribed }}{{#tr}}Unsubscribe{{/tr}}{{else}}{{#tr}}Subscribe{{/tr}}{{/if}}</button>
|
||||
</div>
|
||||
<a href="{{preview_url}}" class="button small rounded" id="preview-stream-button" role="button" title="{{t 'View stream'}} (V)" {{#unless should_display_preview_button }}style="display: none"{{/unless}}><i class="fa fa-eye"></i></a>
|
||||
{{#if is_realm_admin}}
|
||||
<button class="button small rounded btn-danger deactivate" type="button" name="delete_button" title="{{t 'Archive stream for everyone'}}"> <i class="fa fa-archive" aria-hidden="true"></i></button>
|
||||
{{/if}}
|
||||
</div>
|
||||
<a href="{{preview_url}}" class="button small rounded" id="preview-stream-button" role="button" title="{{t 'View stream'}} (V)" {{#unless should_display_preview_button }}style="display: none"{{/unless}}>
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
{{#if is_realm_admin}}
|
||||
<button class="button small rounded btn-danger deactivate" type="button" name="delete_button" title="{{t 'Archive stream for everyone'}}"> <i class="fa fa-archive" aria-hidden="true"></i></button>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="stream-description">
|
||||
<span class="sub-stream-description rendered_markdown" data-no-description="{{t 'No description.' }}">
|
||||
{{rendered_markdown rendered_description}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="subscription-type">
|
||||
<div class="subscription-type-text">
|
||||
{{> subscription_type
|
||||
stream_post_policy_values=../stream_post_policy_values
|
||||
message_retention_text=../message_retention_text}}
|
||||
<div class="stream-description">
|
||||
<span class="sub-stream-description rendered_markdown" data-no-description="{{t 'No description.' }}">
|
||||
{{rendered_markdown rendered_description}}
|
||||
</span>
|
||||
</div>
|
||||
<a class="change-stream-privacy" {{#unless can_change_stream_permissions}}style="display: none;"{{/unless}}>[{{t "Change" }}]</a>
|
||||
<div class="subscription-type">
|
||||
<div class="subscription-type-text">
|
||||
{{> subscription_type
|
||||
stream_post_policy_values=../stream_post_policy_values
|
||||
message_retention_text=../message_retention_text}}
|
||||
</div>
|
||||
<a class="change-stream-privacy" {{#unless can_change_stream_permissions}}style="display: none;"{{/unless}}>[{{t "Change" }}]</a>
|
||||
</div>
|
||||
{{/with}}
|
||||
</div>
|
||||
{{/with}}
|
||||
|
||||
<div class="regular_subscription_settings collapse {{#sub.subscribed}}in{{/sub.subscribed}}">
|
||||
<div class="personal_settings collapse {{#sub.subscribed}}in{{/sub.subscribed}}">
|
||||
<div id="personal_settings_label_container">
|
||||
<label class="sub_settings_title inline-block">
|
||||
{{t "Personal settings" }}
|
||||
|
@ -72,19 +72,22 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stream-email-box" {{#unless sub.email_address}}style="display: none;"{{/unless}}>
|
||||
<label class="sub_settings_title">
|
||||
{{t "Email address" }}
|
||||
{{> help_link_widget link="/help/message-a-stream-by-email" }}
|
||||
</label>
|
||||
<div class="stream-email">
|
||||
<span class="email-address">{{sub.email_address}}</span>
|
||||
|
||||
<div class="subscriber_settings">
|
||||
<div class="stream-email-box" {{#unless sub.email_address}}style="display: none;"{{/unless}}>
|
||||
<label class="sub_settings_title">
|
||||
{{t "Email address" }}
|
||||
{{> help_link_widget link="/help/message-a-stream-by-email" }}
|
||||
</label>
|
||||
<div class="stream-email">
|
||||
<span class="email-address">{{sub.email_address}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{#with sub}}
|
||||
<div class="subscription-members-setting">
|
||||
{{> subscription_members}}
|
||||
</div>
|
||||
{{/with}}
|
||||
</div>
|
||||
{{#with sub}}
|
||||
<div class="subscription-members-setting">
|
||||
{{> subscription_members}}
|
||||
</div>
|
||||
{{/with}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue