Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_edit: Hide recipient bar resolve topic if user lacks permission.
AnshVMf30e439ee37a
diff --git a/static/js/message_list_view.js b/static/js/message_list_view.jsindex e8ec987bbda..baa776456bf 100644--- a/static/js/message_list_view.js+++ b/static/js/message_list_view.js@@ -128,6 +128,8 @@ function set_topic_edit_properties(group, message) {group.realm_allow_message_editing = page_params.realm_allow_message_editing;group.always_visible_topic_edit = false;group.on_hover_topic_edit = false;+ // if a user who can edit a topic, can resolve it as well+ group.user_can_resolve_topic = message_edit.is_topic_editable(message);// Messages with no topics should always have an edit icon visible// to encourage updating them. Admins can also edit any topic.diff --git a/static/templates/recipient_row.hbs b/static/templates/recipient_row.hbsindex 026454601ca..8e49e3dc1db 100644--- a/static/templates/recipient_row.hbs+++ b/static/templates/recipient_row.hbs@@ -50,10 +50,12 @@{{/if}}{{/if}}- {{#if topic_is_resolved}}- <i class="fa fa-check on_hover_topic_unresolve recipient_bar_icon hidden-for-spectators" data-topic-name="{{topic}}" data-tippy-content="{{t 'Mark as unresolved' }}" role="button" tabindex="0" aria-label="{{t 'Mark as unresolved' }}"></i>- {{else}}- <i class="fa fa-check on_hover_topic_resolve recipient_bar_icon hidden-for-spectators" data-topic-name="{{topic}}" data-tippy-content="{{t 'Mark as resolved' }}" role="button" tabindex="0" aria-label="{{t 'Mark as resolved' }}"></i>+ {{#if user_can_resolve_topic}}+ {{#if topic_is_resolved}}+ <i class="fa fa-check on_hover_topic_unresolve recipient_bar_icon hidden-for-spectators" data-topic-name="{{topic}}" data-tippy-content="{{t 'Mark as unresolved' }}" role="button" tabindex="0" aria-label="{{t 'Mark as unresolved' }}"></i>+ {{else}}+ <i class="fa fa-check on_hover_topic_resolve recipient_bar_icon hidden-for-spectators" data-topic-name="{{topic}}" data-tippy-content="{{t 'Mark as resolved' }}" role="button" tabindex="0" aria-label="{{t 'Mark as resolved' }}"></i>+ {{/if}}{{/if}}{{#if topic_muted}}