mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 10:08:20 -05:00
FIX: Regression on topic list for best of links.
This commit is contained in:
parent
c86b06e3fa
commit
ec7298d548
2 changed files with 26 additions and 20 deletions
|
@ -75,11 +75,17 @@ DiscourseGroupedEach.prototype = {
|
||||||
var content = this.content,
|
var content = this.content,
|
||||||
contentLength = Em.get(content, 'length'),
|
contentLength = Em.get(content, 'length'),
|
||||||
data = this.options.data,
|
data = this.options.data,
|
||||||
template = this.template;
|
template = this.template,
|
||||||
|
keyword = this.options.hash.keyword;
|
||||||
|
|
||||||
data.insideEach = true;
|
data.insideEach = true;
|
||||||
for (var i = 0; i < contentLength; i++) {
|
for (var i = 0; i < contentLength; i++) {
|
||||||
template(content.objectAt(i), { data: data });
|
var row = content.objectAt(i);
|
||||||
|
if (keyword) {
|
||||||
|
data.keywords = data.keywords || {};
|
||||||
|
data.keywords[keyword] = row;
|
||||||
|
}
|
||||||
|
template(row, { data: data });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -13,50 +13,50 @@
|
||||||
<th class='num activity' colspan='2'>{{i18n activity}}</th>
|
<th class='num activity' colspan='2'>{{i18n activity}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{{#each view.topics}}
|
{{#groupedEach topic in view.topics}}
|
||||||
<tr {{bindAttr class="archived"}}>
|
<tr {{bindAttr class="archived"}}>
|
||||||
<td class='main-link'>
|
<td class='main-link'>
|
||||||
{{topicStatus topic=this}}
|
{{topicStatus topic=topic}}
|
||||||
<a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a>
|
<a class='title' href="{{unbound topic.lastUnreadUrl}}">{{{unbound topic.fancy_title}}}</a>
|
||||||
{{#if unread}}
|
{{#if unread}}
|
||||||
<a href="{{unbound lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unbound unread}}</a>
|
<a href="{{unbound topic.lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unbound topic.unread}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if new_posts}}
|
{{#if topic.new_posts}}
|
||||||
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts count="new_posts"}}'>{{unbound new_posts}}</a>
|
<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}}
|
||||||
{{#if unseen}}
|
{{#if topic.unseen}}
|
||||||
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'><i class='icon icon-asterisk'></i></a>
|
<a href="{{unbound topic.lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'><i class='icon icon-asterisk'></i></a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
{{#unless controller.hideCategories}}
|
{{#unless controller.hideCategories}}
|
||||||
<td class='category'>
|
<td class='category'>
|
||||||
{{categoryLink category}}
|
{{categoryLink topic.category}}
|
||||||
</td>
|
</td>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
<td class='num posts'><a href="{{unbound lastUnreadUrl}}" class='badge-posts'>{{number posts_count numberKey="posts_long"}}</a></td>
|
<td class='num posts'><a href="{{unbound topic.lastUnreadUrl}}" class='badge-posts'>{{number topic.posts_count numberKey="posts_long"}}</a></td>
|
||||||
|
|
||||||
<td class='num likes'>
|
<td class='num likes'>
|
||||||
{{#if like_count}}
|
{{#if topic.like_count}}
|
||||||
<a href='{{unbound url}}{{#if has_best_of}}?filter=best_of{{/if}}'>{{unbound like_count}} <i class='icon-heart'></i></a>
|
<a href='{{unbound topic.url}}{{#if topic.has_best_of}}?filter=best_of{{/if}}'>{{unbound topic.like_count}} <i class='icon-heart'></i></a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td {{bindAttr class=":num :views viewsHeat"}}>{{number views numberKey="views_long"}}</td>
|
<td {{bindAttr class=":num :views topic.viewsHeat"}}>{{number topic.views numberKey="views_long"}}</td>
|
||||||
{{#if bumped}}
|
{{#if topic.bumped}}
|
||||||
<td class='num activity'>
|
<td class='num activity'>
|
||||||
<a href="{{unbound url}}" {{{bindAttr class=":age ageCold"}}} title='{{i18n first_post}}: {{{unboundDate created_at}}}' >{{unboundAge created_at}}</a>
|
<a href="{{topic.unbound url}}" {{{bindAttr class=":age topic.ageCold"}}} title='{{i18n first_post}}: {{{unboundDate topic.created_at}}}' >{{unboundAge topic.created_at}}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class='num activity last'>
|
<td class='num activity last'>
|
||||||
<a href="{{unbound lastPostUrl}}" class='age' title='{{i18n last_post}}: {{{unboundDate bumped_at}}}'>{{unboundAge bumped_at}}</a>
|
<a href="{{unbound topic.lastPostUrl}}" class='age' title='{{i18n last_post}}: {{{unboundDate topic.bumped_at}}}'>{{unboundAge topic.bumped_at}}</a>
|
||||||
</td>
|
</td>
|
||||||
{{else}}
|
{{else}}
|
||||||
<td class='num activity'>
|
<td class='num activity'>
|
||||||
<a href="{{unbound url}}" class='age' title='{{i18n first_post}}: {{{unboundDate created_at}}}'>{{unboundAge created_at}}</a>
|
<a href="{{unbound topic.url}}" class='age' title='{{i18n first_post}}: {{{unboundDate topic.created_at}}}'>{{unboundAge topic.created_at}}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="activity"></td>
|
<td class="activity"></td>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/groupedEach}}
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
Loading…
Reference in a new issue