aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Sak <joe@joesak.com>2010-09-21 22:41:35 -0500
committerJoe Sak <joe@joesak.com>2010-09-21 22:41:35 -0500
commitca2e0b7bc01033d4da944861155a9f840bad9e68 (patch)
tree8c761c70abf903d550565be6f08c586803f59f23
parent9a2906c8251448a13b887786cb16082dbf2cba1f (diff)
downloadrefinerycms-blog-ca2e0b7bc01033d4da944861155a9f840bad9e68.tar.gz
refinerycms-blog-ca2e0b7bc01033d4da944861155a9f840bad9e68.tar.bz2
refinerycms-blog-ca2e0b7bc01033d4da944861155a9f840bad9e68.zip
HTML5'd
-rw-r--r--app/views/blog/posts/index.html.erb4
-rw-r--r--app/views/blog/posts/show.html.erb119
-rw-r--r--app/views/blog/shared/_post.html.erb40
3 files changed, 86 insertions, 77 deletions
diff --git a/app/views/blog/posts/index.html.erb b/app/views/blog/posts/index.html.erb
index 0d5dc20..a90ff2c 100644
--- a/app/views/blog/posts/index.html.erb
+++ b/app/views/blog/posts/index.html.erb
@@ -1,9 +1,9 @@
<% content_for :body_content_left do %>
<%= @page[Page.default_parts.first.to_sym] %>
- <ul id="blog_posts">
+ <section id="blog_posts">
<%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
- </ul>
+ </section>
<% end %>
<% content_for :body_content_right do %>
diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb
index 84b35ca..8124f73 100644
--- a/app/views/blog/posts/show.html.erb
+++ b/app/views/blog/posts/show.html.erb
@@ -1,7 +1,7 @@
<% content_for :head do %>
<% if BlogPost::ShareThis.enabled? %>
- <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
- <script type="text/javascript">
+ <script src="http://w.sharethis.com/button/buttons.js"></script>
+ <script>
stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});
</script>
<% end %>
@@ -10,68 +10,73 @@
<% content_for :body_content_title, @blog_post.title %>
<% content_for :body_content_left do %>
- <p class='posted_at'>
- <%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.
+ <article id="show_blog_post">
+ <header>
+ <p class='posted_at'>
+ <%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.
- <% if (categories = @blog_post.categories).any? %>
- <span 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) %>
+ <% if (categories = @blog_post.categories).any? %>
+ <span 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 %>
+ </span>
<% end %>
- </span>
- <% end %>
- </p>
- <%= @blog_post.body %>
-
- <% if BlogPost::ShareThis.enabled? %>
- <span class="st_sharethis" displayText="ShareThis"></span>
- <% end %>
-
- <% if BlogPost.comments_allowed? %>
- <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 %>
+ </header>
+ <%=raw @blog_post.body %>
- <% flash.each do |key, value| %>
- <div id='flash' class="flash flash_<%= key %>">
- <%= value %>
- </div>
+ <% if BlogPost::ShareThis.enabled? %>
+ <span class="st_sharethis" displayText="ShareThis"></span>
<% end %>
-
- <h2><%= t('.comments.add') %></h2>
- <% form_for [:blog_post, @blog_comment] do |f| %>
- <% if Rails.version < '3.0.0'%>
- <%= f.error_messages %>
+ </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 %>
- <%= render :partial => "/shared/admin/error_messages",
- :locals => {
- :object => f.object,
- :include_object_name => true
- } %>
+ <p>
+ <%= t('blog.shared.comments.none') %>.
+ </p>
<% end %>
- <div class='field'>
- <%= f.label :name %>
- <%= f.text_field :name %>
- </div>
- <div class='field'>
- <%= f.label :email %>
- <%= f.text_field :email %>
- </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 %>
+
+ <% 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 %>
+ <%= f.email_field :email %>
+ </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 %>
diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb
index 46fc23b..1e047ae 100644
--- a/app/views/blog/shared/_post.html.erb
+++ b/app/views/blog/shared/_post.html.erb
@@ -1,24 +1,28 @@
<% if post.live? %>
- <li>
- <h2><%= link_to post.title, blog_post_url(post) %></h2>
- <p class='posted_at'>
- <%= t('blog.shared.posts.created_at', :when => post.published_at.strftime('%d %B %Y')) %>
- </p>
- <div clas='clearfix'>
+ <article class="blog_post" id="<%= dom_id(post) %>">
+ <header>
+ <h1><%= link_to post.title, blog_post_url(post) %></h1>
+ <p class='posted_at'>
+ <%= t('blog.shared.posts.created_at', :when => post.published_at.strftime('%d %B %Y')) %>
+ </p>
+ </header>
+ <section class='clearfix'>
<%= truncate(post.body,
:length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250),
:preserve_html_tags => true) %>
- </div>
- <p>
- <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
+ </section>
+ <footer>
+ <p>
+ <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
- <span class='comment_count'>
- <% if post.comments.any? %>
- (<%= pluralize(post.comments.count, t('blog.shared.comments.singular')) %>)
- <% else %>
- (<%= t('blog.shared.comments.none') %>)
- <% end %>
- </span>
- </p>
- </li>
+ <span class='comment_count'>
+ <% if post.comments.any? %>
+ (<%= pluralize(post.comments.count, t('blog.shared.comments.singular')) %>)
+ <% else %>
+ (<%= t('blog.shared.comments.none') %>)
+ <% end %>
+ </span>
+ </p>
+ </footer>
+ </article>
<% end %> \ No newline at end of file