From c4cbf934d01ff0eaf53a7b38d07d9c6ed827a9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Sun, 19 Jan 2014 00:49:45 +0100 Subject: [PATCH] BUGFIX: move mobile templates to discovery --- .../discourse/models/topic_list.js | 1 - .../templates/discovery/topics.js.handlebars | 5 +- .../categories.js.handlebars | 0 .../mobile/discovery/topics.js.handlebars | 43 +++++++++++++++++ .../mobile/list/topics.js.handlebars | 46 ------------------- app/assets/stylesheets/mobile/topic-list.scss | 1 + 6 files changed, 46 insertions(+), 50 deletions(-) rename app/assets/javascripts/discourse/templates/mobile/{list => discovery}/categories.js.handlebars (100%) create mode 100644 app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars delete mode 100644 app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars diff --git a/app/assets/javascripts/discourse/models/topic_list.js b/app/assets/javascripts/discourse/models/topic_list.js index 8bc5428d774..7c8b2e07f37 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 c3ad6b835e7..57fcf87e726 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}}

{{#if latest}} - {{#if can_create_topic}} - {{footerMessage}}{{i18n topic.suggest_create_topic}} - {{/if}} + {{footerMessage}} + {{#if can_create_topic}}{{i18n topic.suggest_create_topic}}{{/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 00000000000..4f218820df4 --- /dev/null +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.js.handlebars @@ -0,0 +1,43 @@ +
+ {{#if showTable}} + + {{#if topicTrackingState.hasIncoming}} + + + + + + {{/if}} + {{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}} +
+
+ {{countI18n new_topics_inserted countBinding="topicTrackingState.incomingCount"}} + {{i18n show_new_topics}} +
+
+ {{/if}} +
+ +
+ {{#if loadingMore}} +
{{i18n topic.loading_more}}
+ {{/if}} + {{#if allLoaded}} +

+ {{#if latest}} + {{footerMessage}} + {{#if can_create_topic}}{{i18n topic.suggest_create_topic}}{{/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}}{{i18n filters.top.this_year}}{{/unless}} + {{#unless monthly}}{{i18n filters.top.this_month}}{{/unless}} + {{#unless weekly}}{{i18n filters.top.this_week}}{{/unless}} + {{#unless daily}}{{i18n filters.top.today}}{{/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}} +

+ {{/if}} +
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 070f9c25bd7..00000000000 --- a/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars +++ /dev/null @@ -1,46 +0,0 @@ -{{#unless loading}} - {{#if loaded}} -
- {{#if view.showTable}} - - - {{#if view.topicTrackingState.hasIncoming}} - - - - - - {{/if}} - - {{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}} - -
-
- {{countI18n new_topics_inserted countBinding="view.topicTrackingState.incomingCount"}} - {{i18n show_new_topics}} -
-
- {{/if}} -
- - - - {{/if}} -{{/unless}} diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss index 7ee17f0d307..d6ab8e36e5f 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 {