Use module_app label instead of title

This commit is contained in:
chris 2013-10-29 11:17:02 +08:00
parent 49c1bff005
commit 6bc00ce3a3
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class Admin::ItemsController < OrbitBackendController
end end
modules = ModuleApp.for_frontend_select.inject([]) do |module_apps, module_app| modules = ModuleApp.for_frontend_select.inject([]) do |module_apps, module_app|
m = {} m = {}
m["main"] = [module_app.title, module_app.id.to_s] m["main"] = [module_app.label, module_app.id.to_s]
m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue [] m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue []
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget? m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue '' m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''

View File

@ -59,7 +59,7 @@ class Admin::PagePartsController < OrbitBackendController
def get_page_module_json def get_page_module_json
modules = ModuleApp.for_widget_select.inject([]) do |module_apps, module_app| modules = ModuleApp.for_widget_select.inject([]) do |module_apps, module_app|
m = {} m = {}
m["main"] = [module_app.title, module_app.id.to_s] m["main"] = [module_app.label, module_app.id.to_s]
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue [] m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue '' m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue '' m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''