mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
Show categories on the user streams for topics.
This commit is contained in:
parent
b1d2aba0f3
commit
fc3ce934f5
@ -30,6 +30,13 @@ _.each(UserActionTypes, function (k, v) {
|
||||
|
||||
Discourse.UserAction = Discourse.Model.extend({
|
||||
|
||||
_attachCategory: function() {
|
||||
var categoryId = this.get('category_id');
|
||||
if (categoryId) {
|
||||
this.set('category', Discourse.Category.findById(categoryId));
|
||||
}
|
||||
}.on('init'),
|
||||
|
||||
/**
|
||||
Return an i18n key we will use for the description text of a user action.
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
<span class='time'>{{unboundDate path="created_at" leaveAgo="true"}}</span>
|
||||
<span class="title">
|
||||
<a href="{{unbound postUrl}}">{{unbound title}}</a>
|
||||
{{categoryLink category}}
|
||||
</span>
|
||||
<span class="type">{{unbound descriptionHtml}}</span>
|
||||
</div>
|
||||
|
@ -116,7 +116,8 @@ SELECT
|
||||
CASE WHEN coalesce(p.deleted_at, p2.deleted_at, t.deleted_at) IS NULL THEN false ELSE true END deleted,
|
||||
p.hidden,
|
||||
p.post_type,
|
||||
p.edit_reason
|
||||
p.edit_reason,
|
||||
t.category_id
|
||||
FROM user_actions as a
|
||||
JOIN topics t on t.id = a.target_topic_id
|
||||
LEFT JOIN posts p on p.id = a.target_post_id
|
||||
|
@ -22,7 +22,8 @@ class UserActionSerializer < ApplicationSerializer
|
||||
:deleted,
|
||||
:hidden,
|
||||
:moderator_action,
|
||||
:edit_reason
|
||||
:edit_reason,
|
||||
:category_id
|
||||
|
||||
def excerpt
|
||||
PrettyText.excerpt(object.cooked, 300) if object.cooked
|
||||
|
Loading…
Reference in New Issue
Block a user