<%= render :partial => 'sub_menu' %>

<%= "#{t('actions.listing')} #{t('posts')}" %>

<%= image_tag "spinner.gif", :plugin=>"spree", :style => "display:none", :id => 'busy_indicator' %>
<% hook :admin_posts_index_headers do %> <% end %> <% @collection.each do |post| %> <%- locals = {:post => post} -%> <% hook :admin_posts_index_rows, locals do %> <% end %> <% end %>
<%= order @search, :by => :title, :as => t("cms.title") %> <%= order @search, :by => :author, :as => t("cms.author") %> <%= t("cms.tags") %> <%= order @search, :by => :date, :as => t("cms.date") %> <%= hook :admin_posts_index_header_actions %>
<%= link_to h(post.title), [:edit,:admin,post] %> (<%= post.is_active == 1 ? t("cms.published") : t("cms.draft") %>) <%= link_to post.user.display_name, [:admin, post.user] %> <%= post.tag_list %> <%= (post.published_at.blank? ? post.updated_at : post.published_at).strftime("%B %d, %Y at %I:%M%p") %> <% hook :admin_pages_index_row_actions, locals do %> <%= link_to_edit post %>   <%= link_to_delete post %> <% end %>
<%= will_paginate(:previous_label => "« #{t('previous')}", :next_label => "#{t('next')} »") %> <% content_for :sidebar do %> <% form_for @search do |f| %>

<%= t(:search) %>

<%- locals = {:f => f} -%> <% hook :admin_posts_index_search, locals do %>


<%= f.text_field :title_contains, :size => 15 %>


<%= f.unobtrusive_date_text_picker :published_at_after %>
<%= f.unobtrusive_date_text_picker :published_at_before %>


<%= f.select :user_id_equals, User.all.collect {|r| [ r.display_name, r.id]} %>

<%= f.check_box :is_active, {:style => "vertical-align:middle;"}, "1", "" %>

<% end %> <% hook :admin_posts_index_search_buttons, locals do %>

<%= button t("search") %>

<% end %>
<% end %> <% end %>