aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/refinery/blog/posts/_post.html.erb
blob: 9811dd28e7c261ca55c15febe9acf1b55b295dc2 (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
26
27
28
29
30
31
32
33
34
35
36
37
<% flash.each do |key, value| %>
 <div id='flash' class="flash flash_<%= key %>">
   <%= value %>
 </div>
<% end %>
<article id="blog_post">
  <header>
    <h1><%= @post.title %></h1>
    <section class='details'>
      <time datetime="<%=l @post.published_at.to_date, :format => :default %>" class='posted_at'>
        <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(@post.published_at.to_date, :format => :short)) %>
      </time>
      <%= content_tag(:div, "#{t('by', :scope => 'refinery.blog.posts.show')} #{@post.author.username}", :class => "blog_author") if @post.author.present? %>
      <% if @post.source_url.present? %>
        <div class='blog_source'>
          <%= "#{t('source', :scope => 'refinery.blog.posts.show')}: " %>
          <%= link_to (@post.source_url_title.blank? ? @post.source_url : @post.source_url_title), @post.source_url %>
        </div>
      <% end %>
      <% if (categories = @post.categories).any? %>
        <aside class='filed_in'>
          <%= t('filed_in', :scope => 'refinery.blog.posts.show') %>
          <% categories.each_with_index do |category, index| %>
            <%= link_to category.title, refinery.blog_category_path(category) -%><%= ',' if index < ((categories.length) - 1) %>
          <% end %>
        </aside>
      <% end %>
    </section>
  </header>
  <%= @post.body.html_safe %>

  <% if Refinery::Blog::Post::ShareThis.enabled? %>
    <span class="st_sharethis" displayText="ShareThis"></span>
  <% end %>
</article>
<%= render '/refinery/draft_page_message' unless @post.nil? or @post.live? -%>
<%= render 'nav' if next_or_previous?(@post) %>