changes in kernel for widgets to enable or disable main and column titles.
This commit is contained in:
parent
26980ebf33
commit
703a1f416f
|
@ -52,6 +52,7 @@ class DefaultWidgetController< OrbitWidgetController
|
|||
@tag_class = nil
|
||||
@default_widget = @page_part.module_app.get_default_widget
|
||||
@widget_image_field = @default_widget["image"] || @default_widget[:image]
|
||||
|
||||
case @page_part
|
||||
when Page
|
||||
@frontend_field_names = @page_part.frontend_field_name
|
||||
|
@ -65,7 +66,7 @@ class DefaultWidgetController< OrbitWidgetController
|
|||
@frontend_field_names = @page_part.widget_field_name
|
||||
@frontend_classes = @page_part.widget_class
|
||||
@frontend_sat_to_links = @page_part.widget_sat_to_link
|
||||
|
||||
@widget_title = @page_part.title_translations[I18n.locale.to_s]
|
||||
@fields = @page_part.widget_field
|
||||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||
end
|
||||
|
|
|
@ -2,11 +2,18 @@
|
|||
<div class="default_widget_type_A">
|
||||
<table class="default_widget_tb" border="0" cellpadding="0" cellspacing="0" >
|
||||
<thead>
|
||||
<% if @default_widget['widget_title_enabled'] %>
|
||||
<tr>
|
||||
<%= content_tag(:th,content_tag(:span,@widget_title,:class=>"title"),:colspan=>@frontend_field_names.count) unless @page_part.title_translations.empty?%>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @default_widget['column_title_enabled'] %>
|
||||
<tr>
|
||||
<% @frontend_field_names.each_with_index do |field,index|%>
|
||||
<%= content_tag(:th,content_tag(:span,get_field_header(field),:class=>@frontend_classes[index]))unless field.blank?%>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</thead>
|
||||
<% @data.each do |row_data| %>
|
||||
<tr>
|
||||
|
|
|
@ -15,3 +15,4 @@ gem 'personal_patent', '0.0.1', :git => 'git@gitlab.tp.rulingcom.com:root/orbit-
|
|||
gem 'personal_project', '0.0.1', :git => 'git@gitlab.tp.rulingcom.com:root/orbit-personalproject.git'
|
||||
gem 'personal_research', '0.0.1', :git => 'git@gitlab.tp.rulingcom.com:root/orbit-personalresearch.git'
|
||||
gem 'web_resource', '0.0.1', :git => 'git@gitlab.tp.rulingcom.com:root/orbit-webresource.git'
|
||||
gem 'faq', '0.0.1', :path => "/Users/H4RRY/github/modules/orbit-faq"
|
|
@ -26,6 +26,8 @@ module OrbitApp
|
|||
def initialize(name,key,&block)
|
||||
@widgets = []
|
||||
@default_widget = nil
|
||||
@widget_title_enabled = true
|
||||
@column_title_enabled = false
|
||||
@categories_query = ''
|
||||
@tags_query = ''
|
||||
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
|
||||
|
@ -101,6 +103,8 @@ module OrbitApp
|
|||
|
||||
def initialize(&block)
|
||||
@query = nil
|
||||
@widget_title_enabled = true
|
||||
@column_title_enabled = false
|
||||
@image = nil
|
||||
@more_link = {}
|
||||
@fields = []
|
||||
|
@ -122,7 +126,7 @@ module OrbitApp
|
|||
end
|
||||
|
||||
def to_module_app_format
|
||||
{"query"=>@query,"image"=>@image,"more_link"=>@more_link,"enabled_styles"=>@enabled_styles} rescue nil
|
||||
{"query"=>@query,"image"=>@image,"more_link"=>@more_link,"enabled_styles"=>@enabled_styles,"widget_title_enabled"=>@widget_title_enabled, "column_title_enabled"=>@column_title_enabled} rescue nil
|
||||
end
|
||||
|
||||
def link_field(field_name,setting)
|
||||
|
@ -145,6 +149,14 @@ module OrbitApp
|
|||
@query = var
|
||||
end
|
||||
|
||||
def widget_title_enabled(var)
|
||||
@widget_title_enabled = var
|
||||
end
|
||||
|
||||
def column_title_enabled(var)
|
||||
@column_title_enabled = var
|
||||
end
|
||||
|
||||
def image(var)
|
||||
@image = var
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue