This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
discourse/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars
Régis Hanol 3b6b2770f3 BUGFIX: date of the post in the share dialog is now properly bound
CLEANUP: removed all unused handlebars helpers
REFACTOR: removed 'unbound' prefix (for performance reasons, helpers are unbound by default)
REFACTOR: added 'bound' prefix to bound helpers
REFACTOR: renamed helper using 'foo-bar-foo' syntax (instead of camel case)
2014-06-10 19:04:31 +02:00

93 lines
3.8 KiB
Handlebars

{{#if loaded}}
{{#if topics}}
<table id="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>
{{else}}
<th class="num likes">{{i18n likes}}</th>
{{/if}}
<th class="num views">{{i18n views}}</th>
<th class="num activity" colspan="2">{{i18n activity}}</th>
</tr>
</thead>
<tbody>
{{#groupedEach 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>
{{#if unread}}
<a href="{{unbound topic.lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unbound topic.unread}}</a>
{{/if}}
{{#if topic.new_posts}}
<a href="{{unbound topic.lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts count="new_posts"}}'>{{unbound topic.new_posts}}</a>
{{/if}}
{{#if topic.unseen}}
<a href="{{unbound topic.lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'>{{i18n filters.new.lower_title}}</a>
{{/if}}
</td>
{{#unless controller.hideCategory}}
<td class="category">
{{category-link topic.category showParent=true}}
</td>
{{/unless}}
<td class='num posts'>
<a href="{{unbound topic.lastUnreadUrl}}" class='badge-posts'>{{number topic.posts_count numberKey="posts_long"}}</a>
</td>
{{#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>
{{else}}
<td class='num likes'>
{{#if topic.like_count}}
<a href='{{unbound topic.url}}{{#if topic.has_summary}}?filter=summary{{/if}}'>{{unbound topic.like_count}} <i class='fa fa-heart'></i></a>
{{/if}}
</td>
{{/if}}
<td {{bind-attr class=":num :views topic.viewsHeat"}}>
{{number topic.views numberKey="views_long"}}
</td>
{{#if topic.bumped}}
<td class='num activity'>
<a href="{{unbound topic.url}}" class='{{cold-age-class created_at}}' title='{{i18n first_post}}: {{{raw-date topic.created_at}}}' >{{age topic.created_at}}</a>
</td>
<td class='num activity last'>
<a href="{{unbound topic.lastPostUrl}}" class='{{cold-age-class bumped_at}}' title='{{i18n last_post}}: {{{raw-date topic.bumped_at}}}'>{{age topic.bumped_at}}</a>
</td>
{{else}}
<td class='num activity'>
<a href="{{unbound topic.url}}" class='age' title='{{i18n first_post}}: {{{raw-date topic.created_at}}}'>{{age topic.created_at}}</a>
</td>
<td class="activity"></td>
{{/if}}
</tr>
{{/groupedEach}}
</tbody>
</table>
{{else}}
<div class='alert alert-info'>
{{i18n choose_topic.none_found}}
</div>
{{/if}}
{{else}}
<div class='spinner'>
{{i18n loading}}
</div>
{{/if}}