FEATURE: Add category to Group Post Listing

This commit is contained in:
cpradio 2014-11-14 19:30:05 -05:00
parent 22fa46b1f2
commit ce78cb1ee4
4 changed files with 11 additions and 3 deletions

View file

@ -7,6 +7,7 @@
<span class="title"> <span class="title">
<a href="{{unbound url}}">{{unbound title}}</a> <a href="{{unbound url}}">{{unbound title}}</a>
</span> </span>
<span class="category">{{category-link category}}</span>
{{#if byName}} {{#if byName}}
<span class="name"> <span class="name">
{{unbound byName}} {{unbound byName}}

View file

@ -452,12 +452,13 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.name { .name {
display: block; display: inline-block;
font-size: 14px; font-size: 14px;
max-width: 400px; max-width: 400px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
vertical-align: middle;
} }
.edit-reason { .edit-reason {
background-color: scale-color($highlight, $lightness: 25%); background-color: scale-color($highlight, $lightness: 25%);

View file

@ -459,12 +459,13 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.name { .name {
display: block; display: inline-block;
font-size: 14px; font-size: 14px;
max-width: 400px; max-width: 400px;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
vertical-align: middle;
} }
.edit-reason { .edit-reason {
background-color: scale-color($highlight, $lightness: 25%); background-color: scale-color($highlight, $lightness: 25%);

View file

@ -5,7 +5,8 @@ class GroupPostSerializer < ApplicationSerializer
:title, :title,
:url, :url,
:user_title, :user_title,
:user_long_name :user_long_name,
:category
has_one :user, serializer: BasicUserSerializer, embed: :objects has_one :user, serializer: BasicUserSerializer, embed: :objects
@ -24,5 +25,9 @@ class GroupPostSerializer < ApplicationSerializer
def include_user_long_name? def include_user_long_name?
SiteSetting.enable_names? SiteSetting.enable_names?
end end
def category
object.topic.category
end
end end