aboutsummaryrefslogblamecommitdiffstats
path: root/app/views/blog/posts/show.html.erb
blob: f8d4b35674b66e6a486d5fe27376ee91fba135e2 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                       

                                                                    




                                                                    
                                       
                                                 
            




                                                                                                                  
                                                          
                                  



                                                                                                                          
                  
                 
                
             
                                    
 

                                                                
             
            





                                                                    
                


                                                
               























                                                                




                                          









                                                 
           


                                        

                                                     
                                                   
                          

         
                                                                                                    
                                                               
<% content_for :head do %>
  <% if BlogPost::ShareThis.enabled? %>
    <script src="http://w.sharethis.com/button/buttons.js"></script>
    <script>
      stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});
    </script>
  <% end %>
<% end %>

<% content_for :body_content_left do %>
  <article class="blog_post" id="show_blog_post">
    <header>
      <h1><%= @blog_post.title %></h1>
      <details>
        <time datetime="<%= @blog_post.published_at.strftime('%Y-%m-%d') %>" class='posted_at'>
          <%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.        
        </time>
        <% if (categories = @blog_post.categories).any? %>
          <aside class='filed_in'>
            <%= t('.filed_in') %>
            <% categories.each_with_index do |category, index| %>
                <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
            <% end %>
          </aside>
        <% end %>
      </details>
    </header>
    <%= @blog_post.body.html_safe %>

    <% if BlogPost::ShareThis.enabled? %>
      <span class="st_sharethis" displayText="ShareThis"></span>
    <% end %>
  </article>
  <% if BlogPost.comments_allowed? %>
    <aside id="comments">
      <h2><%= t('.comments.title') %></h2>

      <% if (comments = @blog_post.comments.approved).any? %>
        <%= render :partial => "comment", :collection => comments %>
      <% else %>
        <p>
          <%= t('blog.shared.comments.none') %>.
        </p>
      <% end %>

      <% flash.each do |key, value| %>
        <div id='flash' class="flash flash_<%= key %>">
          <%= value %>
        </div>
      <% end %>

      <h2><%= t('.comments.add') %></h2>
      <% form_for [:blog_post, @blog_comment] do |f| %>
        <% if Rails.version < '3.0.0'%>
          <%= f.error_messages %>
        <% else %>
          <%= render :partial => "/shared/admin/error_messages",
                     :locals => {
                       :object => f.object,
                       :include_object_name => true
                     } %>
        <% end %>
        <div class='field'>
          <%= f.label :name %>
          <%= f.text_field :name %>
        </div>
        <div class='field'>
          <%= f.label :email %>
          <% if Rails.version > '3.0.0' %>
            <%= f.email_field :email %>
          <% else %>
            <%= f.text_field :email %>
          <% end %>
        </div>
        <div class='field message_field'>
          <%= f.label :message %>
          <%= f.text_area :message, :rows => 6 %>
        </div>
        <div class='field form-actions'>
          <%= f.submit t('.submit') %>
        </div>
      <% end %>
    </aside>
  <% end %>
<% end %>

<% content_for :body_content_right do %>
  <%= render :partial => "/blog/shared/categories" %>
  <%= render :partial => "/blog/shared/posts" %>
  <%= render :partial => "/blog/shared/rss_feed" %>
  <%= blog_archive_list %>
<% end %>

<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true }  %>
<% content_for :head, stylesheet_link_tag('refinerycms-blog') %>