work in progress new category list page

This commit is contained in:
Sam 2013-10-18 11:09:29 +11:00
parent 1ee49798b2
commit e82d975279
4 changed files with 37 additions and 17 deletions

View File

@ -4,7 +4,6 @@
<thead>
<tr>
<th class='category'>{{i18n categories.category}}</th>
<th class='posters'>{{i18n categories.participants}}</th>
<th class='num topics'>{{i18n categories.topics}}</th>
<th class='num posts'>{{i18n categories.posts}}</th>
<th class='latest'>{{i18n categories.latest}}</th>
@ -20,25 +19,35 @@
{{#if newTopics}}
<a href={{unbound url}} class='badge new-posts badge-notification' title='{{i18n topic.new_topics count="newTopics"}}'>{{unbound newTopics}} <i class='icon icon-asterisk'></i></a>
{{/if}}
<div class='featured-users'>
{{#each featured_users}}
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a>
{{/each}}
</div>
{{#if description_excerpt}}
<div class="category-description">
{{{description_excerpt}}}
</div>
{{/if}}
</td>
<td>{{#each featured_users}}
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a>
{{/each}}
</td>
<td>{{number topic_count}}</td>
<td>{{number post_count}}</td>
<td class='num'>{{number topic_count}}</td>
<td class='num'>{{number post_count}}</td>
{{#with latestTopic}}
<td {{bindAttr class="archived"}}>
{{topicStatus topic=this}}
{{{topicLink this}}}
<div class='lastUserInfo'>
{{i18n categories.by}} <a href="{{{unbound lastPosterUrl}}}">{{unbound last_poster.username}}</a>
{{unboundAge last_posted_at}}
<a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a>
{{#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='icon icon-asterisk'></i></a>
{{/if}}
<div class='last-user-info'>
{{i18n categories.latest_by}} <a href="{{{unbound lastPosterUrl}}}">{{unbound last_poster.username}}</a>
<a href="{{unbound lastPostUrl}}">{{unboundAge last_posted_at}}</a>
</div>
</td>
{{/with}}

View File

@ -193,8 +193,21 @@
#topic-list.categories {
.last-user-info {
font-size: 12px;
margin-top: 3px;
}
tbody td {
padding-bottom: 20px;
}
.category{
width: 50%;
position: relative;
width: 55%;
.featured-users {
position: absolute;
right: 5px;
top: 3px;
}
.category-description {
margin-top: 10px;
}

View File

@ -20,9 +20,8 @@ class ListableTopicSerializer < BasicTopicSerializer
:archived
has_one :last_poster, serializer: BasicUserSerializer, embed: :objects
def include_associations!
include! :last_poster if object.include_last_poster
def include_last_poster?
object.include_last_poster
end
def bumped

View File

@ -185,11 +185,10 @@ en:
categories:
category: "Category"
participants: "Participants"
posts: "Posts"
topics: "Topics"
latest: "Latest"
by: "by"
latest_by: "latest by"
user:
said: "{{username}} said:"