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) => Discourse.TopicList.list(current).then (items) =>
@set('filterSummary', items.filter_summary) @set('filterSummary', items.filter_summary)
@set('filterMode', filterMode) @set('filterMode', filterMode)
@set('allLoaded', true) unless items.more_topics_url
@set('loading', false) @set('loading', false)
deferred.resolve(items) deferred.resolve(items)

View File

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

View File

@ -36,7 +36,9 @@
{{outlet listView}} {{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>
</div> </div>

View File

@ -314,6 +314,7 @@ en:
no_read: "You haven't read any topics yet." no_read: "You haven't read any topics yet."
no_posted: "You haven't posted in any topics yet." no_posted: "You haven't posted in any topics yet."
no_popular: "There are no popular topics. That's sad." 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: topic:
create_in: 'Create {{categoryName}} Topic' create_in: 'Create {{categoryName}} Topic'