% # encoding: utf-8 %>
<% if @title %>
<%= @title %>
<% end %>
<% if !@widget_fields.blank? %>
<% if @widget_style == '1' %>
<% elsif @widget_style == '2' %>
<% elsif @widget_style == '3' %>
<% @bulletins.each do |post| %>
-
<%= image_tag(post.image.url) %>
<% @widget_fields.each do |wf| %>
<% if wf[1] == 'title' %>
<%= link_to post.send("#{wf[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %>
<% elsif wf[1] == 'date' %>
<%= display_date(post.send(wf[0])) %>
<% elsif wf[1] == 'category' %>
<%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %>
<% elsif wf[1] == 'text' %>
<%#= post.send("#{wf[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{wf[0]}").html_safe %>
<% elsif wf[1] == 'status' %>
<% if post.is_top? %>
<%= t(:top) %>
<% end %>
<% if post.is_hot? %>
<%= t(:hot) %>
<% end %>
<% elsif wf[1] == 'link' %>
<% elsif wf[1] == 'file' %>
<% elsif wf[1] == 'tag' %>
<% elsif wf[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif wf[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
<% end %>
<% end %>
<% if !@category_id.blank? %>
<%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %>
<% else %>
<%= link_to t('more'), panel_announcement_front_end_bulletins_path() %>
<% end %>
<% elsif @widget_style == '4' %>
<% @bulletins.each do |post| %>
-
<%= image_tag(post.image.url) %>
<% @widget_fields.each do |wf| %>
<% if wf[1] == 'title' %>
<%= link_to post.send("#{wf[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %>
<% elsif wf[1] == 'date' %>
<%= display_date(post.send(wf[0])) %>
<% elsif wf[1] == 'category' %>
<%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %>
<% elsif wf[1] == 'text' %>
<%#= post.send("#{wf[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{wf[0]}").html_safe %>
<% elsif wf[1] == 'status' %>
<% if post.is_top? %>
<%= t(:top) %>
<% end %>
<% if post.is_hot? %>
<%= t(:hot) %>
<% end %>
<% elsif wf[1] == 'link' %>
<% elsif wf[1] == 'file' %>
<% elsif wf[1] == 'tag' %>
<% elsif wf[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif wf[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
<% end %>
<% end %>
<% if !@category_id.blank? %>
<%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %>
<% else %>
<%= link_to t('more'), panel_announcement_front_end_bulletins_path() %>
<% end %>
<% elsif @widget_style == '5' %>
<%= image_tag(@bulletins.first.image.url) %>
<% @bulletins.each do |post| %>
-
<% @widget_fields.each do |wf| %>
<% if wf[1] == 'title' %>
<%= link_to post.send("#{wf[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %>
<% elsif wf[1] == 'date' %>
<%= display_date(post.send(wf[0])) %>
<% elsif wf[1] == 'category' %>
<%= post.send("#{post.class.to_s.underscore}_#{wf[0]}").title rescue nil %>
<% elsif wf[1] == 'text' %>
<%#= post.send("#{wf[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{wf[0]}").html_safe %>
<% elsif wf[1] == 'status' %>
<% if post.is_top? %>
<%= t(:top) %>
<% end %>
<% if post.is_hot? %>
<%= t(:hot) %>
<% end %>
<% elsif wf[1] == 'link' %>
<% elsif wf[1] == 'file' %>
<% elsif wf[1] == 'tag' %>
<% elsif wf[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif wf[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
<% end %>
<% end %>
<% if !@category_id.blank? %>
<%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %>
<% else %>
<%= link_to t('more'), panel_announcement_front_end_bulletins_path() %>
<% end %>
<% end %>
<% end %>