diff --git a/app/assets/javascripts/discourse/models/topic_list.js b/app/assets/javascripts/discourse/models/topic_list.js index 8bc5428d7..7c8b2e07f 100644 --- a/app/assets/javascripts/discourse/models/topic_list.js +++ b/app/assets/javascripts/discourse/models/topic_list.js @@ -32,7 +32,6 @@ function finderFor(filter, params) { } Discourse.TopicList = Discourse.Model.extend({ - forEachNew: function(topics, callback) { var topicIds = []; _.each(this.get('topics'),function(topic) { diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars index c3ad6b835..57fcf87e7 100644 --- a/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars +++ b/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars @@ -57,9 +57,8 @@ {{#if allLoaded}} <h3> {{#if latest}} - {{#if can_create_topic}} - {{footerMessage}}<a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a> - {{/if}} + {{footerMessage}} + {{#if can_create_topic}}<a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a>{{/if}} {{else}} {{#if top}} {{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}} diff --git a/app/assets/javascripts/discourse/templates/mobile/list/categories.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/discovery/categories.js.handlebars similarity index 100% rename from app/assets/javascripts/discourse/templates/mobile/list/categories.js.handlebars rename to app/assets/javascripts/discourse/templates/mobile/discovery/categories.js.handlebars diff --git a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars new file mode 100644 index 000000000..4f218820d --- /dev/null +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars @@ -0,0 +1,43 @@ +<div class='contents'> + {{#if showTable}} + <table id='topic-list'> + {{#if topicTrackingState.hasIncoming}} + <tbody> + <tr> + <td> + <div class='alert alert-info' {{action showInserted}}> + {{countI18n new_topics_inserted countBinding="topicTrackingState.incomingCount"}} + {{i18n show_new_topics}} + </div> + </td> + </tr> + </tbody> + {{/if}} + {{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}} + </table> + {{/if}} +</div> + +<footer id='topic-list-bottom'> + {{#if loadingMore}} + <div class='topics-loading'>{{i18n topic.loading_more}}</div> + {{/if}} + {{#if allLoaded}} + <h3> + {{#if latest}} + {{footerMessage}} + {{#if can_create_topic}}<a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a>{{/if}} + {{else}} + {{#if top}} + {{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}} + {{#unless yearly}}<a href="{{unbound showMoreYearlyUrl}}" class='btn'>{{i18n filters.top.this_year}}</a>{{/unless}} + {{#unless monthly}}<a href="{{unbound showMoreMonthlyUrl}}" class='btn'>{{i18n filters.top.this_month}}</a>{{/unless}} + {{#unless weekly}}<a href="{{unbound showMoreWeeklyUrl}}" class='btn'>{{i18n filters.top.this_week}}</a>{{/unless}} + {{#unless daily}}<a href="{{unbound showMoreDailyUrl}}" class='btn'>{{i18n filters.top.today}}</a>{{/unless}} + {{else}} + {{footerMessage}}{{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} + {{/if}} + {{/if}} + </h3> + {{/if}} +</footer> diff --git a/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars deleted file mode 100644 index 070f9c25b..000000000 --- a/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars +++ /dev/null @@ -1,46 +0,0 @@ -{{#unless loading}} - {{#if loaded}} - <div class='contents'> - {{#if view.showTable}} - <table id='topic-list'> - - {{#if view.topicTrackingState.hasIncoming}} - <tbody> - <tr> - <td> - <div class='alert alert-info' {{action showInserted}}> - {{countI18n new_topics_inserted countBinding="view.topicTrackingState.incomingCount"}} - {{i18n show_new_topics}} - </div> - </td> - </tr> - </tbody> - {{/if}} - - {{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}} - - </table> - {{/if}} - </div> - - <footer id='topic-list-bottom'> - {{#if loadingMore}} - <div class='topics-loading'>{{i18n topic.loading_more}}</div> - {{/if}} - - <h3> - {{footerMessage}} - {{#if allLoaded}} - {{#if latest}} - {{#if canCreateTopic}} - <a href='#' {{action createTopic}}>{{i18n topic.suggest_create_topic}}</a> - {{/if}} - {{else}} - {{#link-to 'discovery.categories'}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} - {{/if}} - {{/if}} - </h3> - </footer> - - {{/if}} -{{/unless}} diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss index 7ee17f0d3..d6ab8e36e 100644 --- a/app/assets/stylesheets/mobile/topic-list.scss +++ b/app/assets/stylesheets/mobile/topic-list.scss @@ -108,6 +108,7 @@ font-size: 14px; margin-top: 8px; color: $dark_gray; + word-break: break-word; } .topic-statuses:empty {