diff --git a/app/views/editor/article/home.coffee b/app/views/editor/article/home.coffee index 41d7419f9..c34640d55 100644 --- a/app/views/editor/article/home.coffee +++ b/app/views/editor/article/home.coffee @@ -6,3 +6,12 @@ module.exports = class ThangTypeHomeView extends SearchView model: require 'models/Article' modelURL: '/db/article' tableTemplate: require 'templates/editor/article/table' + + getRenderData: -> + context = super() + context.currentEditor = 'editor.article_title' + context.currentNew = 'editor.new_article_title' + context.currentNewSignup = 'editor.new_article_title_login' + context.currentSearch = 'editor.article_search_title' + @$el.i18n() + context diff --git a/app/views/editor/level/home.coffee b/app/views/editor/level/home.coffee index 247c9d3ff..ae31fd6e8 100644 --- a/app/views/editor/level/home.coffee +++ b/app/views/editor/level/home.coffee @@ -6,3 +6,12 @@ module.exports = class EditorSearchView extends SearchView model: require 'models/Level' modelURL: '/db/level' tableTemplate: require 'templates/editor/level/table' + + getRenderData: -> + context = super() + context.currentEditor = 'editor.level_title' + context.currentNew = 'editor.new_level_title' + context.currentNewSignup = 'editor.new_level_title_login' + context.currentSearch = 'editor.level_search_title' + @$el.i18n() + context diff --git a/app/views/editor/thang/home.coffee b/app/views/editor/thang/home.coffee index 2fb208723..1f585b2ab 100644 --- a/app/views/editor/thang/home.coffee +++ b/app/views/editor/thang/home.coffee @@ -5,10 +5,19 @@ module.exports = class ThangTypeHomeView extends SearchView modelLabel: 'Thang Type' model: require 'models/ThangType' modelURL: '/db/thang.type' - tableTemplate: require 'templates/editor/thang/table' + tableTemplate: require 'templates/editor/thang/table' + + getRenderData: -> + context = super() + context.currentEditor = 'editor.thang_title' + context.currentNew = 'editor.new_thang_title' + context.currentNewSignup = 'editor.new_thang_title_login' + context.currentSearch = 'editor.thang_search_title' + @$el.i18n() + context onSearchChange: => super() @$el.find("img").error(-> $(this).hide()) - # TODO: do the new thing on click, not just enter \ No newline at end of file + # TODO: do the new thing on click, not just enter diff --git a/app/views/kinds/SearchView.coffee b/app/views/kinds/SearchView.coffee index 209abdd8e..6619a71c3 100644 --- a/app/views/kinds/SearchView.coffee +++ b/app/views/kinds/SearchView.coffee @@ -26,27 +26,6 @@ module.exports = class SearchView extends View 'shown.bs.modal #new-model-modal': 'focusOnName' 'hidden.bs.modal #new-model-modal': 'onModalHidden' - getRenderData: -> - context = super() - switch @modelLabel - when 'Level' - context.currentEditor = 'editor.level_title' - context.currentNew = 'editor.new_level_title' - context.currentNewSignup = 'editor.new_level_title_login' - context.currentSearch = 'editor.level_search_title' - when 'Thang Type' - context.currentEditor = 'editor.thang_title' - context.currentNew = 'editor.new_thang_title' - context.currentNewSignup = 'editor.new_thang_title_login' - context.currentSearch = 'editor.thang_search_title' - when 'Article' - context.currentEditor = 'editor.article_title' - context.currentNew = 'editor.new_article_title' - context.currentNewSignup = 'editor.new_article_title_login' - context.currentSearch = 'editor.article_search_title' - @$el.i18n() - context - constructor: (options) -> @runSearch = _.debounce(@runSearch, 500) super options