Minor JS cleanup
This commit is contained in:
parent
7ef5037bbe
commit
75703cfc6a
|
@ -7,24 +7,24 @@
|
|||
{{#each featured_users}}
|
||||
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<th class='num'>{{i18n posts}}</th>
|
||||
<th class='num'>{{i18n age}}</th>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
{{#each topics}}
|
||||
<tr {{bindAttr class="archived"}}>
|
||||
<td class='main-link'>
|
||||
<div class='topic-inset'>
|
||||
{{view Discourse.TopicStatusView topicBinding="this"}}
|
||||
{{{topicLink this}}
|
||||
{{view Discourse.TopicStatusView topicBinding="this"}}
|
||||
{{{topicLink this}}
|
||||
{{#if unread}}
|
||||
<a href="{{unbound lastReadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts unread="unread"}}'>{{unbound unread}}</a>
|
||||
{{/if}}
|
||||
{{#if new_posts}}
|
||||
<a href="{{unbound lastReadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts new_posts="new_posts"}}'>{{unbound new_posts}}</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</td>
|
||||
<td class='num'><span class='badge-posts'>{{number posts_count}}</span></td>
|
||||
|
|
|
@ -9,25 +9,25 @@
|
|||
Discourse.TopicStatusView = Discourse.View.extend({
|
||||
classNames: ['topic-statuses'],
|
||||
|
||||
hasDisplayableStatus: (function() {
|
||||
hasDisplayableStatus: function() {
|
||||
if (this.get('topic.closed')) return true;
|
||||
if (this.get('topic.pinned')) return true;
|
||||
if (!this.get('topic.archetype.isDefault')) return true;
|
||||
if (!this.get('topic.visible')) return true;
|
||||
return false;
|
||||
}).property('topic.closed', 'topic.pinned', 'topic.visible'),
|
||||
}.property('topic.closed', 'topic.pinned', 'topic.visible'),
|
||||
|
||||
statusChanged: (function() {
|
||||
statusChanged: function() {
|
||||
this.rerender();
|
||||
}).observes('topic.closed', 'topic.pinned', 'topic.visible'),
|
||||
}.observes('topic.closed', 'topic.pinned', 'topic.visible'),
|
||||
|
||||
renderIcon: function(buffer, name, key) {
|
||||
var title;
|
||||
title = Em.String.i18n("topic_statuses." + key + ".help");
|
||||
var title = Em.String.i18n("topic_statuses." + key + ".help");
|
||||
return buffer.push("<span title='" + title + "' class='topic-status'><i class='icon icon-" + name + "'></i></span>");
|
||||
},
|
||||
|
||||
render: function(buffer) {
|
||||
|
||||
if (!this.get('hasDisplayableStatus')) return;
|
||||
|
||||
// Allow a plugin to add a custom icon to a topic
|
||||
|
|
Loading…
Reference in New Issue