FIX: in activity stream, move category badge to be under topic title. Long titles could cause it to be cut off. Category badge replaces the text that was there.

This commit is contained in:
Neil Lalonde 2014-09-11 17:25:50 -04:00
parent 52094fe554
commit 9b5f506339
4 changed files with 4 additions and 48 deletions

View File

@ -27,22 +27,6 @@ Discourse.AdminPost = Discourse.Post.extend({
} else {
return this.get("sameUser") ? "you_replied_to_topic" : "user_replied_to_topic";
}
}.property("reply_to_post_number", "sameUser"),
descriptionHtml: function () {
var descriptionKey = this.get("descriptionKey");
if (!descriptionKey) { return; }
var description = I18n.t("user_action." + descriptionKey, {
userUrl: this.get("usernameUrl"),
user: Handlebars.Utils.escapeExpression(this.get("presentName")),
postUrl: this.get("url"),
post_number: "#" + this.get("reply_to_post_number"),
topicUrl: this.get("url"),
});
return new Handlebars.SafeString(description);
}.property("descriptionKey")
}.property("reply_to_post_number", "sameUser")
});

View File

@ -21,7 +21,6 @@ var UserActionTypes = {
messages_sent: 12,
messages_received: 13
},
esc = Handlebars.Utils.escapeExpression,
InvertedActionTypes = {};
_.each(UserActionTypes, function (k, v) {
@ -73,31 +72,6 @@ Discourse.UserAction = Discourse.Model.extend({
}
}.property('action_type'),
/**
Returns the HTML representation of a user action's description, complete with icon.
@property descriptionHtml
**/
descriptionHtml: function() {
var descriptionKey = this.get('descriptionKey');
if (!descriptionKey) { return; }
var icon = this.get('isPM') ? '<i class="fa fa-envelope" title="{{i18n user.stream.private_message}}"></i>' : '';
return new Handlebars.SafeString(icon + " " + I18n.t("user_action." + descriptionKey, {
userUrl: this.get('userUrl'),
replyUrl: this.get('replyUrl'),
postUrl: this.get('postUrl'),
topicUrl: this.get('replyUrl'),
user: esc(this.get('presentName')),
post_number: '#' + this.get('reply_to_post_number'),
user1Url: this.get('userUrl'),
user2Url: this.get('targetUserUrl'),
another_user: esc(this.get('targetDisplayName'))
}));
}.property('descriptionKey'),
sameUser: function() {
return this.get('username') === Discourse.User.currentProp('username');
}.property('username'),

View File

@ -11,10 +11,9 @@
</span>
<span class="title">
<a href="{{unbound url}}">{{unbound topic_title}}</a>
{{category-link category}}
</span>
<span class="type">
{{descriptionHtml}}
<span class="category">
{{category-link category}}
</span>
{{#if deleted}}
<span class="delete-info">

View File

@ -5,9 +5,8 @@
<span class='time'>{{date path="created_at" leaveAgo="true"}}</span>
<span class="title">
<a href="{{unbound postUrl}}">{{unbound title}}</a>
{{category-link category}}
</span>
<span class="type">{{unbound descriptionHtml}}</span>
<span class="category">{{category-link category}}</span>
</div>
<p class='excerpt'>{{{unbound excerpt}}}</p>
{{#grouped-each children}}