From 69a49a69aadb37a877145b55a4f9551687ef2e44 Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Mon, 11 Mar 2013 18:21:17 +0800 Subject: [PATCH] style for front end --- .../pages/_custom_frontend_setting.html.erb | 4 ++++ lib/orbit_app/module/front_end.rb | 17 +++++++++++++++-- vendor/built_in_modules/announcement/init.rb | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/views/admin/pages/_custom_frontend_setting.html.erb b/app/views/admin/pages/_custom_frontend_setting.html.erb index 8b52708e..07c89e5b 100644 --- a/app/views/admin/pages/_custom_frontend_setting.html.erb +++ b/app/views/admin/pages/_custom_frontend_setting.html.erb @@ -3,6 +3,10 @@ <%= t("default_widget.select_widget_style") %>
+ <% if @frontend_styles%> + <%= select('page', 'frontend_style', @frontend_styles) %> + <% else %> <%= t("default_widget.no_support_setting")%> + <% end %>
diff --git a/lib/orbit_app/module/front_end.rb b/lib/orbit_app/module/front_end.rb index 0c5b245c..5547404c 100644 --- a/lib/orbit_app/module/front_end.rb +++ b/lib/orbit_app/module/front_end.rb @@ -33,15 +33,20 @@ module OrbitApp end def to_module_app_format #For ModuleApp to fetch data - @frontend_pages.collect{|t| [t.get_i18n,t.name]} + result = {} + @frontend_pages.collect do |t| + result[t.name] = {:i18n=>t.get_i18n,:style=>t.get_style} + end + result end end class AppPage attr_reader :name - + attr_reader :style def initialize(name,&block) + @style @name = name @frontend_i18n = 'rulingcom.errors.init.app_page_noname' block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? @@ -59,6 +64,14 @@ module OrbitApp end + def get_style + @style + end + + def style(ary)# [] + @style = ary + end + protected end# of AppPage diff --git a/vendor/built_in_modules/announcement/init.rb b/vendor/built_in_modules/announcement/init.rb index d70c876f..8032bd33 100644 --- a/vendor/built_in_modules/announcement/init.rb +++ b/vendor/built_in_modules/announcement/init.rb @@ -14,6 +14,7 @@ module Announcement front_end do app_page 'bulletins' do frontend_i18n "announcement.frontend.bulletins" + style ["1","2","3"] end end