%= content_for :data_controls do %>
<%= form_tag admin_posts_path, :method => :get, :class => 'form-inline' do %>
<%= link_to "Manage Categories", admin_post_categories_path, :class => 'btn btn-default spud-blog-manage-categories', :title => 'Manage Categories' %>
<% if Spud::Blog.disqus_shortname %>
<%= link_to "Manage Comments", "https://#{Spud::Blog.disqus_shortname}.disqus.com/admin/moderate/#/all", :target => :blank, :class => 'btn btn-default', :title => 'Manage Comments' %>
<% end %>
<%= link_to "New Post", new_admin_post_path, :class => "btn btn-primary", :title => "New Post" %>
<% end %>
<% end %>
<% content_for :detail do %>
Title |
Author |
Published At |
<% if Spud::Blog.disqus_shortname %>
Comments |
<% end %>
|
<% cache @posts do %>
<% @posts.each do |post| %>
<% cache post do %>
<%= link_to post.title, post_path(post.url_name), :target => :blank %>
<% if !post.visible? %>
Draft
<% end %>
|
<%= post.author_name %> |
<%= post.published_at.strftime('%m/%d/%Y') %> |
<% if Spud::Blog.disqus_shortname %>
<%= link_to_disqus_comment_count(post) %>
|
<% end %>
<%= link_to 'Edit', edit_admin_post_path(post), :class => 'btn btn-sm btn-default' %>
<%= link_to 'Delete', admin_post_path(post), :method => :delete, :data => {:confirm => 'Are you sure you want to delete this post?'}, :class => 'btn btn-sm btn-danger' %>
|
<% end %>
<% end %>
<% end %>
<%= will_paginate @posts, :renderer => BootstrapPagination::Rails %>
<% if Spud::Blog.disqus_shortname %>
<%= javascript_include_tag "//#{Spud::Blog.disqus_shortname}.disqus.com/count.js", :id => 'dsq-count-scr', :async => true %>
<% end %>
<%end%>