change bulletin object to bulletin title

This commit is contained in:
Rueshyna 2013-01-04 10:50:08 +08:00
parent a0868a05ac
commit 3e8b029c5f
4 changed files with 24 additions and 22 deletions

View File

@ -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

View File

@ -11,7 +11,11 @@
<% @data.each do |row_data| %>
<tr>
<% @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 %>
</tr>
<% end %>

View File

@ -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|%>
<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 %>
</div>
<% end %>
</div>
<% end %>
<% end %>
</ul>
<div class="more">more</div>
<% end %>
<% end %>

View File

@ -2,14 +2,18 @@
<div class="img app-pic">
<%= image_tag @data.first.send(@widget_image_field)%>
</div>
<ul class="defulat_widget_list">
<% @data.each do |row_data| %>
<%= content_tag(:li) do %>
<% @fields.each do |field|%>
<ul class="defulat_widget_list">
<% @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 %>
</ul>
<div class="more">more</div>
<% end %>
<% end %>
</ul>
<div class="more">more</div>
<% end %>