<% # encoding: utf-8 %> <% if @title %>

<%= @title %>

<% end %> <% if !@widget_fields.blank? %> <% if @widget_style == '1' %>
<% @widget_fields.each do |wf| %> <% end %> <% @posts.each do |post| %> <% @widget_fields.each do |wf| %> <% end %> <% end %>
<%= t("announcement.default_widget.#{wf[0]}") if !wf[0].blank? %>
<% if wf[1] == 'title' %> <%= link_to post.send("#{wf[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("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] == 'img' %>
<%= image_tag(post.send(wf[0]).url) %>
<% 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 %>
<%= link_to t('announcement.more'), panel_announcement_front_end_bulletins_path() %>
<% elsif @widget_style == '2' %>
<% 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 == '3' %>
<% 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' %>
<% 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) %>
<% 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 %>