diff --git a/app/assets/javascripts/discourse/models/user.js.es6 b/app/assets/javascripts/discourse/models/user.js.es6
index 2853625ab45..b74c2cd2cc0 100644
--- a/app/assets/javascripts/discourse/models/user.js.es6
+++ b/app/assets/javascripts/discourse/models/user.js.es6
@@ -390,17 +390,14 @@ const User = RestModel.extend({
summary() {
return Discourse.ajax(`/users/${this.get("username_lower")}/summary.json`)
.then(json => {
- const topicMap = {};
-
- json.topics.forEach(t => {
- topicMap[t.id] = Topic.create(t);
- });
-
- const badgeMap = {};
- Badge.createFromJson(json).forEach(b => {
- badgeMap[b.id] = b;
- });
const summary = json["user_summary"];
+ const topicMap = {};
+ const badgeMap = {};
+
+ json.topics.forEach(t => topicMap[t.id] = Topic.create(t));
+ Badge.createFromJson(json).forEach(b => badgeMap[b.id] = b );
+
+ summary.topics = summary.topic_ids.map(id => topicMap[id]);
summary.replies.forEach(r => {
r.topic = topicMap[r.topic_id];
@@ -408,7 +405,10 @@ const User = RestModel.extend({
r.createdAt = new Date(r.created_at);
});
- summary.topics = summary.topic_ids.map(id => topicMap[id]);
+ summary.links.forEach(l => {
+ l.topic = topicMap[l.topic_id];
+ l.post_url = l.topic.urlForPostNumber(l.post_number);
+ });
if (summary.badges) {
summary.badges = summary.badges.map(ub => {
@@ -417,6 +417,7 @@ const User = RestModel.extend({
return badge;
});
}
+
return summary;
});
}
diff --git a/app/assets/javascripts/discourse/templates/user/summary.hbs b/app/assets/javascripts/discourse/templates/user/summary.hbs
index b8d433a9171..ee6fc10c820 100644
--- a/app/assets/javascripts/discourse/templates/user/summary.hbs
+++ b/app/assets/javascripts/discourse/templates/user/summary.hbs
@@ -30,9 +30,7 @@
{{/if}}
-
- {{{reply.topic.fancyTitle}}}
-
+ {{{reply.topic.fancyTitle}}}
{{/each}}
@@ -57,9 +55,7 @@
{{/if}}
-
- {{{topic.fancyTitle}}}
-
+ {{{topic.fancyTitle}}}
{{/each}}
@@ -79,16 +75,10 @@