From 3e8b029c5f489751360d6d2d41e2c6b1a76b6e0e Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Fri, 4 Jan 2013 10:50:08 +0800 Subject: [PATCH] change bulletin object to bulletin title --- app/controllers/default_widget_controller.rb | 5 ----- app/views/default_widget/typeA.html.erb | 6 +++++- app/views/default_widget/typeB.html.erb | 17 ++++++++--------- app/views/default_widget/typeC.html.erb | 18 +++++++++++------- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/app/controllers/default_widget_controller.rb b/app/controllers/default_widget_controller.rb index 77887e8e..e4c80587 100644 --- a/app/controllers/default_widget_controller.rb +++ b/app/controllers/default_widget_controller.rb @@ -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' @@ -27,8 +25,6 @@ class DefaultWidgetController< OrbitWidgetController @tag_class = 'defulat_widget_typeC' render "typeC" end - - # {"inner"=>"true", # "category_id"=>"false", @@ -41,5 +37,4 @@ class DefaultWidgetController< OrbitWidgetController # "action"=>"default_widget", # "type"=>"typeA"} end - end diff --git a/app/views/default_widget/typeA.html.erb b/app/views/default_widget/typeA.html.erb index 22422516..b26bd3bc 100644 --- a/app/views/default_widget/typeA.html.erb +++ b/app/views/default_widget/typeA.html.erb @@ -11,7 +11,11 @@ <% @data.each do |row_data| %> <% @fields.each do |field|%> - <%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%> + <% 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 %> diff --git a/app/views/default_widget/typeB.html.erb b/app/views/default_widget/typeB.html.erb index 8c3cc34e..533518ae 100644 --- a/app/views/default_widget/typeB.html.erb +++ b/app/views/default_widget/typeB.html.erb @@ -1,22 +1,21 @@ <%= content_tag :div,:class=>@tag_class do%>
more
- <% end %> +<% end %> diff --git a/app/views/default_widget/typeC.html.erb b/app/views/default_widget/typeC.html.erb index 4fceefc3..ee384ed3 100644 --- a/app/views/default_widget/typeC.html.erb +++ b/app/views/default_widget/typeC.html.erb @@ -2,14 +2,18 @@
<%= image_tag @data.first.send(@widget_image_field)%>
- +
more
+<% end %>