This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/post.hbs
2014-10-17 23:21:18 +05:30

101 lines
4.2 KiB
Handlebars

{{post-gap post=this postStream=controller.postStream before="true"}}
<div class='row'>
{{view 'reply-history' content=replyHistory}}
</div>
<article {{bind-attr class=":boxed via_email" id="postElementId" data-post-id="id" data-user-id="user_id"}}>
<div class='row'>
{{#if showUserReplyTab}}
<a href {{action "toggleReplyHistory" this target="view"}} class='reply-to-tab'>
{{#if loadingReplyHistory}}
{{i18n loading}}
{{else}}
<i class="fa fa-mail-forward"></i>
{{avatar reply_to_user imageSize="tiny"}}
<span>{{reply_to_user.username}}</span>
{{/if}}
</a>
{{/if}}
<div class='topic-avatar'>
<div class="contents">
{{#unless userDeleted}}
{{poster-avatar action="expandPostUser" post=this classNames="main-avatar"}}
{{else}}
<i class="fa fa-trash-o deleted-user-avatar"></i>
{{/unless}}
{{plugin-outlet "poster-avatar-bottom"}}
</div>
</div>
<div class='topic-body'>
<div class='topic-meta-data'>
{{poster-name post=this expandAction="expandPostUser"}}
<div class='post-info'>
<a class='post-date' {{bind-attr href="shareUrl" data-share-url="shareUrl" data-post-number="post_number"}}>{{age-with-tooltip created_at}}</a>
</div>
{{#if hasHistory}}
<div class='post-info edits'>
{{#if can_view_edit_history}}
<a href class="{{unbound view.historyHeat}}" {{action "showHistory" this}} title="{{i18n post.last_edited_on}} {{raw-date updated_at}}">
{{editCount}}
<i class='fa fa-pencil'></i>
</a>
{{else}}
<span class="{{unbound view.historyHeat}}" title="{{i18n post.last_edited_on}} {{raw-date updated_at}}">
{{editCount}}
<i class='fa fa-pencil'></i>
</span>
{{/if}}
</div>
{{/if}}
{{#if wiki}}
<div class="post-info wiki" title="{{i18n post.wiki.about}}" {{action "editPost" this}}><i class="fa fa-pencil-square-o"></i></div>
{{/if}}
{{#if via_email}}
{{#if canViewRawEmail}}
<div class="post-info via-email raw-email" title="{{i18n post.via_email}}" {{action "showRawEmail" this}}><i class="fa fa-envelope-o"></i></div>
{{else}}
<div class="post-info via-email" title="{{i18n post.via_email}}"><i class="fa fa-envelope-o"></i></div>
{{/if}}
{{/if}}
<div {{bind-attr class=":read-state read"}} title="{{i18n post.unread}}"><i class='fa fa-circle'></i></div>
</div>
<div {{bind-attr class=":select-posts controller.multiSelect::hidden"}}>
<button {{action "toggledSelectedPostReplies" this}} {{bind-attr class="view.canSelectReplies::hidden"}}>{{i18n topic.multi_select.select_replies}}</button>
<button {{action "toggledSelectedPost" this}} class="select-post">{{view.selectPostText}}</button>
</div>
<!-- keep the classes here in sync with composer.hbs -->
<div {{bind-attr class="showUserReplyTab:avoid-tab view.repliesShown::bottom-round :contents :regular view.extraClass"}}>
<div class='cooked'>
{{{cooked}}}
</div>
{{#if cooked_hidden}}
<a href {{action "expandHidden" this}}>{{i18n post.show_hidden}}</a>
{{/if}}
{{#if view.showExpandButton}}
{{#if controller.loadingExpanded}}
<button class="btn expand-post" disabled>{{i18n loading}}</button>
{{else}}
<button {{action "expandFirstPost" this}} class='btn expand-post'>{{i18n post.show_full}}&hellip;</button>
{{/if}}
{{/if}}
{{view 'post-menu' post=this adminMenu=view.adminMenu}}
</div>
{{view 'replies' content=replies}}
{{discourse-action-history post=this}}
{{view 'topic-map-container' post=this topic=controller.model}}
</div>
{{post-gutter post=this
links=internalLinks
canReplyAsNewTopic=topic.details.can_reply_as_new_topic
newTopicAction="replyAsNewTopic"}}
</div>
</article>
{{post-gap post=this postStream=controller.postStream before="false"}}