link to more
This commit is contained in:
1 parent
8a8bfcb8fb
commit
071e8a349c
12 files changed
+46
-27
No files matched your search
@@ -34,6 +34,10 @@ module OrbitApp
|
||||
define_method(field){|var| instance_variable_set( "@" + field, var)}
|
||||
end
|
||||
|
||||
# def data_count(var)
|
||||
# @data_count = var
|
||||
# end
|
||||
|
||||
def find_by_path(path)
|
||||
@widgets.each do |widget|
|
||||
return widget if widget.name == path
|
||||
@@ -44,10 +48,14 @@ module OrbitApp
|
||||
eval(@categories_query) rescue nil
|
||||
end
|
||||
|
||||
def get_tags
|
||||
def get_tags
|
||||
eval(@tags_query) rescue nil
|
||||
end
|
||||
|
||||
def default_widget_setting
|
||||
@default_widget
|
||||
end
|
||||
|
||||
def default_widget(&block)
|
||||
@default_widget = DefaultWidget.new(&block)
|
||||
end
|
||||
@@ -85,6 +93,7 @@ module OrbitApp
|
||||
end
|
||||
|
||||
class DefaultWidget
|
||||
include DefaultWidgetTagHelper
|
||||
STYLE = ["typeA","typeB_style2","typeB_style3","typeB_style4","typeC"]
|
||||
|
||||
def initialize(&block)
|
||||
@@ -95,9 +104,10 @@ module OrbitApp
|
||||
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
|
||||
end
|
||||
|
||||
def more_link_to(label_i18n,path_method)
|
||||
@more_link[:label_i18n] = label_i18n
|
||||
@more_link[:path_method] = path_method
|
||||
|
||||
def link_to_more(*args)
|
||||
@more_link[:label_i18n] = (args[1] ? args[1][:title_i18n] : 'default_widget.default_link_to_more' )
|
||||
@more_link[:path_method] = args[0]
|
||||
end
|
||||
|
||||
def self.get_interface_args
|
||||
@@ -106,7 +116,7 @@ module OrbitApp
|
||||
end
|
||||
|
||||
def to_module_app_format
|
||||
{"query"=>@query,"image"=>@image} rescue nil
|
||||
{"query"=>@query,"image"=>@image,"more_link"=>@more_link} rescue nil
|
||||
end
|
||||
|
||||
def link_field(field_name,setting)
|
||||
|
||||
Reference in new issue
Block a user