mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 22:48:16 +00:00
settings: Create user_notification_settings.hbs template.
This commit creates a new template user_notification_settings.hbs for user notification settings and notification_settings.hbs will be used as a common template for user-level and realm-level settings.
This commit is contained in:
@@ -1,111 +1,109 @@
|
|||||||
<div id="user-notification-settings" class="settings-section" data-name="notifications">
|
<form class="notification-settings-form">
|
||||||
<form class="notification-settings-form">
|
<div class="general_notifications subsection-parent">
|
||||||
<div class="general_notifications subsection-parent">
|
<h3 class="inline-block">{{t "Notification triggers" }}</h3>
|
||||||
<h3 class="inline-block">{{t "Notification triggers" }}</h3>
|
<div class="alert-notification general-notify-settings-status"></div>
|
||||||
<div class="alert-notification general-notify-settings-status"></div>
|
<p>{{t "Configure how Zulip notifies you about new messages." }}</p>
|
||||||
<p>{{t "Configure how Zulip notifies you about new messages." }}</p>
|
<table class="notification-table table table-condensed table-bordered wrapped-table">
|
||||||
<table class="notification-table table table-condensed table-bordered wrapped-table">
|
<thead>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
<th rowspan="2" width="30%"></th>
|
||||||
<th rowspan="2" width="30%"></th>
|
<th colspan="2" width="28%">{{t "Desktop"}}</th>
|
||||||
<th colspan="2" width="28%">{{t "Desktop"}}</th>
|
<th rowspan="2" width="14%" class="{{#if show_push_notifications_tooltip.push_notifications}}control-label-disabled{{/if}}">
|
||||||
<th rowspan="2" width="14%" class="{{#if show_push_notifications_tooltip.push_notifications}}control-label-disabled{{/if}}">
|
{{t "Mobile"}}
|
||||||
{{t "Mobile"}}
|
{{#if (not page_params.realm_push_notifications_enabled) }}
|
||||||
{{#if (not page_params.realm_push_notifications_enabled) }}
|
<i class="fa fa-question-circle settings-info-icon tippy-zulip-tooltip" data-tippy-content="{{t 'Mobile push notifications are not configured on this server.' }}"></i>
|
||||||
<i class="fa fa-question-circle settings-info-icon tippy-zulip-tooltip" data-tippy-content="{{t 'Mobile push notifications are not configured on this server.' }}"></i>
|
{{/if}}
|
||||||
{{/if}}
|
</th>
|
||||||
</th>
|
<th rowspan="2" width="14%">{{t "Email"}}</th>
|
||||||
<th rowspan="2" width="14%">{{t "Email"}}</th>
|
<th rowspan="2" width="14%">@all
|
||||||
<th rowspan="2" width="14%">@all
|
<i class="fa fa-question-circle settings-info-icon tippy-zulip-tooltip" data-tippy-content="{{t 'Whether wildcard mentions like @all are treated as mentions for the purpose of notifications.' }}"></i>
|
||||||
<i class="fa fa-question-circle settings-info-icon tippy-zulip-tooltip" data-tippy-content="{{t 'Whether wildcard mentions like @all are treated as mentions for the purpose of notifications.' }}"></i>
|
</th>
|
||||||
</th>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<th>{{t "Visual"}}</th>
|
||||||
<th>{{t "Visual"}}</th>
|
<th>{{t "Audio"}}</th>
|
||||||
<th>{{t "Audio"}}</th>
|
</tr>
|
||||||
</tr>
|
</thead>
|
||||||
</thead>
|
<tbody>
|
||||||
<tbody>
|
{{#each general_settings}}
|
||||||
{{#each general_settings}}
|
<tr>
|
||||||
<tr>
|
<td>{{ this.label }}</td>
|
||||||
<td>{{ this.label }}</td>
|
{{#each this.notification_settings}}
|
||||||
{{#each this.notification_settings}}
|
{{> notification_settings_checkboxes
|
||||||
{{> notification_settings_checkboxes
|
setting_name=this.setting_name
|
||||||
setting_name=this.setting_name
|
is_checked=this.is_checked
|
||||||
is_checked=this.is_checked
|
is_disabled=this.is_disabled }}
|
||||||
is_disabled=this.is_disabled }}
|
|
||||||
{{/each}}
|
|
||||||
</tr>
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tr>
|
||||||
<tbody id="stream-specific-notify-table">
|
{{/each}}
|
||||||
{{> ../settings/stream_specific_notification_row }}
|
</tbody>
|
||||||
</tbody>
|
<tbody id="stream-specific-notify-table">
|
||||||
</table>
|
{{> ../settings/stream_specific_notification_row }}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="other_notifications m-10 inline-block subsection-parent">
|
||||||
|
|
||||||
|
<h3 class="inline-block">{{t "Other notification settings" }}</h3>
|
||||||
|
<div class="alert-notification other-notify-settings-status"></div>
|
||||||
|
|
||||||
|
<h5>{{t "Desktop" }}</h5>
|
||||||
|
|
||||||
|
<p><a class="send_test_notification">{{t "Send test notification" }}</a></p>
|
||||||
|
|
||||||
|
{{#each notification_settings.desktop_notification_settings}}
|
||||||
|
{{> settings_checkbox
|
||||||
|
setting_name=this
|
||||||
|
is_checked=(lookup ../user_settings this)
|
||||||
|
label=(lookup ../settings_label this)}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
<label for="notification_sound">
|
||||||
|
{{t "Notification sound" }}
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="input-group {{#unless enable_sound_select}}control-label-disabled{{/unless}}">
|
||||||
|
<select name="notification_sound" class="notification_sound" data-setting-widget-type="string"
|
||||||
|
{{#unless enable_sound_select}}
|
||||||
|
disabled
|
||||||
|
{{/unless}}>
|
||||||
|
<option value="none">{{t "None" }}</option>
|
||||||
|
{{#each user_settings.available_notification_sounds}}
|
||||||
|
<option value="{{ this }}">{{ this }}</option>
|
||||||
|
{{/each}}
|
||||||
|
</select>
|
||||||
|
<span class="play_notification_sound">
|
||||||
|
<i class="fa fa-play-circle" aria-label="{{t 'Play sound' }}"></i>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="other_notifications m-10 inline-block subsection-parent">
|
<div class="input-group">
|
||||||
|
<label for="desktop_icon_count_display" class="dropdown-title">{{ settings_label.desktop_icon_count_display }}</label>
|
||||||
<h3 class="inline-block">{{t "Other notification settings" }}</h3>
|
<select name="desktop_icon_count_display" class="desktop_icon_count_display prop-element"
|
||||||
<div class="alert-notification other-notify-settings-status"></div>
|
data-setting-widget-type="number">
|
||||||
|
{{> dropdown_options_widget option_values=desktop_icon_count_display_values}}
|
||||||
<h5>{{t "Desktop" }}</h5>
|
</select>
|
||||||
|
|
||||||
<p><a class="send_test_notification">{{t "Send test notification" }}</a></p>
|
|
||||||
|
|
||||||
{{#each notification_settings.desktop_notification_settings}}
|
|
||||||
{{> settings_checkbox
|
|
||||||
setting_name=this
|
|
||||||
is_checked=(lookup ../user_settings this)
|
|
||||||
label=(lookup ../settings_label this)}}
|
|
||||||
{{/each}}
|
|
||||||
|
|
||||||
<label for="notification_sound">
|
|
||||||
{{t "Notification sound" }}
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<div class="input-group {{#unless enable_sound_select}}control-label-disabled{{/unless}}">
|
|
||||||
<select name="notification_sound" class="notification_sound" data-setting-widget-type="string"
|
|
||||||
{{#unless enable_sound_select}}
|
|
||||||
disabled
|
|
||||||
{{/unless}}>
|
|
||||||
<option value="none">{{t "None" }}</option>
|
|
||||||
{{#each user_settings.available_notification_sounds}}
|
|
||||||
<option value="{{ this }}">{{ this }}</option>
|
|
||||||
{{/each}}
|
|
||||||
</select>
|
|
||||||
<span class="play_notification_sound">
|
|
||||||
<i class="fa fa-play-circle" aria-label="{{t 'Play sound' }}"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-group">
|
|
||||||
<label for="desktop_icon_count_display" class="dropdown-title">{{ settings_label.desktop_icon_count_display }}</label>
|
|
||||||
<select name="desktop_icon_count_display" class="desktop_icon_count_display prop-element"
|
|
||||||
data-setting-widget-type="number">
|
|
||||||
{{> dropdown_options_widget option_values=desktop_icon_count_display_values}}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h5>{{t "Mobile" }}</h5>
|
|
||||||
|
|
||||||
{{#each notification_settings.mobile_notification_settings}}
|
|
||||||
{{> settings_checkbox
|
|
||||||
setting_name=this
|
|
||||||
is_checked=(lookup ../user_settings this)
|
|
||||||
label=(lookup ../settings_label this)
|
|
||||||
show_push_notifications_tooltip=(lookup ../show_push_notifications_tooltip this)}}
|
|
||||||
{{/each}}
|
|
||||||
|
|
||||||
<h5>{{t "Email" }}</h5>
|
|
||||||
|
|
||||||
{{#each notification_settings.email_notification_settings}}
|
|
||||||
{{> settings_checkbox
|
|
||||||
setting_name=this
|
|
||||||
is_checked=(lookup ../user_settings this)
|
|
||||||
label=(lookup ../settings_label this)}}
|
|
||||||
{{/each}}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
<h5>{{t "Mobile" }}</h5>
|
||||||
|
|
||||||
|
{{#each notification_settings.mobile_notification_settings}}
|
||||||
|
{{> settings_checkbox
|
||||||
|
setting_name=this
|
||||||
|
is_checked=(lookup ../user_settings this)
|
||||||
|
label=(lookup ../settings_label this)
|
||||||
|
show_push_notifications_tooltip=(lookup ../show_push_notifications_tooltip this)}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
<h5>{{t "Email" }}</h5>
|
||||||
|
|
||||||
|
{{#each notification_settings.email_notification_settings}}
|
||||||
|
{{> settings_checkbox
|
||||||
|
setting_name=this
|
||||||
|
is_checked=(lookup ../user_settings this)
|
||||||
|
label=(lookup ../settings_label this)}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|||||||
3
static/templates/settings/user_notification_settings.hbs
Normal file
3
static/templates/settings/user_notification_settings.hbs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<div id="user-notification-settings" class="settings-section" data-name="notifications">
|
||||||
|
{{> notification_settings}}
|
||||||
|
</div>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{{> settings/user_display_settings }}
|
{{> settings/user_display_settings }}
|
||||||
|
|
||||||
{{> settings/notification_settings }}
|
{{> settings/user_notification_settings }}
|
||||||
|
|
||||||
{{> settings/bot_settings }}
|
{{> settings/bot_settings }}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user