aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/refinery/blog/blog_controller.rb2
-rw-r--r--app/controllers/refinery/blog/posts_controller.rb2
-rw-r--r--app/models/refinery/blog/post.rb1
-rw-r--r--app/views/refinery/blog/posts/_comments.html.erb59
-rw-r--r--app/views/refinery/blog/posts/show.html.erb4
-rw-r--r--app/views/refinery/blog/shared/_post.html.erb14
-rw-r--r--app/views/refinery/blog/shared/_rss_feed.html.erb2
7 files changed, 40 insertions, 44 deletions
diff --git a/app/controllers/refinery/blog/blog_controller.rb b/app/controllers/refinery/blog/blog_controller.rb
index 54a8b03..6327199 100644
--- a/app/controllers/refinery/blog/blog_controller.rb
+++ b/app/controllers/refinery/blog/blog_controller.rb
@@ -10,7 +10,7 @@ module Refinery
protected
def find_page
- @page = Refinery::Page.find_by_link_url("/blog")
+ @page = Refinery::Page.find_by_link_url(Refinery::Blog.page_url)
end
end
end
diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb
index b04000b..6c9049d 100644
--- a/app/controllers/refinery/blog/posts_controller.rb
+++ b/app/controllers/refinery/blog/posts_controller.rb
@@ -71,7 +71,7 @@ module Refinery
def tagged
@tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
@tag_name = @tag.name
- @posts = Post.tagged_with(@tag_name).page(params[:page])
+ @posts = Post.tagged_with(@tag_name).with_globalize.page(params[:page])
end
protected
diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb
index 9df7aa3..70c7861 100644
--- a/app/models/refinery/blog/post.rb
+++ b/app/models/refinery/blog/post.rb
@@ -26,6 +26,7 @@ module Refinery
validates :title, :presence => true, :uniqueness => true
validates :body, :presence => true
+ validates :published_at, :author, :presence => true
validates :source_url, :url => { :if => 'Refinery::Blog.validate_source_url',
:update => true,
diff --git a/app/views/refinery/blog/posts/_comments.html.erb b/app/views/refinery/blog/posts/_comments.html.erb
index 8415971..daccd78 100644
--- a/app/views/refinery/blog/posts/_comments.html.erb
+++ b/app/views/refinery/blog/posts/_comments.html.erb
@@ -1,38 +1,37 @@
<aside id="comments">
- <h2><%= t('title', :scope => 'refinery.blog.posts.show.comments') %></h2>
<% if (comments = @post.comments.approved).any? %>
+ <h2><%= t('title', :scope => 'refinery.blog.posts.show.comments') %></h2>
<%= render :partial => "comment", :collection => comments %>
- <% else %>
- <p>
- <%= t('none', :scope => 'refinery.blog.shared.comments') %>.
- </p>
<% end %>
- <% flash.each do |key, value| %>
- <div id='flash' class="flash flash_<%= key %>">
- <%= value %>
- </div>
- <% end %>
+ <% if Refinery::Blog::Post.comments_allowed? %>
+
+ <% flash.each do |key, value| %>
+ <div id='flash' class="flash flash_<%= key %>">
+ <%= value %>
+ </div>
+ <% end %>
- <h2><%= t('add', :scope => 'refinery.blog.posts.show.comments') %></h2>
- <%= form_for [refinery, :blog, @comment] do |f| %>
- <%= render "/refinery/admin/error_messages",
- :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', :scope => 'refinery.blog.posts.show') %>
- </div>
+ <h2><%= t('add', :scope => 'refinery.blog.posts.show.comments') %></h2>
+ <%= form_for [refinery, :blog, @comment] do |f| %>
+ <%= render "/refinery/admin/error_messages",
+ :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', :scope => 'refinery.blog.posts.show') %>
+ </div>
+ <% end %>
<% end %>
</aside>
diff --git a/app/views/refinery/blog/posts/show.html.erb b/app/views/refinery/blog/posts/show.html.erb
index bc9b203..f04ae0b 100644
--- a/app/views/refinery/blog/posts/show.html.erb
+++ b/app/views/refinery/blog/posts/show.html.erb
@@ -3,9 +3,7 @@
<%= render 'post' %>
</div>
- <% if Refinery::Blog::Post.comments_allowed? %>
- <%= render 'comments'%>
- <% end %>
+ <%= render 'comments' %>
<% end %>
<%= render '/refinery/blog/shared/body_content_right' %>
diff --git a/app/views/refinery/blog/shared/_post.html.erb b/app/views/refinery/blog/shared/_post.html.erb
index 40ae70b..532d48f 100644
--- a/app/views/refinery/blog/shared/_post.html.erb
+++ b/app/views/refinery/blog/shared/_post.html.erb
@@ -34,15 +34,11 @@
<%= link_to t('read_more', :scope => 'refinery.blog.shared.posts'), refinery.blog_post_path(post) %>
<% end %>
</p>
- <aside class='comment_count'>
- <% if Refinery::Blog::Post.comments_allowed? %>
- <% if post.comments.any? %>
- (<%= pluralize(post.comments.approved.count, t('singular', :scope => 'refinery.blog.shared.comments')) %>)
- <% else %>
- (<%= t('none', :scope => 'refinery.blog.shared.comments') %>)
- <% end %>
- <% end %>
- </aside>
+ <% if Refinery::Blog::Post.comments_allowed? %>
+ <aside class='comment_count'>
+ <%= link_to "#{t('title', :scope => 'refinery.blog.posts.show.comments')} (#{post.comments.approved.count})", refinery.blog_post_path(post) << '#comments' %>
+ </aside>
+ <% end %>
</footer>
</article>
<% end %>
diff --git a/app/views/refinery/blog/shared/_rss_feed.html.erb b/app/views/refinery/blog/shared/_rss_feed.html.erb
index 27ddf23..20979b4 100644
--- a/app/views/refinery/blog/shared/_rss_feed.html.erb
+++ b/app/views/refinery/blog/shared/_rss_feed.html.erb
@@ -1,2 +1,4 @@
<h2><%= t('.title') %></h2>
<%= link_to t('.subscribe'), refinery.blog_rss_feed_path, :id => "rss_feed_subscribe"%>
+
+<% content_for :meta, auto_discovery_link_tag(:atom, refinery.blog_rss_feed_url, :title => 'RSS Feed') -%>