Commit 476be7eed896d9d00720597dfa50868d8af7c2fc

Authored by Karpikau Andrei
1 parent 229f3e0d

add flag main field for element

@@ -92,9 +92,15 @@ module Kanjai @@ -92,9 +92,15 @@ module Kanjai
92 end 92 end
93 93
94 @type_contents = [] 94 @type_contents = []
  95 + @main_field = []
95 96
96 if page_template = @page_data.page.page_template 97 if page_template = @page_data.page.page_template
97 @type_contents += page_template.template_parts.where("part_type in ('content')").collect{|p| [p.name, p.code] } 98 @type_contents += page_template.template_parts.where("part_type in ('content')").collect{|p| [p.name, p.code] }
  99 + page_template.template_parts.where("part_type in ('content')").each do |item|
  100 + item.field_options.each do |el|
  101 + @main_field << el[:name] if el[:mail].to_i == 1
  102 + end
  103 + end
98 end 104 end
99 105
100 @type_contents.sort!{|x,y| x[0] <=> y[0]} 106 @type_contents.sort!{|x,y| x[0] <=> y[0]}
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 51
52 52
53 <% end %> 53 <% end %>
54 - 54 + <%= @main_field %>
55 <% row_items = @obj.page_content_markers.select{|item| item.row_item.to_i > 0}.collect(&:row_item).uniq %> 55 <% row_items = @obj.page_content_markers.select{|item| item.row_item.to_i > 0}.collect(&:row_item).uniq %>
56 <% repeat_element = template_part.field_options.select{|item| item[:name] == 'repeat' }.first %> 56 <% repeat_element = template_part.field_options.select{|item| item[:name] == 'repeat' }.first %>
57 57
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.112" 2 + VERSION = "0.0.113"
3 end 3 end