<% # encoding: utf-8 %>

<%= flash_messages %>

<% if @current_category %>
	<h1 class="h1"><%= @current_category.title %></h1>
<% else %>
	<h1 class="h1"><%= t('announcement.announcement') %></h1>
<% end %>


<table class="table table-bordered">
  <tr>
	<th><%= t('announcement.bulletin.category') %></th>
	<th><%= t('announcement.bulletin.title') %></th>
	<th><%= t('announcement.bulletin.postdate') %></th>
  </tr>
    <% if @bulletins.blank? and !params[:search_query].blank? %>
      <%=render :partial => 'shared/search_not_found'  %>
      <% elsif  !params[:search_query].blank?  %>
        <%= t("search.result_get",:search_word => params[:search_query],:item_num=>@bulletins.count) %>
     <% end %>
<% @bulletins.each do |post| %>
  <tr>
	<td><%= (post.bulletin_category.title rescue nil ) if !params[:search_query].blank? %></td>
	<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
	<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
	</td>
	<td><%= display_date_time(post.postdate) %></td>
  </tr>
  
<% end %>

</table>

<%= paginate @bulletins, :param_name => :page_main, :params => {:inner => 'false'} %>

