zulip/static/templates/actions_popover_content.han...

69 lines
2.2 KiB
Handlebars
Raw Normal View History

{{! Contents of the "message actions" popup }}
<ul class="nav nav-list actions_popover pull-right">
<li>
<a href="#" class="popover_edit_message" data-message-id="{{message.id}}">
{{! Can consider http://fontawesome.io/icon/file-code-o/ when we upgrade to font awesome 4.}}
<i class="{{#if use_edit_icon}}icon-vector-pencil{{else}}icon-vector-file-text-alt{{/if}}"></i> {{editability_menu_item}}
</a>
</li>
<li>
<a href="#" class="respond_button" data-message-id="{{message.id}}">
<i class="icon-vector-share-alt"></i> {{t "Quote and reply" }}
</a>
</li>
<li>
<a href="#" class="popover_toggle_collapse" data-message-id="{{message.id}}">
<i class="{{#if message.collapsed}}icon-vector-plus{{else}}icon-vector-minus{{/if}}"></i>
{{#if message.collapsed}}{{t "Un-collapse" }}{{else}}{{t "Collapse" }}{{/if}}
</a>
</li>
{{#if should_display_edit_history_option}}
<li>
<a href="#" class="view_edit_history" data-msgid="{{message.id}}">
<i class="icon-vector-time"></i>
{{t "View edit history" }}
</a>
</li>
{{/if}}
{{#if can_mute_topic}}
<li>
<a href="#" class="popover_mute_topic" data-msg-stream="{{message.stream}}" data-msg-topic="{{message.subject}}">
<i class="icon-vector-eye-close"></i>
{{#tr message}}Mute the topic <b>__subject__</b>{{/tr}}
</a>
</li>
{{/if}}
{{#if can_unmute_topic}}
<li>
<a href="#" class="popover_unmute_topic" data-msg-stream="{{message.stream}}" data-msg-topic="{{message.subject}}">
<i class="icon-vector-eye-open"></i>
{{#tr message}}Unmute the topic <b>__subject__</b>{{/tr}}
</a>
</li>
{{/if}}
Add frontend support for emoji reactions. This commit replaces the placeholder "clipboard" button with a reaction button. This is done on any message that can't be edited. Also, on messages sent by the user the actions popover (toggled by the down chevron icon) contains an option to add a reaction. When clicked, a popover with a search bar and a list of emojis is displayed. If the right sidebar is collapsed (the viewport is small), the popover is placed to the left of the button. Focus is set to the search bar. Typing in the search bar filters emojis. Emojis with which the user has reacted to this message are highlighted. Clicking them sends an API request to remove that reaction. Clicking on non-highlighted emojis sends an API request to add a reaction. When the popover loses focus it is closed. The frontend listens for reaction events. When an add-reaction event is received, the emoji is displayed at the bottom of the message with a count initialized to 1. If there was an existing reaction to the message with the same emoji, the count is incremented. Old messages fetched from the server contain reactions. They are displayed (along with title and count) at the bottom of each message. When clicking the emoji reaction at the bottom of the message, if the user has already reacted with that emoji to this message, the reaction is removed and the count is decremented. Otherwise, a reaction is added and the count is incremented. Hovering over the emoji reaction at the bottom of the message displays a list of users who have reacted with this emoji along with the emoji name. Hovering over the emoji reactions at the bottom of the message displays a button to add a reaction. Fixes #541.
2016-12-02 13:23:23 +01:00
{{#if should_display_add_reaction_option}}
<li>
<a href="#" class="reaction_button" data-message-id="{{message.id}}">
<i class="icon-vector-smile"></i>
{{#tr message}}Add emoji reaction{{/tr}}
</a>
</li>
Add frontend support for emoji reactions. This commit replaces the placeholder "clipboard" button with a reaction button. This is done on any message that can't be edited. Also, on messages sent by the user the actions popover (toggled by the down chevron icon) contains an option to add a reaction. When clicked, a popover with a search bar and a list of emojis is displayed. If the right sidebar is collapsed (the viewport is small), the popover is placed to the left of the button. Focus is set to the search bar. Typing in the search bar filters emojis. Emojis with which the user has reacted to this message are highlighted. Clicking them sends an API request to remove that reaction. Clicking on non-highlighted emojis sends an API request to add a reaction. When the popover loses focus it is closed. The frontend listens for reaction events. When an add-reaction event is received, the emoji is displayed at the bottom of the message with a count initialized to 1. If there was an existing reaction to the message with the same emoji, the count is incremented. Old messages fetched from the server contain reactions. They are displayed (along with title and count) at the bottom of each message. When clicking the emoji reaction at the bottom of the message, if the user has already reacted with that emoji to this message, the reaction is removed and the count is decremented. Otherwise, a reaction is added and the count is incremented. Hovering over the emoji reaction at the bottom of the message displays a list of users who have reacted with this emoji along with the emoji name. Hovering over the emoji reactions at the bottom of the message displays a button to add a reaction. Fixes #541.
2016-12-02 13:23:23 +01:00
{{/if}}
<li>
<a href="{{ conversation_time_uri }}" class="popover_narrow_by_conversation_and_time" data-message-id="{{message.id}}">
<i class="icon-vector-link"></i> {{t "Link to this conversation" }}
</a>
</li>
{{#if message.historical}}
<li class="small">({{t "Message sent when you were not subscribed" }})</li>
{{/if}}
</ul>