BUGFIX: properly hide categories/top lists view when loading another tab

This commit is contained in:
Régis Hanol 2014-01-14 01:47:36 +01:00
parent 3a6bffa05d
commit 9ab5b3a123
2 changed files with 149 additions and 146 deletions

View File

@ -1,102 +1,103 @@
<div class='contents'> {{#if model.categories}}
<table id='topic-list' class='categories'> <div class='contents'>
<thead> <table id='topic-list' class='categories'>
<tr> <thead>
<th class='category'>{{i18n categories.category}}</th> <tr>
<th class='latest'>{{i18n categories.latest}}</th> <th class='category'>{{i18n categories.category}}</th>
<th class='stats topics'>{{i18n categories.topics}}</th> <th class='latest'>{{i18n categories.latest}}</th>
<th class='stats posts'>{{i18n categories.posts}} <th class='stats topics'>{{i18n categories.topics}}</th>
{{#if canEdit}}<button title='{{i18n categories.toggle_ordering}}' class='btn toggle-admin no-text' {{action toggleOrdering}}><i class='fa fa-wrench'></i></button>{{/if}} <th class='stats posts'>{{i18n categories.posts}}
</th> {{#if canEdit}}<button title='{{i18n categories.toggle_ordering}}' class='btn toggle-admin no-text' {{action toggleOrdering}}><i class='fa fa-wrench'></i></button>{{/if}}
</tr> </th>
</thead> </tr>
<tbody> </thead>
{{#each model.categories}} <tbody>
<tr data-category_id='{{unbound id}}' {{bindAttr class="description_excerpt:has-description:no-description"}}> {{#each model.categories}}
<td class='category'> <tr data-category_id='{{unbound id}}' {{bindAttr class="description_excerpt:has-description:no-description"}}>
<div> <td class='category'>
<div class="pull-left"> <div>
{{#if controller.ordering}}<i class="fa fa-bars"></i>{{/if}} <div class="pull-left">
{{categoryLink this allowUncategorized=true}} {{#if controller.ordering}}<i class="fa fa-bars"></i>{{/if}}
{{#if unreadTopics}} {{categoryLink this allowUncategorized=true}}
<a href={{unbound unreadUrl}} class='badge new-posts badge-notification' title='{{i18n topic.unread_topics count="unreadTopics"}}'>{{unbound unreadTopics}}</a> {{#if unreadTopics}}
{{/if}} <a href={{unbound unreadUrl}} class='badge new-posts badge-notification' title='{{i18n topic.unread_topics count="unreadTopics"}}'>{{unbound unreadTopics}}</a>
{{#if newTopics}} {{/if}}
<a href={{unbound newUrl}} class='badge new-posts badge-notification' title='{{i18n topic.new_topics count="newTopics"}}'>{{unbound newTopics}} <i class='fa fa-asterisk'></i></a> {{#if newTopics}}
{{/if}} <a href={{unbound newUrl}} class='badge new-posts badge-notification' title='{{i18n topic.new_topics count="newTopics"}}'>{{unbound newTopics}} <i class='fa fa-asterisk'></i></a>
{{/if}}
</div>
<div class='featured-users'>
{{#each featured_users}}
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a>
{{/each}}
</div>
<div class="clearfix"></div>
</div> </div>
<div class='featured-users'> {{#if description_excerpt}}
{{#each featured_users}} <div class="category-description">
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a> {{{description_excerpt}}}
{{/each}} </div>
</div> {{/if}}
<div class="clearfix"></div> {{#if subcategories}}
</div> <div class='subcategories'>
{{#if description_excerpt}} {{i18n categories.subcategories}}
<div class="category-description"> {{#each subcategory in subcategories}}
{{{description_excerpt}}} {{categoryLink subcategory}}
</div> {{/each}}
{{/if}} </div>
{{#if subcategories}} {{/if}}
<div class='subcategories'> </td>
{{i18n categories.subcategories}} <td {{bindAttr class="archived :latest"}}>
{{#each subcategory in subcategories}} {{#each featuredTopics}}
{{categoryLink subcategory}} <div class="featured-topic">
{{/each}} {{topicStatus topic=this}}
</div> <a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a>
{{/if}} {{#if unread}}
</td> <a href="{{unbound lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a>
<td {{bindAttr class="archived :latest"}}> {{/if}}
{{#each featuredTopics}} {{#if new_posts}}
<div class="featured-topic"> <a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts count="new_posts"}}'>{{new_posts}}</a>
{{topicStatus topic=this}} {{/if}}
<a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a> {{#if unseen}}
{{#if unread}} <a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'><i class='fa fa-asterisk'></i></a>
<a href="{{unbound lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a> {{/if}}
{{/if}}
{{#if new_posts}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts count="new_posts"}}'>{{new_posts}}</a>
{{/if}}
{{#if unseen}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'><i class='fa fa-asterisk'></i></a>
{{/if}}
{{#if controller.latestTopicOnly}} {{#if controller.latestTopicOnly}}
<div class='last-user-info'> <div class='last-user-info'>
{{i18n categories.latest_by}} <a href="{{{unbound lastPosterUrl}}}">{{unbound last_poster.username}}</a> {{i18n categories.latest_by}} <a href="{{{unbound lastPosterUrl}}}">{{unbound last_poster.username}}</a>
<a href="{{unbound lastPostUrl}}">{{unboundAge last_posted_at}}</a> <a href="{{unbound lastPostUrl}}">{{unboundAge last_posted_at}}</a>
</div> </div>
{{else}} {{else}}
&nbsp; &nbsp;
<a href="{{unbound lastPostUrl}}" class="last-posted-at">{{unboundAge last_posted_at}}</a> <a href="{{unbound lastPostUrl}}" class="last-posted-at">{{unboundAge last_posted_at}}</a>
{{/if}} {{/if}}
</div> </div>
{{/each}}
</td>
<td class='stats' {{bindAttr title="topicStatsTitle"}}>
<table class="categoryStats">
{{#each topicCountStats}}
<tr>
<td class="value">{{value}}</td>
<td class="unit">{{unit}}</td>
</tr>
{{/each}} {{/each}}
</table> </td>
</td> <td class='stats' {{bindAttr title="topicStatsTitle"}}>
<td class='stats' {{bindAttr title="postStatsTitle"}}> <table class="categoryStats">
<table class="categoryStats"> {{#each topicCountStats}}
{{#each postCountStats}} <tr>
<tr> <td class="value">{{value}}</td>
<td class="value">{{value}}</td> <td class="unit">{{unit}}</td>
<td class="unit">{{unit}}</td> </tr>
</tr> {{/each}}
{{/each}} </table>
</table> </td>
</td> <td class='stats' {{bindAttr title="postStatsTitle"}}>
</tr> <table class="categoryStats">
{{/each}} {{#each postCountStats}}
</tbody> <tr>
</table> <td class="value">{{value}}</td>
</div> <td class="unit">{{unit}}</td>
<footer id='topic-list-bottom'></footer> </tr>
{{/each}}
</table>
</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
<footer id='topic-list-bottom'></footer>
{{/if}}

View File

@ -1,48 +1,50 @@
<div class="top-lists"> {{#if content}}
{{#if redirectedToTopPageReason}} <div class="top-lists">
<div class="alert alert-info"> {{#if redirectedToTopPageReason}}
{{redirectedToTopPageReason}} <div class="alert alert-info">
</div> {{redirectedToTopPageReason}}
{{/if}} </div>
{{#if content.yearly}}
<div class="clearfix">
<h2>{{i18n filters.top.this_year}}</h2>
{{basic-topic-list topicList=content.yearly}}
{{#if content.yearly.topics.length}}<a href={{unbound showMoreYearlyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
{{#if content.monthly}}
<div class="clearfix">
<h2>{{i18n filters.top.this_month}}</h2>
{{basic-topic-list topicList=content.monthly}}
{{#if content.monthly.topics.length}}<a href={{unbound showMoreMonthlyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
{{#if content.weekly}}
<div class="clearfix">
<h2>{{i18n filters.top.this_week}}</h2>
{{basic-topic-list topicList=content.weekly}}
{{#if content.weekly.topics.length}}<a href={{unbound showMoreWeeklyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
{{#if content.daily}}
<div class="clearfix">
<h2>{{i18n filters.top.today}}</h2>
{{basic-topic-list topicList=content.daily}}
{{#if content.daily.topics.length}}<a href={{unbound showMoreDailyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
<footer id="topic-list-bottom">
<h3>
{{#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}}<a href={{unbound showMoreYearlyUrl}} class='btn'>{{i18n filters.top.this_year}}</a>{{/unless}}
{{#unless content.monthly}}<a href={{unbound showMoreMonthlyUrl}} class='btn'>{{i18n filters.top.this_month}}</a>{{/unless}}
{{#unless content.weekly}}<a href={{unbound showMoreWeeklyUrl}} class='btn'>{{i18n filters.top.this_week}}</a>{{/unless}}
{{#unless content.daily}}<a href={{unbound showMoreDailyUrl}} class='btn'>{{i18n filters.top.today}}</a>{{/unless}}
{{/if}} {{/if}}
</h3> {{#if content.yearly}}
</footer> <div class="clearfix">
</div> <h2>{{i18n filters.top.this_year}}</h2>
{{basic-topic-list topicList=content.yearly}}
{{#if content.yearly.topics.length}}<a href={{unbound showMoreYearlyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
{{#if content.monthly}}
<div class="clearfix">
<h2>{{i18n filters.top.this_month}}</h2>
{{basic-topic-list topicList=content.monthly}}
{{#if content.monthly.topics.length}}<a href={{unbound showMoreMonthlyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
{{#if content.weekly}}
<div class="clearfix">
<h2>{{i18n filters.top.this_week}}</h2>
{{basic-topic-list topicList=content.weekly}}
{{#if content.weekly.topics.length}}<a href={{unbound showMoreWeeklyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
{{#if content.daily}}
<div class="clearfix">
<h2>{{i18n filters.top.today}}</h2>
{{basic-topic-list topicList=content.daily}}
{{#if content.daily.topics.length}}<a href={{unbound showMoreDailyUrl}} class='btn pull-right'>{{i18n show_more}}</a>{{/if}}
</div>
{{/if}}
<footer id="topic-list-bottom">
<h3>
{{#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}}<a href={{unbound showMoreYearlyUrl}} class='btn'>{{i18n filters.top.this_year}}</a>{{/unless}}
{{#unless content.monthly}}<a href={{unbound showMoreMonthlyUrl}} class='btn'>{{i18n filters.top.this_month}}</a>{{/unless}}
{{#unless content.weekly}}<a href={{unbound showMoreWeeklyUrl}} class='btn'>{{i18n filters.top.this_week}}</a>{{/unless}}
{{#unless content.daily}}<a href={{unbound showMoreDailyUrl}} class='btn'>{{i18n filters.top.today}}</a>{{/unless}}
{{/if}}
</h3>
</footer>
</div>
{{/if}}