change bulletin object to bulletin title
This commit is contained in:
parent
a0868a05ac
commit
3e8b029c5f
|
@ -14,8 +14,6 @@ class DefaultWidgetController< OrbitWidgetController
|
||||||
@data = eval(@default_widget[:query]).limit(data_limit).includes(@widget_image_field)
|
@data = eval(@default_widget[:query]).limit(data_limit).includes(@widget_image_field)
|
||||||
@fields = @page_part.widget_field
|
@fields = @page_part.widget_field
|
||||||
|
|
||||||
# binding.pry
|
|
||||||
|
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when "typeA"
|
when "typeA"
|
||||||
@tag_class = 'defulat_widget_typeA'
|
@tag_class = 'defulat_widget_typeA'
|
||||||
|
@ -27,8 +25,6 @@ class DefaultWidgetController< OrbitWidgetController
|
||||||
@tag_class = 'defulat_widget_typeC'
|
@tag_class = 'defulat_widget_typeC'
|
||||||
render "typeC"
|
render "typeC"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# {"inner"=>"true",
|
# {"inner"=>"true",
|
||||||
# "category_id"=>"false",
|
# "category_id"=>"false",
|
||||||
|
@ -41,5 +37,4 @@ class DefaultWidgetController< OrbitWidgetController
|
||||||
# "action"=>"default_widget",
|
# "action"=>"default_widget",
|
||||||
# "type"=>"typeA"}
|
# "type"=>"typeA"}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,11 @@
|
||||||
<% @data.each do |row_data| %>
|
<% @data.each do |row_data| %>
|
||||||
<tr>
|
<tr>
|
||||||
<% @fields.each do |field|%>
|
<% @fields.each do |field|%>
|
||||||
<td><%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%></td>
|
<% if field[0] == "bulletin_category"%>
|
||||||
|
<td><%= content_tag(:span,row_data.send(field[0]).title,:class=>field[1])%></td>
|
||||||
|
<% else %>
|
||||||
|
<td><%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%></td>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
<%= content_tag :div,:class=>@tag_class do%>
|
<%= content_tag :div,:class=>@tag_class do%>
|
||||||
<ul class="defulat_widget_list">
|
<ul class="defulat_widget_list">
|
||||||
|
|
||||||
<% @data.each do |row_data| %>
|
<% @data.each do |row_data| %>
|
||||||
<%= content_tag(:li) do %>
|
<%= content_tag(:li) do %>
|
||||||
<div class="img app-pic">
|
<div class="img app-pic">
|
||||||
<%= image_tag row_data.send(@widget_image_field)%>
|
<%= image_tag row_data.send(@widget_image_field)%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<% @fields.each do |field|%>
|
<% @fields.each do |field|%>
|
||||||
|
<% if field[0] == "bulletin_category"%>
|
||||||
|
<%= content_tag(:span,row_data.send(field[0]).title,:class=>field[1])%>
|
||||||
|
<% else %>
|
||||||
<%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%>
|
<%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
<% end %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="more">more</div>
|
<div class="more">more</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -2,14 +2,18 @@
|
||||||
<div class="img app-pic">
|
<div class="img app-pic">
|
||||||
<%= image_tag @data.first.send(@widget_image_field)%>
|
<%= image_tag @data.first.send(@widget_image_field)%>
|
||||||
</div>
|
</div>
|
||||||
<ul class="defulat_widget_list">
|
<ul class="defulat_widget_list">
|
||||||
<% @data.each do |row_data| %>
|
<% @data.each do |row_data| %>
|
||||||
<%= content_tag(:li) do %>
|
<%= content_tag(:li) do %>
|
||||||
<% @fields.each do |field|%>
|
<% @fields.each do |field|%>
|
||||||
|
<% if field[0] == "bulletin_category"%>
|
||||||
|
<%= content_tag(:span,row_data.send(field[0]).title,:class=>field[1])%>
|
||||||
|
<% else %>
|
||||||
<%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%>
|
<%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
<% end %>
|
||||||
<div class="more">more</div>
|
</ul>
|
||||||
<% end %>
|
<div class="more">more</div>
|
||||||
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue