org settings: De-duplicate template code for notification streams settings.

This commit is contained in:
Pragati Agrawal
2020-01-12 00:45:18 +05:30
committed by Tim Abbott
parent bde8838d7e
commit 9a6b3c1cde
3 changed files with 29 additions and 42 deletions

View File

@@ -5,6 +5,8 @@ const admin_settings_label = {
realm_allow_community_topic_editing: i18n.t("Users can edit the topic of any message"), realm_allow_community_topic_editing: i18n.t("Users can edit the topic of any message"),
realm_allow_edit_history: i18n.t("Enable message edit history"), realm_allow_edit_history: i18n.t("Enable message edit history"),
realm_mandatory_topics: i18n.t("Require topics in stream messages"), realm_mandatory_topics: i18n.t("Require topics in stream messages"),
realm_notifications_stream: i18n.t("New stream notifications:"),
realm_signup_notifications_stream: i18n.t("New user notifications:"),
realm_inline_image_preview: i18n.t("Show previews of uploaded and linked images"), realm_inline_image_preview: i18n.t("Show previews of uploaded and linked images"),
realm_inline_url_embed_preview: i18n.t("Show previews of linked websites"), realm_inline_url_embed_preview: i18n.t("Show previews of linked websites"),
realm_default_twenty_four_hour_time: i18n.t("Time format"), realm_default_twenty_four_hour_time: i18n.t("Time format"),

View File

@@ -0,0 +1,21 @@
<div class="input-group">
<label for="realm_{{ notifications_type }}_stream" id="realm_{{ notifications_type }}_stream_label" class="inline-block">
{{ label }}
<span class="dropup actual-dropdown-menu" id="id_realm_{{ notifications_type }}_stream"
name="realm_{{ notifications_type }}_stream" aria-labelledby="realm_{{ notifications_type }}_stream_label">
<button class="button small rounded dropdown-toggle" data-toggle="dropdown">
<span id="realm_{{ notifications_type }}_stream_name"></span>
<i class="fa fa-pencil"></i>
</button>
<ul class="dropdown-menu modal-bg" role="menu">
<li class="dropdown-search" role="presentation">
<input class="no-input-change-detection" type="text" role="menuitem" placeholder="{{t 'Filter streams' }}" autofocus/>
</li>
<span class="dropdown-list-body" data-simplebar></span>
</ul>
</span>
</label>
{{#if is_admin }}
<a class="notification-disable" id="{{ notifications_type }}_stream_disable">{{t "[Disable]" }}</a>
{{/if}}
</div>

View File

@@ -102,49 +102,13 @@
</div> </div>
</div> </div>
<div class="input-group"> {{> notifications_stream_settings_widget
<label for="realm_notifications_stream" id="realm_notifications_stream_label" class="inline-block"> notifications_type="notifications"
{{t "New stream notifications:" }} label=admin_settings_label.realm_notifications_stream }}
<span class="dropup actual-dropdown-menu" id="id_realm_notifications_stream"
name="realm_notifications_stream" aria-labelledby="realm_notifications_stream_label">
<button class="button small rounded dropdown-toggle" data-toggle="dropdown">
<span id="realm_notifications_stream_name"></span>
<i class="fa fa-pencil"></i>
</button>
<ul class="dropdown-menu modal-bg" role="menu">
<li class="dropdown-search" role="presentation">
<input class="no-input-change-detection" type="text" role="menuitem" placeholder="{{t 'Filter streams' }}" autofocus/>
</li>
<span class="dropdown-list-body" data-simplebar></span>
</ul>
</span>
</label>
{{#if is_admin }}
<a class="notification-disable" id="notifications_stream_disable">{{t "[Disable]" }}</a>
{{/if}}
</div>
<div class="input-group"> {{> notifications_stream_settings_widget
<label for="realm_signup_notifications_stream" id="realm_signup_notifications_stream_label" class="inline-block"> notifications_type="signup_notifications"
{{t "New user notifications:" }} label=admin_settings_label.realm_signup_notifications_stream }}
<span class="dropup actual-dropdown-menu" id="id_realm_signup_notifications_stream"
name="realm_signup_notifications_stream" aria-labelledby="realm_signup_notifications_stream_label">
<button class="button small rounded dropdown-toggle" data-toggle="dropdown">
<span id="realm_signup_notifications_stream_name"></span>
<i class="fa fa-pencil"></i>
</button>
<ul class="dropdown-menu modal-bg" role="menu">
<li class="dropdown-search" role="presentation">
<input class="no-input-change-detection" type="text" role="menuitem" placeholder="{{t 'Filter streams' }}" autofocus/>
</li>
<span class="dropdown-list-body" data-simplebar></span>
</ul>
</span>
</label>
{{#if is_admin }}
<a class="notification-disable" id="signup_notifications_stream_disable">{{t "[Disable]" }}</a>
{{/if}}
</div>
</div> </div>
<div id="org-user-defaults" class="org-subsection-parent"> <div id="org-user-defaults" class="org-subsection-parent">