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/components/basic-topic-list.hbs
2014-10-02 14:50:13 -07:00

65 lines
2.1 KiB
Handlebars

{{#if loaded}}
{{#if topics}}
<table class="topic-list">
<thead>
<tr>
<th class="default">{{i18n topic.title}}</th>
{{#unless controller.hideCategory}}
<th class="category">{{i18n category_title}}</th>
{{/unless}}
<th class="num posts">{{i18n posts}}</th>
{{#if controller.showParticipants}}
<th class="posters">{{i18n users}}</th>
{{/if}}
<th class="num views">{{i18n views}}</th>
<th class="num activity">{{i18n activity}}</th>
</tr>
</thead>
<tbody>
{{#grouped-each topic in topics}}
<tr {{bind-attr class="archived"}}>
<td class='main-link'>
{{topic-status topic=topic}}
<a class='title' href="{{unbound topic.lastUnreadUrl}}">{{{unbound topic.fancy_title}}}</a>
{{topic-post-badges unread=topic.unread
newPosts=topic.new_posts
unseen=topic.unseen
url=topic.lastUnreadUrl}}
</td>
{{#unless controller.hideCategory}}
<td class="category">
{{category-link topic.category showParent=true}}
</td>
{{/unless}}
{{posts-count-column topic=topic class="num" action="clickedPosts"}}
{{#if controller.showParticipants}}
<td class='participants'>
{{#each topic.participants}}
<a href="{{user.path}}" class="{{extras}}">{{avatar this usernamePath="user.username" imageSize="small"}}</a>
{{/each}}
</td>
{{/if}}
<td {{bind-attr class=":num :views topic.viewsHeat"}}>
{{number topic.views numberKey="views_long"}}
</td>
{{activity-column topic=topic class="num"}}
</tr>
{{/grouped-each}}
</tbody>
</table>
{{else}}
<div class='alert alert-info'>
{{i18n choose_topic.none_found}}
</div>
{{/if}}
{{else}}
<div class='spinner'></div>
{{/if}}