Commit Graph

31 Commits

Author SHA1 Message Date
m-e-l-u-h-a-n 64339e6b60 minor: Improve heading for different stream setting subsections. 2021-07-08 17:53:58 -07:00
m-e-l-u-h-a-n 889229ba16 stream settings: Improve message for no description streams. 2021-07-08 17:53:57 -07:00
m-e-l-u-h-a-n 060ae0226c stream settings: Move stream email to General settings tab. 2021-07-08 17:47:14 -07:00
m-e-l-u-h-a-n cb4797e3b7 stream settings: Re-design stream settings page using tab-switchers.
We move away from a single scrollable page to have a tabs settings
structure instead.
This commit consists of the minimal changes required to set up toggler
component. And the subsequent commits would include all the UI UX
changes required for updating the layouts.

Co-authored-by: Ryan Rehman <ryanrehman99@gmail.com>
2021-07-08 17:47:13 -07:00
m-e-l-u-h-a-n c0afe9d8f4 templates: Wrap subscription settings into 3 respective sections.
We wrap the general stream name, description and type properties in
a "general_settings" div.

The "regular_subscription_settings" div was already present, so the
only change made was renaming this to "personal_settings".

We also wrap the email and adding of members settings in a new
"subscriber_settings" div.

This is a prep commit which will be helpful when we want to display
only one section and hide the other two.

Co-authored-by: Ryan Rehman <ryanrehman99@gmail.com>
2021-07-05 14:36:45 -07:00
m-e-l-u-h-a-n 9cb8e1b286 streams: Eliminate content-editable to change stream info.
The current system to change stream information like Stream name and
description isn't consistent with what we use everywhere else. It's
also slightly difficult to maintain.

Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
2021-07-05 14:35:15 -07:00
Pankaj Patil 88b25d0c21 stream settings: Change icon and tooltip for Archive stream.
Fixes #19049.
2021-07-05 14:34:29 -07:00
m-e-l-u-h-a-n 41dc123cf1 streams: Reorder buttons in button-group to reflect the visual order.
Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
2021-06-23 17:45:02 -07:00
Anders Kaseorg b7093a93dc templates: Fix reference to nonexistent oneself variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-13 17:41:10 -07:00
Mateusz Mandera 82b43a8cfe streams: Use "archive stream" phrasing instead of "delete stream".
The previous phrasing was misleading in relation to what the action
actually does.
2021-04-02 22:06:48 -07:00
Aman Agrawal 965b443075 subscription_settings: Show eye icon for view stream button.
This reduces the unnecessary width that the button takes.
2020-11-03 16:48:23 -08:00
sahil839 ab90abfa4c stream_data: Rename sub.is_admin to sub.is_realm_admin.
This commit renames sub.is_admin to sub.is_realm_admin such that
we can clearly differentiate between realm and stream admins.
2020-09-14 22:05:31 -07:00
sahil839 821e25ffb0 streams: Show message retention policy details in subscription_type text.
This commit adds message retention policy details in the subscription_type
text below the stream description.

We do not show any text when realm-level settings is set to forever and
stream-level is set to either forever or realm_default.
2020-06-18 17:13:04 -07:00
Pragati Agrawal d333d82693 stream settings: Move the "Saving" widget to "Personal settings" block.
Rather than showing the "Saving" widget beside stream name, it's more
intuitive to have it in personal settings section because it's the only
section which uses `settings_ui.do_settings_change` function and we follow
having a separate "Saving" widget for each section everywhere.
2020-05-24 16:32:36 -07:00
Pragati Agrawal f7a886d821 stream settings: Add label for `regular_subscription_settings`.
Added the label for `regular_subscription_settings` as "Personal settings".
2020-05-24 16:32:36 -07:00
Pragati Agrawal ce23892aec stream settings: Move stream-email-box from regular_subscription_settings.
`stream-email-box` doesn't fit into `regular_subscription_settings` div,
therefore moved `stream-email-box` out of it.
2020-05-24 16:32:36 -07:00
Pragati Agrawal 441f9f43e7 templates: Extract help link widget.
This block of html is used at many places so it's a good idea to create a
template for it.
2020-05-24 16:32:36 -07:00
Ryan Rehman 39577b58ba stream settings: Display success/failure status for edits.
We have an alert for when the stream name is changed.
This also adds an alert when subscription settings
are updated and the widget is similar to that used in
the settings page.

This is also necessary because the stream specific
notification settings UI updation goes through this
path and it is necessary to display a confirmation
to match with other settings confirmation pattern.
2020-04-01 14:40:41 -07:00
Ryan Rehman c59997b148 templates: Extract subscription_privacy partial template. 2020-04-01 14:40:41 -07:00
Anders Kaseorg 68cfcd6446 CVE-2020-9444: Prevent reverse tabnabbing attacks.
While we could fix this issue by changing the markdown processor,
doing so is not a robust solution, because even a momentary bug in the
markdown processor could allow cached messages that do not follow our
security policy.

This change ensures that even if our markdown processor has bugs that
result in rendered content that does not properly follow our policy of
using rel="noopener noreferrer" on links, we'll still do something
reasonable.

Co-authored-by: Tim Abbott <tabbott@zulipchat.com>
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-01 14:01:45 -07:00
Ryan Rehman 174b2abcfd settings: Migrate to stream_post_policy structure.
This commit includes a new `stream_post_policy` setting,
by replacing the `is_announcement_only` field from the Stream model,
which is done by mirroring the structure of the existing
`create_stream_policy`.

It includes the necessary schema and database migrations to migrate
the is_announcement_only boolean field to stream_post_policy,
a smallPositiveInteger field similar to many other settings.

This change is done to allow organization administrators to restrict
new members from creating and posting to a stream. However, this does
not affect admins who are new members.

With many tweaks by tabbott to documentation under /help, etc.

Fixes #13616.
2020-02-04 17:08:08 -08:00
Vaibhav Raj Singh 3dec7f6f6f design: Fixes poor line wrapping of long stream names using ellipses.
Earlier, on narrowing the window to some particular sizes,
long stream names used to overlap with the subscribe and view stream
buttons.
The issue was resolved by cutting the stream name short and putting
ellipses at the end. A title was provided to the stream name div so that
the entire stream name would be visible on hovering over it.

Fixes: #13139
2020-02-02 21:34:00 -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
Tim Abbott fd5f9be14f stream settings: Use fa-circle-o for link to /help/. 2019-09-05 11:48:32 -07:00
Tim Abbott 94c51676fe stream settings: Use <label> tags for section labels.
Previously, these were configured as divs.
2019-09-05 11:48:32 -07:00
Mateusz Mandera bf7f4f3f1b stream settings: Replace email address hint popup with link to docs.
Fixes #13134 as the last commit in the series for this issue.
Solves the "The (?) should just be a target=_blank link to
/help/message-a-stream-by-email." part of the issue.
As a result, a bunch code managing the email hint popup can be deleted,
together with a node test for that.
2019-09-05 11:48:32 -07:00
Anders Kaseorg 0c565f50be templates: Use upstream Handlebars partials syntax.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -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