app/views/almanac/posts/_post.html.haml in almanac-0.4.5 vs app/views/almanac/posts/_post.html.haml in almanac-0.5.0
- old
+ new
@@ -1,8 +1,8 @@
.well.post
%h4
- = link_to (@post.title.nil? or @post.title.empty?) ? "No Title" : @post.title, @post
+ = link_to (@post.title.nil? or @post.title.empty?) ? "No Title" : @post.title, (@post.published) ? post_path(@post.slug) : draft_path(@post.id)
- if (action_name == "index" or action_name == "tag") and !(@post.excerpt.nil? or @post.excerpt.empty?)
.content
= @markdown_parser.markdown_to_html(@post.excerpt).html_safe
%p
= link_to "Continue reading...", @post
@@ -15,14 +15,14 @@
= succeed (index < @post.tag_list.count - 1) ? " " : "" do
%a{:href => tag_path(tag), :class => "label"}>= tag
%hr.gradient-black
.actions
- if @post.published
- = link_to "#{post_path(@post)}#comments" do
+ = link_to "#{post_path(@post.slug)}#comments" do
%i.icon-comment.icon
- = link_to "http://twitter.com/share?url=#{post_url(@post)}#{"&via="+@blog.twitter unless @blog.twitter.empty?}&text=#{@post.title}", :target => "_blank", :class => "popup" do
+ = link_to "http://twitter.com/share?url=#{post_url(@post.slug)}#{"&via="+@blog.twitter unless @blog.twitter.empty?}&text=#{@post.title}", :target => "_blank", :class => "popup" do
%i.icon-retweet.icon
- = link_to "http://www.facebook.com/share.php?u=#{post_url(@post)}", :target => "_blank", :class => "popup" do
+ = link_to "http://www.facebook.com/share.php?u=#{post_url(@post.slug)}", :target => "_blank", :class => "popup" do
%i.icon-thumbs-up.icon
- if can? :edit, @post
= link_to edit_post_path(@post), :class => "" do
%i.icon-edit.icon
\ No newline at end of file