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/featured_topics.js.handlebars
2013-10-31 18:02:24 -04:00

86 lines
3.0 KiB
Handlebars

<table id='topic-list'>
<tr>
<th class="main-link">
{{categoryLink this allowUncategorized=true}}
<div class='posters'>
{{#each featured_users}}
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a>
{{/each}}
</div>
</th>
<th class='num posts'>{{i18n posts}}</th>
<th class='num age'>{{i18n age}}</th>
</tr>
{{#if description_excerpt}}
<tr class="category-description">
<td colspan="3">
{{{description_excerpt}}}
</td>
</tr>
{{/if}}
{{#each topics}}
<tr {{bindAttr class="archived"}}>
<td class='main-link'>
<div class='topic-inset'>
{{topicStatus topic=this}}
{{{topicLink this}}}
{{#if unread}}
<a href="{{unbound lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unbound unread}}</a>
{{/if}}
{{#if new_posts}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts count="new_posts"}}'>{{unbound new_posts}}</a>
{{/if}}
{{#if unseen}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'><i class='icon icon-asterisk'></i></a>
{{/if}}
{{#if hasExcerpt}}
<div class="topic-excerpt">
{{{excerpt}}}
{{#if excerptTruncated}}
{{#unless canClearPin}}<a href="{{lastUnreadUrl}}">{{i18n read_more}}</a>{{/unless}}
{{/if}}
{{#if canClearPin}}
<a href="#" {{action clearPin this}} title="{{unbound i18n topic.clear_pin.help}}">{{i18n topic.clear_pin.title}}</a>
{{/if}}
</div>
{{/if}}
</div>
</td>
<td class='num posts'><span class='badge-posts'>{{number posts_count}}</span></td>
<td class='num age'><span {{bindAttr class=":age ageCold"}} title='{{unboundDate created_at}}'>{{{unboundAge created_at}}}</span></td>
</tr>
{{/each}}
{{#if subcategories}}
<tr>
<td>
<div class='subcategories'>
{{i18n categories.subcategories}}
{{#each subcategory in subcategories}}
{{categoryLink subcategory}}
{{/each}}
</div>
</td>
</tr>
{{/if}}
</table>
<footer class="clearfix">
<figure title="{{i18n year_desc}}">{{number topics_year}} <figcaption>{{i18n category.this_year}}</figcaption></figure>
<figure title="{{i18n month_desc}}">{{number topics_month}} <figcaption>{{i18n month}}</figcaption></figure>
<figure title="{{i18n week_desc}}">{{number topics_week}} <figcaption>{{i18n week}}</figcaption></figure>
{{#if controller.canEdit}}
<a href='#' {{action editCategory this}} class='btn btn-small'>{{i18n category.edit}}</a>
{{/if}}
{{#if moreTopics}}
<a href='/category/{{unbound slug}}' class='btn btn-small'>{{i18n category.more_posts posts="topic_count"}}</a>
{{/if}}
</footer>