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)
|
||||
@fields = @page_part.widget_field
|
||||
|
||||
# binding.pry
|
||||
|
||||
case params[:type]
|
||||
when "typeA"
|
||||
@tag_class = 'defulat_widget_typeA'
|
||||
|
@ -28,8 +26,6 @@ class DefaultWidgetController< OrbitWidgetController
|
|||
render "typeC"
|
||||
end
|
||||
|
||||
|
||||
|
||||
# {"inner"=>"true",
|
||||
# "category_id"=>"false",
|
||||
# "tag_id"=>"",
|
||||
|
@ -41,5 +37,4 @@ class DefaultWidgetController< OrbitWidgetController
|
|||
# "action"=>"default_widget",
|
||||
# "type"=>"typeA"}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -11,8 +11,12 @@
|
|||
<% @data.each do |row_data| %>
|
||||
<tr>
|
||||
<% @fields.each do |field|%>
|
||||
<% 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 %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
<%= content_tag :div,:class=>@tag_class do%>
|
||||
<ul class="defulat_widget_list">
|
||||
|
||||
<% @data.each do |row_data| %>
|
||||
<%= content_tag(:li) do %>
|
||||
<div class="img app-pic">
|
||||
<%= image_tag row_data.send(@widget_image_field)%>
|
||||
|
||||
</div>
|
||||
<div class="wrap">
|
||||
<% @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])%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="more">more</div>
|
||||
<% end %>
|
||||
|
|
|
@ -6,10 +6,14 @@
|
|||
<% @data.each do |row_data| %>
|
||||
<%= content_tag(:li) do %>
|
||||
<% @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])%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="more">more</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue