Commit Graph

8 Commits

Author SHA1 Message Date
Tim Abbott 0c0b446d43 templates: Reorder conditionals for stream_settings_checkbox.
This makes the template actually readable.
2020-01-28 14:26:53 -08:00
Tim Abbott b234c52699 templates: Wrap stream_settings_checkbox. 2020-01-28 14:23:47 -08:00
Pragati Agrawal b2c71b7cd8 stream edit: Move realm_setting_disabled in settings context.
Basic intention for this change is just to make code clean and intuitive.
2020-01-28 14:09:07 -08:00
Pragati Agrawal ada37a10f4 stream edit: Move logic for disabled checkboxes from template to js.
In templates we determine checkboxes are disabled by using the following
`if` clause,
```
{{#if (or (and is_muted notification_setting) realm_setting_disabled)}}
disabled="disabled"
{{/if}}
```
and it is more intuitive to do such calculation in javascript code, so we
added an `if_disabled` attribute in `settings` context which replaces
logical operations from `if` statement.

So for non-notification settings, it is
```
is_disabled: check_realm_setting[setting]
```
where check_realm_setting[setting] is same as realm_setting_disabled.

and for notifiaction settings it is,

```
ret.is_disabled = check_realm_setting[setting] || sub.is_muted;
```
2020-01-28 14:09:07 -08:00
Pragati Agrawal b862184d23 stream edit: Move is_checked calculation of stream settings in js.
It is more intuitive to do logical operations in js code instead of
templates and it is also cleaner.
2020-01-28 14:09:07 -08:00
Pragati Agrawal 0059624449 stream settings: Remove redundant arguments as a context to template.
This removes redundant arguments passed to `stream_settings_checkbox`
template from `subscription_settings`.
2020-01-28 14:09:07 -08:00
Yashashvi Dave 3f28f4a9f5 static/templates/stream_settings_checkbox: Simplify handlebar logic.
Fixes #12801
2019-07-25 14:56:12 -07:00
Anders Kaseorg 3c3471b720 templates: Rename *.handlebars ↦ *.hbs and - ↦ _.
Tweaked by tabbott to avoid accidentally disabling the linter for
handlebars templates.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:03 -07:00