Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

17.1 KB
Raw Blame
<form class="notification-settings-form">
    <div class="general_notifications {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">
        <div class="subsection-header">
            <h3 class="settings-subsection-title">{{t "Notification triggers" }}</h3>
            {{#if for_realm_settings}}
                {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
            {{/if}}
            {{> settings_save_discard_widget section_name="general-notify-settings" show_save_discard_buttons=for_realm_settings }}
        </div>
        <p>{{t "Configure how Zulip notifies you about new messages." }}</p>
        <table class="notification-table table table-bordered wrapped-table">
            <thead>
                <tr>
                    <th rowspan="2" width="30%"></th>
                    <th colspan="2" width="28%">{{t "Desktop"}}</th>
                    <th rowspan="2" width="14%">
                        <span {{#if (not realm_push_notifications_enabled) }}class="control-label-disabled tippy-zulip-tooltip" data-tooltip-template-id="mobile-push-notification-tooltip-template"{{/if}}>
                            {{t "Mobile"}}
                        </span>
                        {{> ../help_link_widget link="/help/mobile-notifications#enabling-push-notifications-for-self-hosted-servers" }}
                    </th>
                    <th rowspan="2" width="14%">{{t "Email"}}</th>
                    <th rowspan="2" width="14%">@all
                        <i class="zulip-icon zulip-icon-help settings-info-icon tippy-zulip-tooltip" aria-hidden="true" data-tippy-content="{{t 'Whether wildcard mentions like @all are treated as mentions for the purpose of notifications.' }}"></i>
                    </th>
                </tr>
                <tr>
                    <th>{{t "Visual"}}</th>
                    <th>{{t "Audible"}}</th>
                </tr>
            </thead>
            <tbody>
                {{#each general_settings}}
                    <tr>
                        <td>
                            {{ this.label }}
                            {{#if this.help_link}}
                                {{> ../help_link_widget link=this.help_link }}
                            {{/if}}
                        </td>
                        {{#each this.notification_settings}}
                            {{> notification_settings_checkboxes
                              setting_name=this.setting_name
                              is_checked=this.is_checked
                              is_disabled=this.is_disabled
                              is_mobile_checkbox=this.is_mobile_checkbox
                              push_notifications_disabled=this.push_notifications_disabled
                              prefix=../../prefix }}
                        {{/each}}
                    </tr>
                {{/each}}
            </tbody>
            {{#unless for_realm_settings}}
            <tbody id="stream-specific-notify-table">
            </tbody>
            <tbody id="customizable_stream_notifications_table">
                <tr>
                    <td>
                        {{> ../dropdown_widget widget_name="customize_stream_notifications" custom_classes="decorated-stream-name-dropdown-widget"}}
                    </td>
                    {{#each custom_stream_specific_notification_settings}}
                        {{> notification_settings_checkboxes
                          setting_name=this.setting_name
                          is_checked=this.is_checked
                          is_mobile_checkbox=this.is_mobile_checkbox
                          is_disabled=this.is_disabled
                          push_notifications_disabled=this.push_notifications_disabled
                          prefix="customize_stream_" }}
                    {{/each}}
                </tr>
            </tbody>
            {{/unless}}
        </table>
    </div>

    <div class="topic_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">

        <div class="subsection-header">
            <h3 class="settings-subsection-title">{{t "Topic notifications" }}
                {{> ../help_link_widget link="/help/topic-notifications" }}
            </h3>
            {{> settings_save_discard_widget section_name="topic-notifications-settings" show_save_discard_buttons=for_realm_settings }}
        </div>
        <p>
            {{#tr}}
                You will automatically follow topics that you have configured to both <z-follow>follow</z-follow> and <z-unmute>unmute</z-unmute>.
                {{#*inline "z-follow"}}<a href="/help/follow-a-topic" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
                {{#*inline "z-unmute"}}<a href="/help/mute-a-topic" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
            {{/tr}}
        </p>

        <div class="input-group">
            <label for="{{prefix}}automatically_follow_topics_policy" class="settings-field-label">
                {{ settings_label.automatically_follow_topics_policy }}
                {{> ../help_link_widget link="/help/follow-a-topic" }}
                {{#if for_realm_settings}}
                    {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
                {{/if}}
            </label>
            <select name="automatically_follow_topics_policy" class="setting_automatically_follow_topics_policy prop-element settings_select bootstrap-focus-style"
              id="{{prefix}}automatically_follow_topics_policy" data-setting-widget-type="number">
                {{> dropdown_options_widget option_values=(object_values automatically_follow_topics_policy_values)}}
            </select>
        </div>

        {{> settings_checkbox
          setting_name="automatically_follow_topics_where_mentioned"
          is_checked=(lookup settings_object "automatically_follow_topics_where_mentioned")
          label=(lookup settings_label "automatically_follow_topics_where_mentioned")
          prefix=prefix
          show_reset_button=for_realm_settings}}

        <div class="input-group">
            <label for="{{prefix}}automatically_unmute_topics_in_muted_streams_policy" class="settings-field-label">
                {{ settings_label.automatically_unmute_topics_in_muted_streams_policy }}
                {{> ../help_link_widget link="/help/mute-a-topic" }}
                {{#if for_realm_settings}}
                    {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
                {{/if}}
            </label>
            <select name="automatically_unmute_topics_in_muted_streams_policy" class="setting_automatically_unmute_topics_in_muted_streams_policy prop-element settings_select bootstrap-focus-style"
              id="{{prefix}}automatically_unmute_topics_in_muted_streams_policy" data-setting-widget-type="number">
                {{> dropdown_options_widget option_values=(object_values automatically_unmute_topics_in_muted_streams_policy_values)}}
            </select>
        </div>

        <div class="input-group">
            <label for="{{prefix}}resolved_topic_notice_auto_read_policy" class="settings-field-label">
                {{t "Automatically mark resolved topic notices as read" }}
                {{#if for_realm_settings}}
                    {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
                {{/if}}
            </label>
            <select name="resolved_topic_notice_auto_read_policy" class="setting_resolved_topic_notice_auto_read_policy prop-element settings_select bootstrap-focus-style" id="{{prefix}}resolved_topic_notice_auto_read_policy" data-setting-widget-type="string">
                {{> dropdown_options_widget option_values=(object_values resolved_topic_notice_auto_read_policy_values)}}
            </select>
        </div>
    </div>

    <div class="desktop_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">

        <div class="subsection-header">
            <h3 class="settings-subsection-title">{{t "Desktop message notifications" }}
                {{> ../help_link_widget link="/help/desktop-notifications" }}
            </h3>
            {{> settings_save_discard_widget section_name="desktop-message-settings" show_save_discard_buttons=for_realm_settings }}
        </div>

        {{#if (eq prefix "user_")}}
        <div class="desktop-notification-settings-banners banner-wrapper"></div>
        {{/if}}

        {{#unless for_realm_settings}}
        {{> ../components/action_button
          label=(t "Send a test notification")
          variant="subtle"
          intent="neutral"
          custom_classes="send_test_notification"
          }}
        {{/unless}}

        {{#each notification_settings.desktop_notification_settings}}
            {{> settings_checkbox
              setting_name=this
              is_checked=(lookup ../settings_object this)
              label=(lookup ../settings_label this)
              prefix=../prefix
              show_reset_button=../for_realm_settings}}
        {{/each}}

        <div class="input-group">
            <label for="{{prefix}}notification_sound" class="settings-field-label">
                {{t "Notification sound" }}
                {{#if for_realm_settings}}
                    {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
                {{/if}}
            </label>
            <div class="input-element-with-control {{#unless enable_sound_select}}control-label-disabled{{/unless}}">
                <select name="notification_sound" class="setting_notification_sound prop-element settings_select bootstrap-focus-style" id="{{prefix}}notification_sound" data-setting-widget-type="string"
                  {{#unless enable_sound_select}}
                  disabled
                  {{/unless}}>
                    <option value="none">{{t "None" }}</option>
                    {{#each settings_object.available_notification_sounds}}
                        <option value="{{ this }}">{{ this }}</option>
                    {{/each}}
                </select>
                {{> ../components/icon_button icon="play-circle" intent="neutral" custom_classes="play_notification_sound" aria-label=(t "Play sound") }}
            </div>
        </div>

        <div class="input-group">
            <label for="{{prefix}}desktop_icon_count_display" class="settings-field-label">
                {{ settings_label.desktop_icon_count_display }}
                {{#if for_realm_settings}}
                    {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
                {{/if}}
            </label>
            <select name="desktop_icon_count_display" class="setting_desktop_icon_count_display prop-element settings_select bootstrap-focus-style" id="{{prefix}}desktop_icon_count_display" data-setting-widget-type="number">
                {{> dropdown_options_widget option_values=(object_values desktop_icon_count_display_values)}}
            </select>
        </div>
    </div>

    <div class="mobile_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">

        <div class="subsection-header">
            <h3 class="settings-subsection-title">{{t "Mobile message notifications" }}
                {{> ../help_link_widget link="/help/mobile-notifications" }}
            </h3>
            {{> settings_save_discard_widget section_name="mobile-message-settings" show_save_discard_buttons=for_realm_settings }}
        </div>
        {{#unless realm_push_notifications_enabled}}
        <div class="mobile-push-notifications-banner-container banner-wrapper">
        </div>
        {{/unless}}

        {{#each notification_settings.mobile_notification_settings}}
            {{> settings_checkbox
              setting_name=this
              is_checked=(lookup ../settings_object this)
              is_disabled=(lookup ../disabled_notification_settings this)
              label=(lookup ../settings_label this)
              prefix=../prefix
              show_reset_button=../for_realm_settings}}
        {{/each}}
    </div>

    <div class="email_message_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">

        <div class="subsection-header">
            <h3 class="settings-subsection-title">{{t "Email message notifications" }}
                {{> ../help_link_widget link="/help/email-notifications" }}
            </h3>
            {{> settings_save_discard_widget section_name="email-message-settings" show_save_discard_buttons=for_realm_settings }}
        </div>

        <div class="input-group time-limit-setting">

            <label for="{{prefix}}email_notifications_batching_period_seconds" class="settings-field-label">
                {{t "Delay before sending message notification emails" }}
                {{#if for_realm_settings}}
                    {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
                {{/if}}
            </label>
            <select name="email_notifications_batching_period_seconds" class="setting_email_notifications_batching_period_seconds prop-element settings_select bootstrap-focus-style" id="{{prefix}}email_notifications_batching_period_seconds" data-setting-widget-type="time-limit">
                {{#each email_notifications_batching_period_values}}
                    <option value="{{ this.value }}">{{ this.description }}</option>
                {{/each}}
            </select>
            <div class="dependent-settings-block">
                <label for="{{prefix}}email_notification_batching_period_edit_minutes" class="inline-block">
                    {{t 'Delay period (minutes)' }}:
                </label>
                <input type="text"
                  name="email_notification_batching_period_edit_minutes"
                  class="email_notification_batching_period_edit_minutes time-limit-custom-input"
                  data-setting-widget-type="time-limit"
                  autocomplete="off"
                  id="{{prefix}}email_notification_batching_period_edit_minutes"/>
            </div>
        </div>

        <div class="input-group">
            <label for="{{prefix}}realm_name_in_email_notifications_policy" class="settings-field-label">
                {{ settings_label.realm_name_in_email_notifications_policy }}
                {{#if for_realm_settings}}
                    {{> ../components/icon_button icon="reset" intent="neutral" custom_classes="reset-user-setting-to-default" data-tippy-content=(t "Reset users to default") aria-label=(t "Reset users to default") }}
                {{/if}}
            </label>
            <select name="realm_name_in_email_notifications_policy" class="setting_realm_name_in_email_notifications_policy prop-element settings_select bootstrap-focus-style" id="{{prefix}}realm_name_in_email_notifications_policy" data-setting-widget-type="number">
                {{> dropdown_options_widget option_values=(object_values realm_name_in_email_notifications_policy_values)}}
            </select>
        </div>

        {{#each notification_settings.email_message_notification_settings}}
            {{> settings_checkbox
              setting_name=this
              is_checked=(lookup ../settings_object this)
              label=(lookup ../settings_label this)
              is_disabled=(lookup ../disabled_notification_settings this)
              prefix=../prefix
              show_reset_button=../for_realm_settings}}
        {{/each}}
    </div>

    <div class="other_email_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">

        <div class="subsection-header">
            <h3 class="settings-subsection-title">{{t "Other emails" }}</h3>
            {{> settings_save_discard_widget section_name="other-emails-settings" show_save_discard_buttons=for_realm_settings }}
        </div>
        {{#each notification_settings.other_email_settings}}
            {{> settings_checkbox
              setting_name=this
              is_checked=(lookup ../settings_object this)
              label=(lookup ../settings_label this)
              prefix=../prefix
              show_reset_button=../for_realm_settings}}
        {{/each}}
    </div>
</form>