mirror of https://github.com/zulip/zulip.git
229 lines
8.9 KiB
Handlebars
229 lines
8.9 KiB
Handlebars
{{! Client-side Mustache template for rendering messages.}}
|
|
|
|
{{! Because we use table-layout: fixed for the Message table,
|
|
all the column widths are computed from the first row;
|
|
these CSS classes specify the widths for that first,
|
|
collapsed row. (Otherwise, colspan breaks everything).}}
|
|
{{#include_layout_row}}
|
|
<div class="ztable_layout_row">
|
|
</div>
|
|
{{/include_layout_row}}
|
|
|
|
{{#each messages}}
|
|
{{#with this}}
|
|
{{#include_bookend}}
|
|
<div class="bookend_tr">
|
|
<div class="bookend{{#if subscribed}} sub-unsub-message{{/if}}{{#if unsubscribed}} sub-unsub-message{{/if}}">
|
|
{{#if subscribed}}
|
|
<span>--- Subscribed to stream {{subscribed}} ---</span>
|
|
{{/if}}
|
|
{{#if unsubscribed}}
|
|
<span>--- Unsubscribed from stream {{unsubscribed}} ---</span>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
{{/include_bookend}}
|
|
|
|
{{#if show_date}}
|
|
<div class="date_row" data-zid="{{id}}"><div colspan="4">{{{show_date}}}</div></div>
|
|
{{/if}}
|
|
|
|
{{#if is_summary}}
|
|
<div zid="{{first_message_id}}" data-messages="{{message_ids}}" class="summary_row selectable_row{{#include_footer}} last_message{{/include_footer}}{{^is_stream}} summary_row_private_message{{/is_stream}}">
|
|
<div class="message_header message_header_stream right_part" style="box-shadow:inset 9px 0px {{background_color}};">
|
|
|
|
{{! [+] }}
|
|
<i class="messages-expand icon-vector-expand-alt"></i>
|
|
|
|
{{#if is_stream}}
|
|
|
|
{{! invite-only lock icon }}
|
|
{{#if invite_only}}
|
|
<i class="icon-vector-lock" title="This is an invite-only stream"></i>
|
|
{{/if}}
|
|
|
|
{{! stream }}
|
|
<a class="message_label_clickable narrows_by_recipient stream_label"
|
|
href="{{stream_url}}"
|
|
title="Narrow to stream "{{display_recipient}}"">{{display_recipient}}
|
|
</a>
|
|
|
|
{{! > }}
|
|
|
|
<i class="icon-vector-narrow icon-vector-small"></i>
|
|
<span class="copy-paste-text">></span>
|
|
|
|
{{! topic }}
|
|
<span class="stream_topic">
|
|
<a class="message_label_clickable narrows_by_subject"
|
|
href="{{topic_url}}"
|
|
title="Narrow to stream "{{display_recipient}}", topic "{{subject}}"">
|
|
{{subject}}
|
|
</a>
|
|
|
|
{{! exterior links (e.g. to a trac ticket) }}
|
|
{{#each subject_links}}
|
|
<a href="{{this}}" target="_blank">
|
|
<i class="icon-vector-external-link-sign"></i>
|
|
</a>
|
|
{{/each}}
|
|
</span>
|
|
|
|
{{else}}
|
|
|
|
{{! You and Somebody Else, links to PM narrow}}
|
|
<a class="message_label_clickable narrows_by_recipient"
|
|
href="{{pm_with_url}}"
|
|
title="Narrow to your private messages with {{display_reply_to}}">
|
|
You and {{display_reply_to}}
|
|
</a>
|
|
|
|
{{/if}}
|
|
|
|
{{! "(5 read)" or something similar}}
|
|
({{count}} {{summary_adjective}})
|
|
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
|
|
{{#include_recipient}}
|
|
<div zid="{{id}}" class="recipient_row" data-messages="{{message_ids}}">
|
|
{{#if is_stream}}
|
|
<div class="message_header message_header_stream right_part">
|
|
<div class="message-header-contents">
|
|
{{! [-] }}
|
|
{{#if collapsible}}
|
|
<i class="messages-collapse icon-vector-collapse-alt"></i>
|
|
{{/if}}
|
|
|
|
{{! stream link }}
|
|
<a class="message_label_clickable narrows_by_recipient stream_label"
|
|
style="background: {{background_color}}; border-left-color: {{background_color}};"
|
|
href="{{stream_url}}"
|
|
title="Narrow to stream "{{display_recipient}}"">
|
|
{{! invite only lock }}
|
|
{{#if invite_only}}
|
|
<i class="icon-vector-lock" title="This is an invite-only 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_subject"
|
|
href="{{topic_url}}"
|
|
title="Narrow to stream "{{display_recipient}}", topic "{{subject}}"">
|
|
{{#if ../../../../../use_match_properties}}
|
|
{{{match_subject}}}
|
|
{{else}}
|
|
{{subject}}
|
|
{{/if}}
|
|
</a>
|
|
|
|
{{! edit subject pencil icon }}
|
|
{{#if always_visible_topic_edit}}
|
|
<i class="icon-vector-pencil always_visible_topic_edit"></i>
|
|
{{else}}
|
|
{{#if on_hover_topic_edit}}
|
|
<i class="icon-vector-pencil on_hover_topic_edit"></i>
|
|
{{/if}}
|
|
{{/if}}
|
|
|
|
{{! exterior links (e.g. to a trac ticket) }}
|
|
{{#each subject_links}}
|
|
<a href="{{this}}" target="_blank">
|
|
<i class="icon-vector-external-link-sign"></i>
|
|
</a>
|
|
{{/each}}
|
|
</span>
|
|
|
|
<span class="topic_edit">
|
|
<span class="topic_edit_form" id="{{id}}"></span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<div class="message_header message_header_private_message right_part dark_background">
|
|
<div class="message-header-contents">
|
|
{{#if collapsible}}
|
|
<i class="messages-collapse icon-vector-collapse-alt"></i>
|
|
{{/if}}
|
|
<a class="message_label_clickable narrows_by_recipient"
|
|
href="{{pm_with_url}}"
|
|
title="Narrow to your private messages with {{display_reply_to}}">
|
|
You and {{display_reply_to}}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
{{/include_recipient}}
|
|
<div zid="{{id}}" id="{{dom_id}}"
|
|
class="message_row{{^is_stream}} private-message{{/is_stream}}{{#include_sender}} include-sender{{/include_sender}}{{#contains_mention}} mention{{/contains_mention}}{{#include_footer}} last_message{{/include_footer}}{{#unread}} unread{{/unread}} {{#if local_id}}local{{/if}} selectable_row">
|
|
<div class="unread_marker"></div>
|
|
<div class="messagebox{{^include_sender}} prev_is_same_sender{{/include_sender}}{{^is_stream}} private-message{{/is_stream}}">
|
|
<div class="messagebox-border" style="box-shadow:inset 9px 0px {{background_color}};">
|
|
<div class="messagebox-content">
|
|
<span class="pointer_icon"><i class="icon-vector-caret-right"></i></span>
|
|
<div class="message_top_line">
|
|
{{#include_sender}}
|
|
<span class="message_sender{{^status_message}} sender_info_hover{{/status_message}}">
|
|
{{! See ../js/notifications.js for another user of avatar_url. }}
|
|
<div class="inline_profile_picture{{#status_message}} sender_info_hover{{/status_message}}"
|
|
style="background-image: url('{{small_avatar_url}}');"/>
|
|
<span class="{{^status_message}}sender_name{{/status_message}}{{#status_message}}sender-status{{/status_message}}">
|
|
{{#unless status_message}}
|
|
{{sender_full_name}}
|
|
{{else}}
|
|
<span class="sender_name sender_info_hover">{{sender_full_name}}</span>
|
|
{{{ status_message }}}
|
|
{{/unless}}
|
|
</span>
|
|
</span>
|
|
{{/include_sender}}
|
|
<div class="message_controls">
|
|
<div class="star">
|
|
<span class="message_star {{#if starred}}icon-vector-star{{else}}icon-vector-star-empty empty-star{{/if}}"
|
|
title="{{#if starred}}Unstar{{else}}Star{{/if}} this message"></span>
|
|
</div>
|
|
<span class="message_time {{#if local_id}}notvisible{{/if}}">{{timestr}}</span>
|
|
<div class="info actions_hover">
|
|
<i class="icon-vector-chevron-down"></i>
|
|
</div>
|
|
<div class="message_failed {{#unless failed_request}}notvisible{{/unless}}">
|
|
<span class="failed_text">Not delivered </span><i class="icon-vector-refresh refresh-failed-message"></i><i class="icon-vector-pencil edit-failed-message"></i><i class="icon-vector-remove-sign remove-failed-message"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="message_content">{{#unless status_message}}{{#if ../../../../use_match_properties}}{{{match_content}}}{{else}}{{{content}}}{{/if}}{{/unless}}</div>
|
|
<div class="message_edit">
|
|
<div class="message_edit_form" id="{{id}}"></div>
|
|
</div>
|
|
<div class="message_expander message_length_controller" title="See the rest of this message">[More...]</div>
|
|
<div class="message_condenser message_length_controller" title="Make this message take up less space on the screen">[Condense this message]</div>
|
|
{{#if last_edit_timestr}}
|
|
<div class="message_edit_notice">Last edited: {{{last_edit_timestr}}}</div>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{/if}}
|
|
{{/with}}
|
|
{{/each}}
|
|
|
|
{{#if trailing_bookend}}
|
|
<div id="trailing_bookend" class="bookend_tr">
|
|
<div class="bookend">
|
|
<center>{{trailing_bookend}}</center>
|
|
<span class="tiny"><p></p></span>
|
|
</div>
|
|
</div>
|
|
{{/if}}
|