mirror of https://github.com/zulip/zulip.git
101 lines
4.7 KiB
Handlebars
101 lines
4.7 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}}
|
|
<tr class="ztable_layout_row">
|
|
<td class="ztable_col1" />
|
|
<td class="ztable_col2" />
|
|
</tr>
|
|
{{/include_layout_row}}
|
|
|
|
{{#each messages}}
|
|
{{#with this}}
|
|
{{#include_bookend}}
|
|
<tr class="bookend_tr"><td colspan="2" 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}}
|
|
</td>
|
|
</tr>
|
|
{{/include_bookend}}
|
|
|
|
{{#if show_date}}
|
|
<tr class="date_row"><td colspan="4">{{{show_date}}}</td></tr>
|
|
{{/if}}
|
|
|
|
{{#include_recipient}}
|
|
{{#if is_stream}}
|
|
<tr zid="{{id}}" class="recipient_row">
|
|
<td class="message_header_colorblock" style="background-color: {{background_color}};"></td>
|
|
<td class="message_header message_header_stream right_part">
|
|
{{#if invite_only}}<i class="icon-lock" title="This is an invite-only stream"></i>{{/if}}
|
|
<span class="message_label_clickable narrows_by_recipient stream_label"
|
|
title="Narrow to stream "{{display_recipient}}"">{{display_recipient}}</span>
|
|
<i class="icon-vector-narrow icon-vector-small"></i>
|
|
<span class="message_label_clickable narrows_by_subject"
|
|
title="Narrow to stream "{{display_recipient}}", subject "{{subject}}"">{{#if ../../../../use_match_properties}}{{{match_subject}}}{{else}}{{subject}}{{/if}}</span>
|
|
{{#if your_empty_subject}}<i class="icon-vector-pencil edit_subject"></i>{{/if}}
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr zid="{{id}}" class="recipient_row">
|
|
<td class="message_header_colorblock message_header_private_message" style="background-color: {{background_color}};"></td>
|
|
<td class="message_header message_header_private_message right_part dark_background">
|
|
<span class="message_label_clickable narrows_by_recipient"
|
|
title="Narrow to your private messages with {{display_reply_to}}">
|
|
You and {{display_reply_to}}</span>
|
|
</td>
|
|
</tr>
|
|
{{/if}}
|
|
{{/include_recipient}}
|
|
<tr 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}}">
|
|
<td class="messagebox_colorblock{{^is_stream}} message_header_private_message{{/is_stream}}" style="background-color: {{background_color}};"><span class="pointer_icon"><i class="icon-vector-caret-right"></i></span></td>
|
|
<td class="messagebox{{^include_sender}} prev_is_same_sender{{/include_sender}}{{^is_stream}} private-message{{/is_stream}}">
|
|
<div class="message_top_line dropdown">
|
|
{{#include_sender}}
|
|
<span class="message_sender sender_actions_hover">
|
|
{{! See ../js/notifications.js for another user of avatar_url. }}
|
|
<div class="inline_profile_picture"
|
|
style="background-image: url('{{small_avatar_url}}');"/>
|
|
<span class="sender_name">{{sender_full_name}}</span>
|
|
</span>
|
|
{{/include_sender}}
|
|
<span class="message_time actions_hover">{{timestr}}</span>
|
|
<div class="message_controls">
|
|
<div class="star">
|
|
<span class="message_star {{#if starred}}icon-vector-star{{else}}icon-vector-star empty-star{{/if}}"
|
|
title="{{#if starred}}Unstar{{else}}Star{{/if}} this message"></i>
|
|
</div>
|
|
<div class="info message_actions_hover">
|
|
<i class="icon-vector-angle-down"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="message_content">{{#if ../../use_match_properties}}{{{match_content}}}{{else}}{{{content}}}{{/if}}</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}}
|
|
</td>
|
|
</tr>
|
|
{{/with}}
|
|
{{/each}}
|
|
|
|
{{#if trailing_bookend}}
|
|
<tr id="trailing_bookend" class="bookend_tr"><td colspan="2" class="bookend">
|
|
<center>{{trailing_bookend}}</center>
|
|
<span class="tiny"><p></p></span></td>
|
|
</tr>
|
|
{{/if}}
|