Skip to content

Instantly share code, notes, and snippets.

@renaehodgkins
Created November 15, 2011 18:56
Show Gist options
  • Save renaehodgkins/1367970 to your computer and use it in GitHub Desktop.
Save renaehodgkins/1367970 to your computer and use it in GitHub Desktop.
admin post
<div class='post<%= " post-#{post.blog.name}" rescue nil %>'>
<p class='title'><%= @preview ? post.title : link_to(post.title, post_link(post, blog)) %></p>
<div class='meta'>
<span class='author'><%= post.user.name || post.user.login %></span> <span class='date_wrap'>on <span class='publish_date'><%= post.published_on.strftime("%b. %d") %></span></span>
<div class='clearfix'></div>
</div>
<% if current_user && @preview %>
<div class="admin_links">
<%= link_to 'Edit this post', edit_admin_post_path(post), :class => 'edit_post' %>
<%= link_to 'Delete this post', admin_post_path(post), :method => :delete,
:confirm => "Are you sure you want to delete this post?",
:class => 'delete_post' %>
</div>
<% end %>
</div>
<hr/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment