Sha256: 139fa22c1fc6ed5f6b1e111d82fffef064729d90e316fa88a19d064beaa9af60

Contents?: true

Size: 1.72 KB

Versions: 2

Compression:

Stored size: 1.72 KB

Contents

<%= content_for :data_controls do %>
	<%= link_to "Manage Categories", spud_admin_post_categories_path, :class => 'btn btn-info spud_blog_manage_categories', :title => 'Manage Categories' %>
	<%= link_to "Manage Comments", spud_admin_post_comments_path, :class => 'btn btn-default', :title => 'Manage Comments' %>
	<%= link_to "New Post", new_spud_admin_post_path, :class => "btn btn-primary", :title => "New Post" %>
<% end %>

<%=content_for :detail do %>
	<table class="admin-table">
		<thead>
			<tr>
				<th>Title</th>
				<th>Author</th>
				<th>Published At</th>
				<th>Comments</th>
				<th>&nbsp;</th>
			</tr>
		</thead>
		<tbody>
			<% @posts.each do |post| %>
				<tr>
					<td>
						<%= link_to edit_spud_admin_post_path(post) do %>
							<%=post.title%>
							<%if !post.visible%>
								<span class="badge">Draft</span>
							<%end%>
						<%end%>
					</td>
					<td><%= post.author.try(:full_name) %></td>
					<td><%= link_to(post.published_at.strftime('%m/%d/%Y'), blog_post_path(post.url_name)) %></td>
					<td>
						Approved: <%=link_to post.visible_comments.count, spud_admin_post_post_comments_path(:post_id => post.id) %>
						<br/>
						Spam: <%=link_to post.spam_comments.count, spud_admin_post_post_comments_path(:post_id => post.id) %>
					</td>
					<td align="right">
						<%= link_to spud_admin_post_path(post), :method => :delete, :data => {:confirm => 'Are you sure you want to delete this post?'}, :class => 'btn btn-sm btn-danger' do%>
							<span class="glyphicon glyphicon-trash"></span>
						<%end%>
					</td>
				</tr>
			<%end%>
		</tbody>
	</table>
	<div class="spud_admin_pagination">
		<%= will_paginate @posts %>
	</div>

	<script>
		$(document).ready(spud.admin.post_categories.index);
	</script>
<%end%>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spud_blog-1.0.2 app/views/spud/admin/posts/index.html.erb
spud_blog-1.0.1 app/views/spud/admin/posts/index.html.erb