about summary refs log tree commit diff stats
path: root/app/views/blogs/_blog.html.haml
blob: 1f86ae849f014d3ccae2a7f3c2c1cb508d9bd904 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
%article#blog-post
  %header
    .post-calendar{ class: "post-date-#{(blog.visible_date.year - 2007) % 4 + 1}" }
      %span.post-month= blog.visible_date.strftime("%^b")
      %span.post-day= blog.visible_date.day
    .blog-title
      %h2= link_to_unless_current blog.title, blog
      .post-author= blog.user.login.capitalize
      %ul.post-tag-3
        - blog.tags.each do |tag|
          %li= link_to tag, tag_url(tag.name)
  %blockquote#blog-content.entry-content.bubble.rounded.bottom
    - if short and blog.has_read_more
      = markdown(blog.short_body)
      = link_to "Read more...", blog
    - else
      = markdown(blog.body)
  %cite.bubble
    %strong= blog.user.login.capitalize
    on
    = blog.visible_date.strftime("%B #{blog.visible_date.day.ordinalize}, %Y at %-I:%M:%S%P")
  .post-vote{ id: "blog-vote-section-#{blog.id}" }
    %span.vote-link{ id: "blog-upvote-link-#{blog.id}" }= link_to_unless (not blog.published or blog.already_upvoted?(request.remote_ip)), "👍", upvote_blog_path(blog), remote: true, rel: "nofollow", class: "blog-upvote-link", method: :post
    %span.post-rating{ id: "blog-rating-#{blog.id}" }= blog.upvotes - blog.downvotes
    %span.vote-link{ id: "blog-downvote-link-#{blog.id}" }= link_to_unless (not blog.published or blog.already_downvoted?(request.remote_ip)), "👎", downvote_blog_path(blog), remote: true, rel: "nofollow", class: "blog-downvote-link", method: :post