aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/refinery/blog
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/refinery/blog')
-rw-r--r--app/views/refinery/blog/categories/show.html.erb21
-rw-r--r--app/views/refinery/blog/comment_mailer/notification.html.erb17
-rw-r--r--app/views/refinery/blog/posts/_comment.html.erb10
-rw-r--r--app/views/refinery/blog/posts/_nav.html.erb11
-rw-r--r--app/views/refinery/blog/posts/_post.html.erb31
-rw-r--r--app/views/refinery/blog/posts/archive.html.erb20
-rw-r--r--app/views/refinery/blog/posts/index.html.erb24
-rw-r--r--app/views/refinery/blog/posts/index.rss.builder17
-rw-r--r--app/views/refinery/blog/posts/show.html.erb67
-rw-r--r--app/views/refinery/blog/posts/tagged.html.erb22
-rw-r--r--app/views/refinery/blog/shared/_categories.html.erb10
-rw-r--r--app/views/refinery/blog/shared/_post.html.erb46
-rw-r--r--app/views/refinery/blog/shared/_posts.html.erb10
-rw-r--r--app/views/refinery/blog/shared/_rss_feed.html.erb2
-rw-r--r--app/views/refinery/blog/shared/_tags.html.erb8
15 files changed, 316 insertions, 0 deletions
diff --git a/app/views/refinery/blog/categories/show.html.erb b/app/views/refinery/blog/categories/show.html.erb
new file mode 100644
index 0000000..40444ec
--- /dev/null
+++ b/app/views/refinery/blog/categories/show.html.erb
@@ -0,0 +1,21 @@
+<% content_for :body_content_title, @category.title %>
+
+<% content_for :body_content_left do %>
+ <% if @blog_posts.any? %>
+ <section id="blog_posts">
+ <%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
+ <%= will_paginate @blog_posts %>
+ </section>
+ <% else %>
+ <p>
+ <%= t('.no_posts') %>
+ </p>
+ <% end %>
+<% end %>
+
+<% content_for :body_content_right do %>
+ <%= render :partial => "/blog/shared/categories" %>
+<% end %>
+
+<%= render :partial => "/shared/content_page" %>
+<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
diff --git a/app/views/refinery/blog/comment_mailer/notification.html.erb b/app/views/refinery/blog/comment_mailer/notification.html.erb
new file mode 100644
index 0000000..800f12c
--- /dev/null
+++ b/app/views/refinery/blog/comment_mailer/notification.html.erb
@@ -0,0 +1,17 @@
+<%=raw t('.greeting') %>,
+
+<%=raw t('.you_recieved_new_comment') %>
+
+<%=raw t('.comment_starts') %>
+
+<%=raw t('.from') %>: <%= @comment.name %>
+<%=raw t('.email') %>: <%= @comment.email %>
+<%=raw t('.message') %>:
+<%=simple_format strip_tags(@comment.body) %>
+
+<%=raw t('.comment_ends') %>
+
+<%=raw t('.closing_line') %>,
+<%=raw RefinerySetting[:site_name] %>
+
+<%=raw t('.ps') %>
diff --git a/app/views/refinery/blog/posts/_comment.html.erb b/app/views/refinery/blog/posts/_comment.html.erb
new file mode 100644
index 0000000..5503826
--- /dev/null
+++ b/app/views/refinery/blog/posts/_comment.html.erb
@@ -0,0 +1,10 @@
+<article class='blog_comment_message' id='<%= "comment-#{comment.to_param}" %>'>
+ <%= image_tag comment.avatar_url, :alt => comment.name, :class => 'avatar' %>
+ <%= simple_format auto_link(comment.message.to_s) %>
+ <footer class='blog_comment_author'>
+ <p>
+ <%= t('by', :scope => 'blog.posts.comments', :who => comment.name) %>,
+ <%= t('time_ago', :scope => 'blog.posts.comments', :time => time_ago_in_words(comment.created_at)) %>
+ </p>
+ </footer>
+</article>
diff --git a/app/views/refinery/blog/posts/_nav.html.erb b/app/views/refinery/blog/posts/_nav.html.erb
new file mode 100644
index 0000000..df4b435
--- /dev/null
+++ b/app/views/refinery/blog/posts/_nav.html.erb
@@ -0,0 +1,11 @@
+<nav id="next_prev_article">
+ <% if @blog_post.next.present? -%>
+ <%= link_to (truncate(@blog_post.next.title) + " &#187;").html_safe, @blog_post.next, :class => 'next' %>
+ <% end -%>
+
+ <%= link_to t('blog_home', :scope => 'blog.posts.show'), blog_root_path, :class => 'home' %>
+
+ <% if @blog_post.prev.present? -%>
+ <%= link_to ("&#171; " + truncate(@blog_post.prev.title)).html_safe, @blog_post.prev, :class => 'prev' %>
+ <% end -%>
+</nav><!-- /next_prev_article -->
diff --git a/app/views/refinery/blog/posts/_post.html.erb b/app/views/refinery/blog/posts/_post.html.erb
new file mode 100644
index 0000000..12978d3
--- /dev/null
+++ b/app/views/refinery/blog/posts/_post.html.erb
@@ -0,0 +1,31 @@
+<% 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) %>
diff --git a/app/views/refinery/blog/posts/archive.html.erb b/app/views/refinery/blog/posts/archive.html.erb
new file mode 100644
index 0000000..a2044e8
--- /dev/null
+++ b/app/views/refinery/blog/posts/archive.html.erb
@@ -0,0 +1,20 @@
+<% content_for :body_content_left do %>
+ <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1>
+ <% if @blog_posts.any? %>
+ <section id="blog_posts">
+ <%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
+ </section>
+ <% else %>
+ <p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p>
+ <% end %>
+<% end %>
+
+<% content_for :body_content_right do %>
+ <%= render :partial => "/blog/shared/categories" %>
+ <%= render :partial => "/blog/shared/tags" %>
+ <%= render :partial => "/blog/shared/rss_feed" %>
+ <%= blog_archive_list %>
+<% end %>
+
+<%= render :partial => "/shared/content_page" %>
+<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
diff --git a/app/views/refinery/blog/posts/index.html.erb b/app/views/refinery/blog/posts/index.html.erb
new file mode 100644
index 0000000..8c3801a
--- /dev/null
+++ b/app/views/refinery/blog/posts/index.html.erb
@@ -0,0 +1,24 @@
+<% content_for :body_content_left do %>
+ <%=raw @page[Page.default_parts.first.to_sym] if Page.default_parts.any? %>
+
+ <% if @blog_posts.any? %>
+ <section id="blog_posts">
+ <%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
+ <%= will_paginate @blog_posts %>
+ </section>
+ <% else %>
+ <p><%= t('.no_blog_articles_yet') %></p>
+ <% end %>
+<% end %>
+
+<% content_for :body_content_right do %>
+ <%=raw @page[Page.default_parts.second.to_sym] if Page.default_parts.many? %>
+
+ <%= render :partial => "/blog/shared/categories" %>
+ <%= render :partial => "/blog/shared/tags" %>
+ <%= render :partial => "/blog/shared/rss_feed" %>
+ <%= blog_archive_list %>
+<% end %>
+
+<%= render :partial => "/shared/content_page" %>
+<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
diff --git a/app/views/refinery/blog/posts/index.rss.builder b/app/views/refinery/blog/posts/index.rss.builder
new file mode 100644
index 0000000..51fa4da
--- /dev/null
+++ b/app/views/refinery/blog/posts/index.rss.builder
@@ -0,0 +1,17 @@
+xml.instruct! :xml, :version => "1.0"
+xml.rss :version => "2.0" do
+ xml.channel do
+ xml.title RefinerySetting.find_or_set(:site_name, "Company Name")
+ xml.description RefinerySetting.find_or_set(:site_name, "Company Name") + " Blog Posts"
+ xml.link blog_root_url
+
+ @blog_posts.each do |post|
+ xml.item do
+ xml.title post.title
+ xml.description post.body
+ xml.pubDate post.published_at.to_s(:rfc822)
+ xml.link blog_post_url(post)
+ end
+ end
+ end
+end \ No newline at end of file
diff --git a/app/views/refinery/blog/posts/show.html.erb b/app/views/refinery/blog/posts/show.html.erb
new file mode 100644
index 0000000..cc763a8
--- /dev/null
+++ b/app/views/refinery/blog/posts/show.html.erb
@@ -0,0 +1,67 @@
+<% content_for :body_content_left do %>
+ <div id="show_blog_post">
+ <%= render 'post' %>
+ </div>
+
+ <% 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('none', :scope => 'blog.shared.comments') %>.
+ </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| %>
+ <%= render :partial => "/shared/admin/error_messages",
+ :locals => {
+ :object => f.object,
+ :include_object_name => true
+ } %>
+ <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 %>
+
+<% 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/rss_feed" %>
+ <%= blog_archive_list %>
+<% end %>
+
+<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %>
+
+<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
+<% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %>
+<% content_for :javascripts do %>
+ <%# enable AJAX'd post nav at your own risk until html5 history API implemented. %>
+ <%#= 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? %>
diff --git a/app/views/refinery/blog/posts/tagged.html.erb b/app/views/refinery/blog/posts/tagged.html.erb
new file mode 100644
index 0000000..904150f
--- /dev/null
+++ b/app/views/refinery/blog/posts/tagged.html.erb
@@ -0,0 +1,22 @@
+<% content_for :body_content_title, "#{t('.posts_tagged')} &#8220;#{@tag_name.titleize}&#8221;".html_safe -%>
+
+<% content_for :body_content_left do %>
+ <% if @blog_posts.any? %>
+ <section id="blog_posts">
+ <%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
+ <%= will_paginate @blog_posts %>
+ </section>
+ <% else %>
+ <p><%= t('.no_blog_articles_yet') %></p>
+ <% end %>
+<% end %>
+
+<% content_for :body_content_right do %>
+ <%= render :partial => "/blog/shared/categories" %>
+ <%= render :partial => "/blog/shared/tags" %>
+ <%= render :partial => "/blog/shared/rss_feed" %>
+ <%= blog_archive_list %>
+<% end %>
+
+<%= render :partial => "/shared/content_page" %>
+<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %>
diff --git a/app/views/refinery/blog/shared/_categories.html.erb b/app/views/refinery/blog/shared/_categories.html.erb
new file mode 100644
index 0000000..05cc53f
--- /dev/null
+++ b/app/views/refinery/blog/shared/_categories.html.erb
@@ -0,0 +1,10 @@
+<% if @blog_categories.any? %>
+ <h2><%= t('.title') %></h2>
+ <ul id='categories'>
+ <% @blog_categories.each do |category| %>
+ <li<%= " class='selected'" if @category.present? and @category.id == category.id %>>
+ <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %>
+ </li>
+ <% end %>
+ </ul>
+<% end %> \ No newline at end of file
diff --git a/app/views/refinery/blog/shared/_post.html.erb b/app/views/refinery/blog/shared/_post.html.erb
new file mode 100644
index 0000000..6cda22d
--- /dev/null
+++ b/app/views/refinery/blog/shared/_post.html.erb
@@ -0,0 +1,46 @@
+<% if post.live? %>
+ <article class="blog_post" id="<%= dom_id(post) %>">
+ <header>
+ <h1><%= link_to post.title, blog_post_url(post) %></h1>
+ <section class='details'>
+ <time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'>
+ <%= t('created_at', :scope => 'blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %>
+ </time>
+ <%= "#{t('by', :scope => 'blog.posts.show')} #{post.author.username}" if post.author.present? %>.
+ <% if (categories = post.categories).any? %>
+ <aside class='filed_in'>
+ <%= t('filed_in', :scope => 'blog.posts.show') %>
+ <%=raw categories.collect { |category| link_to category.title, blog_category_url(category) }.to_sentence %>
+ </aside>
+ <% end %>
+ <% if (tags = post.tags).any? %>
+ <aside class='tagged'>
+ <%= t('tagged', :scope => 'blog.posts.show') %>
+ <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %>
+ </aside>
+ <% end %>
+ </section>
+ </header>
+ <section class='clearfix'>
+ <% if blog_post_teaser_enabled? %>
+ <%= blog_post_teaser(post) %>
+ <% else %>
+ <%= post.body.html_safe %>
+ <% end %>
+ </section>
+ <footer>
+ <p>
+ <%= link_to t('read_more', :scope => 'blog.shared.posts'), blog_post_url(post) if blog_post_teaser_enabled? %>
+ </p>
+ <aside class='comment_count'>
+ <% if BlogPost.comments_allowed? %>
+ <% if post.comments.any? %>
+ (<%= pluralize(post.comments.approved.count, t('singular', :scope => 'blog.shared.comments')) %>)
+ <% else %>
+ (<%= t('none', :scope => 'blog.shared.comments') %>)
+ <% end %>
+ <% end %>
+ </aside>
+ </footer>
+ </article>
+<% end %>
diff --git a/app/views/refinery/blog/shared/_posts.html.erb b/app/views/refinery/blog/shared/_posts.html.erb
new file mode 100644
index 0000000..24a8199
--- /dev/null
+++ b/app/views/refinery/blog/shared/_posts.html.erb
@@ -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 %> \ No newline at end of file
diff --git a/app/views/refinery/blog/shared/_rss_feed.html.erb b/app/views/refinery/blog/shared/_rss_feed.html.erb
new file mode 100644
index 0000000..1c2cef7
--- /dev/null
+++ b/app/views/refinery/blog/shared/_rss_feed.html.erb
@@ -0,0 +1,2 @@
+<h2><%= t('.title') %></h2>
+<%= link_to t('.subscribe'), blog_rss_feed_url, :id => "rss_feed_subscribe"%>
diff --git a/app/views/refinery/blog/shared/_tags.html.erb b/app/views/refinery/blog/shared/_tags.html.erb
new file mode 100644
index 0000000..b0b11ee
--- /dev/null
+++ b/app/views/refinery/blog/shared/_tags.html.erb
@@ -0,0 +1,8 @@
+<% if @tags.any? %>
+ <h2><%= t('.title') %></h2>
+ <nav id='tags'>
+ <% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %>
+ <%= link_to tag.name, tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %>
+ <% end %>
+ </nav>
+<% end %> \ No newline at end of file