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.

popovers: Hide most irrelevant options for spectators.

Aman Agrawalab63bb638acd
diff --git a/static/js/popovers.js b/static/js/popovers.js
index 39fe2b2db6d..1a4c6f9978f 100644
--- a/static/js/popovers.js
+++ b/static/js/popovers.js
@@ -479,10 +479,9 @@ export function toggle_actions_popover(element, id) {
!message.locally_echoed && !message.is_me_message && message.collapsed;
const should_display_edit_and_view_source =
- (message.content !== "<p>(deleted)</p>" ||
- editability === message_edit.editability_types.FULL ||
- editability === message_edit.editability_types.TOPIC_ONLY) &&
- not_spectator;
+ message.content !== "<p>(deleted)</p>" ||
+ editability === message_edit.editability_types.FULL ||
+ editability === message_edit.editability_types.TOPIC_ONLY;
const should_display_quote_and_reply =
message.content !== "<p>(deleted)</p>" && not_spectator;
diff --git a/static/templates/gear_menu.hbs b/static/templates/gear_menu.hbs
index 81676df097e..b56bb671826 100644
--- a/static/templates/gear_menu.hbs
+++ b/static/templates/gear_menu.hbs
@@ -8,31 +8,31 @@
view is a Bootstrap nav tab, even though we don't show the tab
anymore --}}
<li class="invisible" style="display:none;" role="presentation"><a href="#message_feed_container" data-toggle="tab"></a></li>
- <li role="presentation">
+ <li class="hidden-for-spectators" role="presentation">
<a href="#streams/subscribed" role="menuitem">
<i class="fa fa-exchange" aria-hidden="true"></i> {{t 'Manage streams' }}
</a>
</li>
- <li role="presentation">
+ <li class="hidden-for-spectators" role="presentation">
<a href="#settings" role="menuitem">
<i class="fa fa-wrench" aria-hidden="true"></i> {{t 'Personal settings' }}
</a>
</li>
- <li class="admin-menu-item" role="presentation">
+ <li class="admin-menu-item hidden-for-spectators" role="presentation">
<a href="#organization" role="menuitem">
<i class="fa fa-bolt" aria-hidden="true"></i>
<span>{{t 'Manage organization' }}</span>
</a>
</li>
{{#unless is_guest}}
- <li role="presentation">
+ <li class="hidden-for-spectators" role="presentation">
<a href="/stats" target="_blank" rel="noopener noreferrer" role="menuitem">
<i class="fa fa-bar-chart" aria-hidden="true"></i>
<span>{{t 'Usage statistics' }}</span>
</a>
</li>
{{/unless}}
- <li class="divider" role="presentation"></li>
+ <li class="divider hidden-for-spectators" role="presentation"></li>
<li role="presentation">
<a href="/help" target="_blank" rel="noopener noreferrer" role="menuitem">
<i class="fa fa-question-circle" aria-hidden="true"></i> {{t 'Help center' }}
diff --git a/static/templates/stream_sidebar_actions.hbs b/static/templates/stream_sidebar_actions.hbs
index 229c3c5727a..50dd77b8b9e 100644
--- a/static/templates/stream_sidebar_actions.hbs
+++ b/static/templates/stream_sidebar_actions.hbs
@@ -20,7 +20,7 @@
{{t "Stream settings" }}
</a>
</li>
- <li>
+ <li class="hidden-for-spectators">
<a tabindex="0" class="pin_to_top">
<i class="fa fa-thumb-tack stream-pin-icon" aria-hidden="true"></i>
{{#if stream.pin_to_top}}
@@ -30,13 +30,13 @@
{{/if}}
</a>
</li>
- <li>
+ <li class="hidden-for-spectators">
<a tabindex="0" class="mark_stream_as_read">
<i class="fa fa-book" aria-hidden="true"></i>
{{t "Mark all messages as read"}}
</a>
</li>
- <li>
+ <li class="hidden-for-spectators">
<a tabindex="0" class="toggle_stream_muted">
{{#if stream.is_muted}}
<i class="fa fa-bell" aria-hidden="true"></i>
@@ -53,13 +53,13 @@
{{t "New topic" }}
</a>
</li>
- <li>
+ <li class="hidden-for-spectators">
<a tabindex="0" class="popover_sub_unsub_button" data-name="{{stream.name}}">
<i class='fa fa-envelope' aria-hidden="true"></i>
{{t "Unsubscribe" }}
</a>
</li>
- <li>
+ <li class="hidden-for-spectators">
<span class="colorpicker-container"><input stream_id="{{stream.stream_id}}" class="colorpicker" type="text" value="{{stream.color}}" /></span>
<a tabindex="0" class="choose_stream_color">
<i class="fa fa-eyedropper" aria-hidden="true"></i>
diff --git a/static/templates/topic_sidebar_actions.hbs b/static/templates/topic_sidebar_actions.hbs
index 32c3117822d..8968d43ab22 100644
--- a/static/templates/topic_sidebar_actions.hbs
+++ b/static/templates/topic_sidebar_actions.hbs
@@ -9,14 +9,14 @@
<hr />
{{#unless topic_muted}}
- <li>
+ <li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-mute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="fa fa-bell-slash" aria-hidden="true"></i>
{{t "Mute topic"}}
</a>
</li>
{{else}}
- <li>
+ <li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-unmute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="fa fa-bell" aria-hidden="true"></i>
{{t "Unmute topic"}}
@@ -25,7 +25,7 @@
{{/unless}}
{{#if has_starred_messages}}
- <li>
+ <li class="hidden-for-spectators">
<a href="#" class="sidebar-popover-unstar-all-in-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="fa fa-star-o" aria-hidden="true"></i>
{{#tr}}Unstar all messages in topic{{/tr}}
@@ -33,7 +33,7 @@
</li>
{{/if}}
- <li>
+ <li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-mark-topic-read" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="fa fa-book" aria-hidden="true"></i>
{{t "Mark all messages as read"}}