clean up the topics footer so it does not flash and is localisable

This commit is contained in:
Sam Saffron 2013-02-16 12:15:15 +11:00
parent ff0d58e4ee
commit c81d07c44b
4 changed files with 9 additions and 2 deletions

View File

@ -39,6 +39,7 @@ Discourse.ListController = Ember.Controller.extend Discourse.Presence,
Discourse.TopicList.list(current).then (items) =>
@set('filterSummary', items.filter_summary)
@set('filterMode', filterMode)
@set('allLoaded', true) unless items.more_topics_url
@set('loading', false)
deferred.resolve(items)

View File

@ -5,6 +5,9 @@ window.Discourse.FilteredListRoute = Discourse.Route.extend
listController = @controllerFor('list')
listController.set('canCreateTopic', false)
listController.set('filterMode', '')
listController.set('allLoaded', false)
renderTemplate: ->
@render 'listTopics', into: 'list', outlet: 'listView', controller: 'listTopics'
setupController: ->

View File

@ -35,8 +35,10 @@
{{/if}}
{{outlet listView}}
<h3>No more topics in this category. <a href="/categories">Browse all categories</a> or <a href="/">view popular topics</a></h3>
{{#if controller.allLoaded}}
{{{i18n topics.footer}}}
{{/if}}
</div>
</div>

View File

@ -314,6 +314,7 @@ en:
no_read: "You haven't read any topics yet."
no_posted: "You haven't posted in any topics yet."
no_popular: "There are no popular topics. That's sad."
footer: "No more topics in this category. <a href=\"/categories\">Browse all categories</a> or <a href=\"/\">view popular topics</a>"
topic:
create_in: 'Create {{categoryName}} Topic'