diff options
Diffstat (limited to 'app/views/blog/posts')
-rw-r--r-- | app/views/blog/posts/_nav.html.erb | 13 | ||||
-rw-r--r-- | app/views/blog/posts/_post.html.erb | 33 | ||||
-rw-r--r-- | app/views/blog/posts/archive.html.erb | 2 | ||||
-rw-r--r-- | app/views/blog/posts/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/blog/posts/show.html.erb | 54 |
5 files changed, 70 insertions, 34 deletions
diff --git a/app/views/blog/posts/_nav.html.erb b/app/views/blog/posts/_nav.html.erb new file mode 100644 index 0000000..309cd64 --- /dev/null +++ b/app/views/blog/posts/_nav.html.erb @@ -0,0 +1,13 @@ +<% if next_or_previous?(@blog_post) -%> + <nav id="next_prev_article"> + <% if @blog_post.next.present? -%> + <%= link_to raw(truncate(@blog_post.next.title) + " »"), @blog_post.next, :class => 'next', :"data-nav-url" => update_blog_nav_path(@blog_post.next) %> + <% end -%> + + <%= link_to 'Blog Home', blog_root_path, :class => 'home' %> + + <% if @blog_post.prev.present? -%> + <%= link_to "« ".html_safe + truncate(@blog_post.prev.title), @blog_post.prev, :class => 'prev', :"data-nav-url" => update_blog_nav_path(@blog_post.prev) %> + <% end -%> + </nav><!-- /next_prev_article --> +<% end -%>
\ No newline at end of file diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb new file mode 100644 index 0000000..3af89a8 --- /dev/null +++ b/app/views/blog/posts/_post.html.erb @@ -0,0 +1,33 @@ +<% 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> + <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 next_or_previous?(@blog_post) -%> + <nav id="next_prev_article"> + <%= render 'nav' %> + </nav><!-- /next_prev_article --> +<% end -%>
\ No newline at end of file diff --git a/app/views/blog/posts/archive.html.erb b/app/views/blog/posts/archive.html.erb index 8283f0a..a5354ab 100644 --- a/app/views/blog/posts/archive.html.erb +++ b/app/views/blog/posts/archive.html.erb @@ -16,4 +16,4 @@ <% end %> <%= render :partial => "/shared/content_page" %> -<% content_for :head, stylesheet_link_tag('refinerycms-blog') %>
\ No newline at end of file +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
\ No newline at end of file diff --git a/app/views/blog/posts/index.html.erb b/app/views/blog/posts/index.html.erb index 9e63ac2..1d054e1 100644 --- a/app/views/blog/posts/index.html.erb +++ b/app/views/blog/posts/index.html.erb @@ -17,4 +17,4 @@ <% end %> <%= render :partial => "/shared/content_page" %> -<% content_for :head, stylesheet_link_tag('refinerycms-blog') %>
\ No newline at end of file +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
\ No newline at end of file diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb index d959956..603a44f 100644 --- a/app/views/blog/posts/show.html.erb +++ b/app/views/blog/posts/show.html.erb @@ -1,36 +1,8 @@ -<% content_for :javascripts 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 %> + <div id="show_blog_post"> + <%= render 'post' %> + </div> - <% 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> @@ -92,4 +64,22 @@ <% end %> <%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %> -<% content_for :head, stylesheet_link_tag('refinerycms-blog') %> + +<% if Refinery.version < '0.9.9' %> + <% content_for :head_libraries, jquery_include_tags(:jquery_ui => false) %> + <% content_for :head do %> + <%= stylesheet_link_tag 'refinerycms-blog' %> + <%= javascript_include_tag('refinerycms-blog') %> + <% if BlogPost::ShareThis.enabled? %> + <script src="http://w.sharethis.com/button/buttons.js"></script> + <script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script> + <% end %> +<% else %> + <% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> + <% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %> + <% content_for :javascripts do %> + <%= javascript_include_tag 'refinerycms-blog' %> + <script src="http://w.sharethis.com/button/buttons.js"></script> + <script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script> + <% end if BlogPost::ShareThis.enabled? %> +<% end %>
\ No newline at end of file |