From 7d600d9fee00d7e371ecaeef29b985a52d7ab131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 24 Aug 2016 22:25:10 +0200 Subject: [PATCH] FIX: show topic entrance when clicking the # of replies in /categories --- .../components/latest-topic-list-item.js.es6 | 6 +++ .../categories-and-latest-topics.hbs | 37 +------------------ .../components/latest-topic-list-item.hbs | 34 +++++++++++++++++ 3 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 app/assets/javascripts/discourse/components/latest-topic-list-item.js.es6 create mode 100644 app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs diff --git a/app/assets/javascripts/discourse/components/latest-topic-list-item.js.es6 b/app/assets/javascripts/discourse/components/latest-topic-list-item.js.es6 new file mode 100644 index 00000000000..07a4c53b2f5 --- /dev/null +++ b/app/assets/javascripts/discourse/components/latest-topic-list-item.js.es6 @@ -0,0 +1,6 @@ +import { showEntrance } from "discourse/components/topic-list-item"; + +export default Ember.Component.extend({ + tagName: "tr", + click: showEntrance, +}); diff --git a/app/assets/javascripts/discourse/templates/components/categories-and-latest-topics.hbs b/app/assets/javascripts/discourse/templates/components/categories-and-latest-topics.hbs index f766b04994a..d252e6388a2 100644 --- a/app/assets/javascripts/discourse/templates/components/categories-and-latest-topics.hbs +++ b/app/assets/javascripts/discourse/templates/components/categories-and-latest-topics.hbs @@ -12,42 +12,7 @@ {{else}} {{#if topics}} {{#each topics as |t|}} - - - - - - - {{topic-status topic=t}} - {{topic-link t}} - {{topic-post-badges newPosts=t.totalUnread unseen=t.unseen url=t.lastUnreadUrl}} - - - {{category-link t.category}} - {{#if t.tags}} - {{#each t.visibleListTags as |tag|}} - {{discourse-tag tag}} - {{/each}} - {{/if}} - - - - - -
- {{#with t.creator as |op|}} - {{#user-link user=op}} - {{avatar op imageSize="large"}} - {{/user-link}} - {{/with}} -
- {{raw "list/posts-count-column" topic=t tagName="div"}} - -
- + {{latest-topic-list-item topic=t}} {{/each}} diff --git a/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs b/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs new file mode 100644 index 00000000000..8a64a53e898 --- /dev/null +++ b/app/assets/javascripts/discourse/templates/components/latest-topic-list-item.hbs @@ -0,0 +1,34 @@ + + + + + + {{topic-status topic=topic}} + {{topic-link topic}} + {{topic-post-badges newPosts=topic.totalUnread unseen=topic.unseen url=topic.lastUnreadUrl}} + + + {{category-link topic.category}} + {{#if topic.tags}} + {{#each topic.visibleListTags as |tag|}} + {{discourse-tag tag}} + {{/each}} + {{/if}} + + + + + +
+ {{#with topic.creator as |op|}} + {{#user-link user=op}} + {{avatar op imageSize="large"}} + {{/user-link}} + {{/with}} +
+ {{raw "list/posts-count-column" topic=topic tagName="div"}} + +