From 9ab5b3a12387f3f5254a845ba959ba682be57e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 14 Jan 2014 01:47:36 +0100 Subject: [PATCH] BUGFIX: properly hide categories/top lists view when loading another tab --- .../templates/list/categories.js.handlebars | 199 +++++++++--------- .../templates/list/top.js.handlebars | 96 ++++----- 2 files changed, 149 insertions(+), 146 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/list/categories.js.handlebars b/app/assets/javascripts/discourse/templates/list/categories.js.handlebars index 15c784822d3..199788d9c88 100644 --- a/app/assets/javascripts/discourse/templates/list/categories.js.handlebars +++ b/app/assets/javascripts/discourse/templates/list/categories.js.handlebars @@ -1,102 +1,103 @@ -
- - - - - - - - - - - {{#each model.categories}} - - + + + + {{/each}} + +
{{i18n categories.category}}{{i18n categories.latest}}{{i18n categories.topics}}{{i18n categories.posts}} - {{#if canEdit}}{{/if}} -
-
-
- {{#if controller.ordering}}{{/if}} - {{categoryLink this allowUncategorized=true}} - {{#if unreadTopics}} - {{unbound unreadTopics}} - {{/if}} - {{#if newTopics}} - {{unbound newTopics}} - {{/if}} +{{#if model.categories}} +
+ + + + + + + + + + + {{#each model.categories}} + + - + - - - - {{/each}} - -
{{i18n categories.category}}{{i18n categories.latest}}{{i18n categories.topics}}{{i18n categories.posts}} + {{#if canEdit}}{{/if}} +
+
+
+ {{#if controller.ordering}}{{/if}} + {{categoryLink this allowUncategorized=true}} + {{#if unreadTopics}} + {{unbound unreadTopics}} + {{/if}} + {{#if newTopics}} + {{unbound newTopics}} + {{/if}} +
+ +
- -
- - {{#if description_excerpt}} -
- {{{description_excerpt}}} -
- {{/if}} - {{#if subcategories}} -
- {{i18n categories.subcategories}} - {{#each subcategory in subcategories}} - {{categoryLink subcategory}} - {{/each}} -
- {{/if}} -
- {{#each featuredTopics}} - + {{#each featuredTopics}} + - {{/each}} - - - {{#each topicCountStats}} - - - - + {{#if controller.latestTopicOnly}} + + {{else}} +   + {{unboundAge last_posted_at}} + {{/if}} + {{/each}} -
{{value}}{{unit}}
-
- - {{#each postCountStats}} - - - - - {{/each}} -
{{value}}{{unit}}
-
-
-
- +
+ + {{#each topicCountStats}} + + + + + {{/each}} +
{{value}}{{unit}}
+
+ + {{#each postCountStats}} + + + + + {{/each}} +
{{value}}{{unit}}
+
+
+ +{{/if}} diff --git a/app/assets/javascripts/discourse/templates/list/top.js.handlebars b/app/assets/javascripts/discourse/templates/list/top.js.handlebars index 6d6d08a006f..aa42ae54b4a 100644 --- a/app/assets/javascripts/discourse/templates/list/top.js.handlebars +++ b/app/assets/javascripts/discourse/templates/list/top.js.handlebars @@ -1,48 +1,50 @@ -
- {{#if redirectedToTopPageReason}} -
- {{redirectedToTopPageReason}} -
- {{/if}} - {{#if content.yearly}} -
-

{{i18n filters.top.this_year}}

- {{basic-topic-list topicList=content.yearly}} - {{#if content.yearly.topics.length}}{{i18n show_more}}{{/if}} -
- {{/if}} - {{#if content.monthly}} -
-

{{i18n filters.top.this_month}}

- {{basic-topic-list topicList=content.monthly}} - {{#if content.monthly.topics.length}}{{i18n show_more}}{{/if}} -
- {{/if}} - {{#if content.weekly}} -
-

{{i18n filters.top.this_week}}

- {{basic-topic-list topicList=content.weekly}} - {{#if content.weekly.topics.length}}{{i18n show_more}}{{/if}} -
- {{/if}} - {{#if content.daily}} -
-

{{i18n filters.top.today}}

- {{basic-topic-list topicList=content.daily}} - {{#if content.daily.topics.length}}{{i18n show_more}}{{/if}} -
- {{/if}} -
-

- {{#if hasDisplayedAllTopLists}} - {{#link-to "list.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'list.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}}. - {{else}} - {{#link-to "list.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'list.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}} - {{#unless content.yearly}}{{i18n filters.top.this_year}}{{/unless}} - {{#unless content.monthly}}{{i18n filters.top.this_month}}{{/unless}} - {{#unless content.weekly}}{{i18n filters.top.this_week}}{{/unless}} - {{#unless content.daily}}{{i18n filters.top.today}}{{/unless}} +{{#if content}} +
+ {{#if redirectedToTopPageReason}} +
+ {{redirectedToTopPageReason}} +
{{/if}} -

-
-
+ {{#if content.yearly}} +
+

{{i18n filters.top.this_year}}

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

{{i18n filters.top.this_month}}

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

{{i18n filters.top.this_week}}

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

{{i18n filters.top.today}}

+ {{basic-topic-list topicList=content.daily}} + {{#if content.daily.topics.length}}{{i18n show_more}}{{/if}} +
+ {{/if}} + + +{{/if}}