diff --git a/app/assets/javascripts/discourse/components/activity-column.js.es6 b/app/assets/javascripts/discourse/components/activity-column.js.es6 index 1562a8cba..8f6a20aee 100644 --- a/app/assets/javascripts/discourse/components/activity-column.js.es6 +++ b/app/assets/javascripts/discourse/components/activity-column.js.es6 @@ -37,22 +37,7 @@ export default Ember.Component.extend({ }.property('bumpedAt', 'createdAt'), render: function(buffer) { - buffer.push("" + Discourse.Formatter.autoUpdatingRelativeAge(this.get('bumpedAt')) + ""); - }, - - click: function() { - var topic = this.get('topic'); - - if (Discourse.Mobile.mobileView) { - Discourse.URL.routeTo(topic.get('lastPostUrl')); - return false; - } - - this.sendAction('action', { - topic: topic, - position: this.$('span').position() - }); - - return false; + buffer.push("" + Discourse.Formatter.autoUpdatingRelativeAge(this.get('bumpedAt')) + ""); } + }); diff --git a/app/assets/javascripts/discourse/components/basic-topic-list.js.es6 b/app/assets/javascripts/discourse/components/basic-topic-list.js.es6 index d966ca1cf..07b7a6872 100644 --- a/app/assets/javascripts/discourse/components/basic-topic-list.js.es6 +++ b/app/assets/javascripts/discourse/components/basic-topic-list.js.es6 @@ -40,8 +40,8 @@ export default Ember.Component.extend({ }, actions: { - clickedActivity: function(data) { - this.sendAction('activityAction', data); + clickedPosts: function(data) { + this.sendAction('postsAction', data); } } diff --git a/app/assets/javascripts/discourse/components/posts-count-column.js.es6 b/app/assets/javascripts/discourse/components/posts-count-column.js.es6 index 6263de0eb..df4323e77 100644 --- a/app/assets/javascripts/discourse/components/posts-count-column.js.es6 +++ b/app/assets/javascripts/discourse/components/posts-count-column.js.es6 @@ -31,11 +31,27 @@ export default Ember.Component.extend({ likesHeat: Discourse.computed.fmt('ratioText', 'heatmap-%@'), render: function(buffer) { - var postsCount = this.get('topic.posts_count'), - url = this.get('topic.lastPostUrl'); + var postsCount = this.get('topic.posts_count'); - buffer.push(""); + buffer.push(""); buffer.push(Discourse.Formatter.number(postsCount)); buffer.push(""); + }, + + click: function() { + var topic = this.get('topic'); + + if (Discourse.Mobile.mobileView) { + Discourse.URL.routeTo(topic.get('lastPostUrl')); + return false; + } + + this.sendAction('action', { + topic: topic, + position: this.$('a').position() + }); + + return false; } + }); diff --git a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars index 8c55a5f44..25ea859ea 100644 --- a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars @@ -39,7 +39,7 @@ {{/unless}} - {{posts-count-column topic=topic class="num"}} + {{posts-count-column topic=topic class="num" action="clickedPosts"}} {{#if controller.showParticipants}} @@ -53,7 +53,7 @@ {{number topic.views numberKey="views_long"}} - {{activity-column topic=topic class="num" action="clickedActivity"}} + {{activity-column topic=topic class="num"}} {{/grouped-each}} diff --git a/app/assets/javascripts/discourse/templates/discovery/top.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/top.js.handlebars index 4ecd1c064..aa6a5e2c2 100644 --- a/app/assets/javascripts/discourse/templates/discovery/top.js.handlebars +++ b/app/assets/javascripts/discourse/templates/discovery/top.js.handlebars @@ -5,28 +5,28 @@ {{#if content.yearly}}

{{i18n filters.top.this_year}}

- {{basic-topic-list topicList=content.yearly hideCategory=hideCategory activityAction="showTopicEntrance"}} + {{basic-topic-list topicList=content.yearly hideCategory=hideCategory postsAction="showTopicEntrance"}} {{#if content.yearly.topics.length}}{{i18n show_more}}{{/if}}
{{/if}} {{#if content.monthly}}

{{i18n filters.top.this_month}}

- {{basic-topic-list topicList=content.monthly hideCategory=hideCategory activityAction="showTopicEntrance"}} + {{basic-topic-list topicList=content.monthly hideCategory=hideCategory postsAction="showTopicEntrance"}} {{#if content.monthly.topics.length}}{{i18n show_more}}{{/if}}
{{/if}} {{#if content.weekly}}

{{i18n filters.top.this_week}}

- {{basic-topic-list topicList=content.weekly hideCategory=hideCategory activityAction="showTopicEntrance"}} + {{basic-topic-list topicList=content.weekly hideCategory=hideCategory postsAction="showTopicEntrance"}} {{#if content.weekly.topics.length}}{{i18n show_more}}{{/if}}
{{/if}} {{#if content.daily}}

{{i18n filters.top.today}}

- {{basic-topic-list topicList=content.daily hideCategory=hideCategory activityAction="showTopicEntrance"}} + {{basic-topic-list topicList=content.daily hideCategory=hideCategory postsAction="showTopicEntrance"}} {{#if content.daily.topics.length}}{{i18n show_more}}{{/if}}
{{/if}} diff --git a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars index 3d432d364..825c91db5 100644 --- a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars +++ b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars @@ -42,7 +42,7 @@ {{view 'posters-column' posters=posters}} -{{posts-count-column topic=model class="num"}} +{{posts-count-column topic=model class="num" action="showTopicEntrance"}} {{number views numberKey="views_long"}} -{{activity-column topic=model class="num" action="showTopicEntrance"}} +{{activity-column topic=model class="num"}} diff --git a/app/assets/javascripts/discourse/templates/list/user_topics_list.js.handlebars b/app/assets/javascripts/discourse/templates/list/user_topics_list.js.handlebars index f7e73c447..ac54a240b 100644 --- a/app/assets/javascripts/discourse/templates/list/user_topics_list.js.handlebars +++ b/app/assets/javascripts/discourse/templates/list/user_topics_list.js.handlebars @@ -1,4 +1,4 @@ {{basic-topic-list topicList=model hideCategory=hideCategory showParticipants=showParticipants - activityAction="showTopicEntrance"}} + postsAction="showTopicEntrance"}} diff --git a/app/assets/javascripts/discourse/templates/topic.js.handlebars b/app/assets/javascripts/discourse/templates/topic.js.handlebars index f89169f58..abf03ae6c 100644 --- a/app/assets/javascripts/discourse/templates/topic.js.handlebars +++ b/app/assets/javascripts/discourse/templates/topic.js.handlebars @@ -102,7 +102,7 @@

{{i18n suggested_topics.title}}

- {{basic-topic-list topics=details.suggested_topics activityAction="showTopicEntrance"}} + {{basic-topic-list topics=details.suggested_topics postsAction="showTopicEntrance"}}

{{{view.browseMoreMessage}}}