ES6: Remove an unncessary view

This commit is contained in:
Robin Ward 2014-06-13 11:24:28 -04:00
parent e5a189fc17
commit e449d64ae1
3 changed files with 89 additions and 100 deletions

View file

@ -1,85 +0,0 @@
<table id='topic-list'>
<tr>
<th class="main-link">
{{category-link 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 {{bind-attr class="archived"}}>
<td class='main-link'>
<div class='topic-inset'>
{{topic-status topic=this}}
{{{topic-link 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='fa fa-asterisk'></i></a>
{{/if}}
{{#if hasExcerpt}}
<div class="topic-excerpt">
{{{excerpt}}}
{{#if excerptTruncated}}
{{#unless canClearPin}}<a href="{{url}}">{{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 class="{{cold-age-class created_at}}" title='{{raw-date created_at}}'>{{{age created_at}}}</span></td>
</tr>
{{/each}}
{{#if subcategories}}
<tr>
<td>
<div class='subcategories'>
{{i18n categories.subcategories}}
{{#each subcategory in subcategories}}
{{category-link subcategory showParent=true}}
{{/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>

View file

@ -1 +1,89 @@
{{each categories itemViewClass="Discourse.FeaturedTopicsView"}}
{{#each categories}}
<div class='category-list-item'>
<table id='topic-list'>
<tr>
<th class="main-link">
{{category-link 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 {{bind-attr class="archived"}}>
<td class='main-link'>
<div class='topic-inset'>
{{topic-status topic=this}}
{{{topic-link 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='fa fa-asterisk'></i></a>
{{/if}}
{{#if hasExcerpt}}
<div class="topic-excerpt">
{{{excerpt}}}
{{#if excerptTruncated}}
{{#unless canClearPin}}<a href="{{url}}">{{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 class="{{cold-age-class created_at}}" title='{{raw-date created_at}}'>{{{age created_at}}}</span></td>
</tr>
{{/each}}
{{#if subcategories}}
<tr>
<td>
<div class='subcategories'>
{{i18n categories.subcategories}}
{{#each subcategory in subcategories}}
{{category-link subcategory showParent=true}}
{{/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>
</div>
{{/each}}

View file

@ -1,14 +0,0 @@
/**
This view handles rendering of featured topics at the bottom of a topic
@class FeaturedTopicsView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.FeaturedTopicsView = Discourse.View.extend({
templateName: 'featured_topics',
classNames: ['category-list-item']
});