now default options can be chosen by developer at init

This commit is contained in:
Fu Matthew authored and Matt K. Fu committed 2013-04-17 11:07:45 +08:00
1 parent 50449b55e8
commit 9815950083
4 files changed
+58 -48

No files matched your search

+1 -6
View File
@@ -40,12 +40,7 @@ module OrbitApp
# include ApplicationHelper
# include AdminHelper
include SideBarRenderer
# def is_admin?
# binding.pry
# end
# def is_manager?
# binding.pry
# end
def initialize(name = '',key,get_module_app,&block)
@head_label = name
@context_links = []
+6 -2
View File
@@ -101,9 +101,13 @@ module OrbitApp
@image = nil
@more_link = {}
@fields = []
@enabled_styles = STYLE
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
def enable(args)
@enabled_styles = args
end
def link_to_more(*args)
@more_link[:label_i18n] = (args[1] ? args[1][:title_i18n] : 'default_widget.default_link_to_more' )
@@ -112,11 +116,11 @@ module OrbitApp
def self.get_interface_args
#will need to work with design
{:name=>"default_widget",:field=>@fields,:style=>STYLE,:i18n=>'default_widget.default_widget'}
{:name=>"default_widget",:field=>@fields,:style=>@enabled_styles,:i18n=>'default_widget.default_widget'}
end
def to_module_app_format
{"query"=>@query,"image"=>@image,"more_link"=>@more_link} rescue nil
{"query"=>@query,"image"=>@image,"more_link"=>@more_link,"enabled_styles"=>@enabled_styles} rescue nil
end
def link_field(field_name,setting)