zulip/static/templates/settings/settings_checkbox.handlebars
Shikhar Vaish 5ffca5e388 settings: Warn if server is unable to deliver mobile push notifications.
The "notification settings" page previously advertised support for
mobile push notifications via checkboxes, even if the server hadn't
yet been registered for push notifications.  This was a frequent
source of onboarding pain for new Zulip organizations.

We fix this by providing a clear warning and disabling the relevant
inputs on the settings pages.

Modified significantly by tabbott to correct some tricky logic errors
as well as some copy-paste bugs.

Fixes #10331.
2018-10-31 13:18:17 -07:00

22 lines
1.3 KiB
Handlebars

<div class="input-group {{#if is_nested}}disableable{{/if}} {{#if_not_a_or_b_and_not_c is_parent_setting_enabled push_notifications_tooltip page_params.realm_push_notifications_enabled}}control-label-disabled{{/if_not_a_or_b_and_not_c}}">
<label class="checkbox">
<input type="checkbox" class="inline-block" name="{{setting_name}}"
id="{{prefix}}{{setting_name}}"
{{#if_not_a_or_b_and_not_c is_parent_setting_enabled push_notifications_tooltip page_params.realm_push_notifications_enabled}}disabled="disabled"{{/if_not_a_or_b_and_not_c}}
{{#if is_checked}}
{{#unless_a_not_b push_notifications_tooltip page_params.realm_push_notifications_enabled}}
checked="checked"
{{/unless_a_not_b}}
{{/if}} />
<span></span>
</label>
<label for="{{prefix}}{{setting_name}}" class="inline-block" id="{{prefix}}{{setting_name}}_label">
{{{label}}}
</label>
{{#if push_notifications_tooltip}}
<i class="fa fa-question-circle settings-info-icon" {{#if page_params.realm_push_notifications_enabled}}style="display:none"{{/if}} data-toggle="tooltip"
title="{{t 'Mobile push notifications are not configured on this server.' }}"></i>
{{/if}}
{{{end_content}}}
</div>