Merge pull request #3453 from techAPJ/patch-1

UX: show lock icon in user stream if topic is closed/archived
This commit is contained in:
Robin Ward 2015-05-12 10:53:49 -04:00
commit 7a6aab24f1
3 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,7 @@
<div class='clearfix info'>
<a href="{{unbound item.userUrl}}" data-user-card="{{unbound item.username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar item imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a>
<span class='time'>{{format-date item.created_at}}</span>
{{topic-status topic=item disableActions=true}}
<span class="title">
<a href="{{unbound item.postUrl}}">{{unbound item.title}}</a>
</span>

View File

@ -142,6 +142,7 @@ SQL
SELECT
a.id,
t.title, a.action_type, a.created_at, t.id topic_id,
t.closed AS topic_closed, t.archived AS topic_archived,
a.user_id AS target_user_id, au.name AS target_name, au.username AS target_username,
coalesce(p.post_number, 1) post_number, p.id as post_id,
p.reply_to_post_number,

View File

@ -26,6 +26,8 @@ class UserActionSerializer < ApplicationSerializer
:edit_reason,
:category_id,
:uploaded_avatar_id,
:closed,
:archived,
:acting_uploaded_avatar_id
def excerpt
@ -77,4 +79,12 @@ class UserActionSerializer < ApplicationSerializer
object.action_type == UserAction::EDIT
end
def closed
object.topic_closed
end
def archived
object.topic_archived
end
end