Rename posts partial to related posts
This commit is contained in:
parent
8ca270774f
commit
f3d32c1ac5
3 changed files with 44 additions and 34 deletions
|
@ -1,31 +0,0 @@
|
|||
<% flash.each do |key, value| %>
|
||||
<div id='flash' class="flash flash_<%= key %>">
|
||||
<%= value %>
|
||||
</div>
|
||||
<% end %>
|
||||
<article id="blog_post">
|
||||
<header>
|
||||
<h1><%= @blog_post.title %></h1>
|
||||
<section class='details'>
|
||||
<time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'>
|
||||
<%= t('created_at', :scope => 'blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %>
|
||||
</time>
|
||||
<%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>.
|
||||
<% if (categories = @blog_post.categories).any? %>
|
||||
<aside class='filed_in'>
|
||||
<%= t('filed_in', :scope => 'blog.posts.show') %>
|
||||
<% categories.each_with_index do |category, index| %>
|
||||
<%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
|
||||
<% end %>
|
||||
</aside>
|
||||
<% end %>
|
||||
</section>
|
||||
</header>
|
||||
<%= @blog_post.body.html_safe %>
|
||||
|
||||
<% if BlogPost::ShareThis.enabled? %>
|
||||
<span class="st_sharethis" displayText="ShareThis"></span>
|
||||
<% end %>
|
||||
</article>
|
||||
<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%>
|
||||
<%= render 'nav' if next_or_previous?(@blog_post) %>
|
|
@ -1,6 +1,37 @@
|
|||
<% content_for :body_content_left do %>
|
||||
<div id="show_blog_post">
|
||||
<%= render 'post' %>
|
||||
<% flash.each do |key, value| %>
|
||||
<div id='flash' class="flash flash_<%= key %>">
|
||||
<%= value %>
|
||||
</div>
|
||||
<% end %>
|
||||
<article id="blog_post">
|
||||
<header>
|
||||
<h1><%= @blog_post.title %></h1>
|
||||
<section class='details'>
|
||||
<time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'>
|
||||
<%= t('created_at', :scope => 'blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %>
|
||||
</time>
|
||||
<%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>.
|
||||
<% if (categories = @blog_post.categories).any? %>
|
||||
<aside class='filed_in'>
|
||||
<%= t('filed_in', :scope => 'blog.posts.show') %>
|
||||
<% categories.each_with_index do |category, index| %>
|
||||
<%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
|
||||
<% end %>
|
||||
</aside>
|
||||
<% end %>
|
||||
</section>
|
||||
</header>
|
||||
<%= @blog_post.body.html_safe %>
|
||||
|
||||
<% if BlogPost::ShareThis.enabled? %>
|
||||
<span class="st_sharethis" displayText="ShareThis"></span>
|
||||
<% end %>
|
||||
</article>
|
||||
<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%>
|
||||
<%= render 'nav' if next_or_previous?(@blog_post) %>
|
||||
|
||||
</div>
|
||||
|
||||
<% if BlogPost.comments_allowed? %>
|
||||
|
@ -50,9 +81,9 @@
|
|||
<% content_for :body_content_right do %>
|
||||
<%= render :partial => "/blog/shared/categories" %>
|
||||
<%= render :partial => "/blog/shared/tags" %>
|
||||
<%= render :partial => "/blog/shared/posts" %>
|
||||
<%= render :partial => "/blog/shared/related_posts" %>
|
||||
<%= render :partial => "/blog/shared/rss_feed" %>
|
||||
<%= blog_archive_list %>
|
||||
<%= render :partial => "/blog/shared/archive_list" %>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %>
|
||||
|
|
10
app/views/blog/shared/_related_posts.html.erb
Normal file
10
app/views/blog/shared/_related_posts.html.erb
Normal file
|
@ -0,0 +1,10 @@
|
|||
<% if @blog_posts.many? %>
|
||||
<h2><%= t('.other') %></h2>
|
||||
<ul id="blog_posts">
|
||||
<% @blog_posts.each do |blog_post| %>
|
||||
<li class='clearfix'>
|
||||
<%= link_to blog_post.title, blog_post_url(blog_post) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue