mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
Earlier, a user can only mute a topic from its recipient bar but can't
unmute it from there (and in fact we displayed an option to mute even
if the topic was already muted!). This commit fixes that bug and
allows a user also to unmute the topic from its recipient bar.
There are two core issues here;
* We did not have code, an icon, etc. for the "already muted" case in
the recipient bar logic at all.
* We did not rerender messages in !excludes_muted_topics views when
muting state changed.
See: 660475bd0c for background on when
we started only rerendering the streams with excludes_muted_topics
after muting changes. Rerendering of newly muted topics are important
for live rendering if a user is narrowed to that topic itself, which
are essentially all excludes_muted_topics narrows anyway.
Hence, now, we rerender by calling the `rerender` function for muted
topics (which is done just before we update the items for muting via
the function: `update_items_for_topic_muting`).
Tweaked by tabbott to add comments explaining the reasoning and
long-term plans.
Fixes #15223.
78 lines
4.1 KiB
Handlebars
78 lines
4.1 KiB
Handlebars
{{#if is_stream}}
|
|
<div class="message_header message_header_stream right_part">
|
|
<div class="message-header-wrapper">
|
|
<div class="message-header-contents">
|
|
{{! stream link }}
|
|
<a class="message_label_clickable narrows_by_recipient stream_label {{color_class}}"
|
|
style="background: {{background_color}}; border-left-color: {{background_color}};"
|
|
href="{{stream_url}}"
|
|
title="{{#tr}}Narrow to stream "{display_recipient}"{{/tr}}">
|
|
{{! invite only lock }}
|
|
{{#if invite_only}}
|
|
<i class="fa fa-lock invite-stream-icon" title="{{t 'This is a private stream' }}" aria-label="{{t 'This is a private stream' }}"></i>
|
|
{{/if}}
|
|
{{display_recipient}}</a>
|
|
|
|
{{! hidden narrow icon for copy-pasting }}
|
|
<span class="copy-paste-text">></span>
|
|
|
|
{{! topic stuff }}
|
|
<span class="stream_topic">
|
|
{{! topic link }}
|
|
<a class="message_label_clickable narrows_by_topic"
|
|
href="{{topic_url}}"
|
|
title="{{#tr}}Narrow to stream "{display_recipient}", topic "{topic}"{{/tr}}">
|
|
{{#if use_match_properties}}
|
|
{{{match_topic}}}
|
|
{{else}}
|
|
{{topic}}
|
|
{{/if}}
|
|
</a>
|
|
<!-- The missing whitespace on the next line is a hack; ideally, would be user-select: none. -->
|
|
</span><span class="recipient_bar_controls no-select">
|
|
{{! exterior links (e.g. to a trac ticket) }}
|
|
{{#each topic_links}}
|
|
<a href="{{this.url}}" target="_blank" rel="noopener noreferrer" class="no-underline">
|
|
<i class="fa fa-external-link-square recipient_bar_icon" aria-label="{{t 'External link' }}"></i>
|
|
</a>
|
|
{{/each}}
|
|
|
|
{{! edit topic pencil icon }}
|
|
{{#if always_visible_topic_edit}}
|
|
<i class="fa fa-pencil always_visible_topic_edit recipient_bar_icon" {{#unless realm_allow_message_editing}}style="display: none"{{/unless}} title="{{t 'Edit topic'}}" role="button" tabindex="0" aria-label="{{t 'Edit topic' }}"></i>
|
|
{{else}}
|
|
{{#if on_hover_topic_edit}}
|
|
<i class="fa fa-pencil on_hover_topic_edit recipient_bar_icon" {{#unless realm_allow_message_editing}}style="display: none"{{/unless}} title="{{t 'Edit topic'}}" role="button" tabindex="0" aria-label="{{t 'Edit topic' }}"></i>
|
|
{{/if}}
|
|
{{/if}}
|
|
|
|
<span class="topic_edit">
|
|
<span class="topic_edit_form" id="{{id}}"></span>
|
|
</span>
|
|
|
|
{{#if topic_muted}}
|
|
<i class="fa fa-bell-slash on_hover_topic_unmute recipient_bar_icon" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" title="{{t 'Unmute topic' }} (M)" role="button" tabindex="0" aria-label="{{t 'Unmute topic' }}"></i>
|
|
{{else}}
|
|
<i class="fa fa-bell-slash on_hover_topic_mute recipient_bar_icon" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" title="{{t 'Mute topic' }} (M)" role="button" tabindex="0" aria-label="{{t 'Mute topic' }}"></i>
|
|
{{/if}}
|
|
</span>
|
|
<span class="recipient_row_date {{#if group_date_divider_html}}{{else}}hide-date{{/if}}">{{{date}}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<div class="message_header message_header_private_message dark_background">
|
|
<div class="message-header-wrapper">
|
|
<div class="message-header-contents">
|
|
<a class="message_label_clickable narrows_by_recipient stream_label"
|
|
href="{{pm_with_url}}"
|
|
title="{{#tr}}Narrow to your private messages with {display_reply_to}{{/tr}}">
|
|
{{#tr}}You and {display_reply_to}{{/tr}}
|
|
</a>
|
|
|
|
<span class="recipient_row_date {{#if group_date_divider_html}}{{else}}hide-date{{/if}}">{{{date}}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{/if}}
|