From 6212e60f9e4d144f9a136f6c82b33abd47ddb237 Mon Sep 17 00:00:00 2001 From: Jamie Winsor Date: Fri, 2 Sep 2011 16:01:58 -0700 Subject: index action of blog post controller now caches and sweeps on changes fix various views which were broken and untested with rails-3-1 upgrade add request spec tests for admin blog comments Factory is now FactoryGirl Fix multiple issues around listing unmoderated comments use cleaner definitions to set per_page willpaginate attribute on models update all paginate calls to use new arel representation reorganize filter sections to be located at top of controller modify uncategorized class method to activerecord scope and perform a left outer join instead of iterate through an array to find uncategorized posts move request specs into their proper places update guardfile to ensure that request specs get run when their respective controllers are modified Fix show action for AdminBlogComments and added test Fix redirection link after approving or rejecting a comment --- app/views/refinery/admin/blog/comments/_comment.html.erb | 8 ++++---- .../refinery/admin/blog/comments/_sortable_list.html.erb | 2 +- app/views/refinery/admin/blog/comments/index.html.erb | 12 ++++++------ app/views/refinery/admin/blog/comments/show.html.erb | 8 ++++---- .../admin/blog/settings/notification_recipients.html.erb | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) (limited to 'app/views/refinery') diff --git a/app/views/refinery/admin/blog/comments/_comment.html.erb b/app/views/refinery/admin/blog/comments/_comment.html.erb index 547b9e4..f5eba4d 100644 --- a/app/views/refinery/admin/blog/comments/_comment.html.erb +++ b/app/views/refinery/admin/blog/comments/_comment.html.erb @@ -5,16 +5,16 @@ <%= link_to refinery_icon_tag("application_go.png"), - blog_post_url(comment.post, :anchor => "comment-#{comment.to_param}"), + main_app.blog_post_path(comment.post, :anchor => "comment-#{comment.to_param}"), :title => t('.view_live_html'), :target => "_blank" unless comment.unmoderated? %> - <%= link_to refinery_icon_tag('zoom.png'), admin_blog_comment_path(comment), + <%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_admin_blog_comment_path(comment), :title => t('.read') %> <%= link_to refinery_icon_tag("cross.png"), - rejected_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + main_app.rejected_refinery_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), :title => t('.reject') unless comment.rejected? %> <%= link_to refinery_icon_tag("tick.png"), - approved_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + main_app.approved_refinery_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), :title => t('.approve') unless comment.approved? %> diff --git a/app/views/refinery/admin/blog/comments/_sortable_list.html.erb b/app/views/refinery/admin/blog/comments/_sortable_list.html.erb index e141dee..f781ba1 100644 --- a/app/views/refinery/admin/blog/comments/_sortable_list.html.erb +++ b/app/views/refinery/admin/blog/comments/_sortable_list.html.erb @@ -1,7 +1,7 @@ -<%= render :partial => "/shared/admin/sortable_list", +<%= render :partial => "/refinery/admin/sortable_list", :locals => { :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) } %> diff --git a/app/views/refinery/admin/blog/comments/index.html.erb b/app/views/refinery/admin/blog/comments/index.html.erb index bf2be9c..059ef59 100644 --- a/app/views/refinery/admin/blog/comments/index.html.erb +++ b/app/views/refinery/admin/blog/comments/index.html.erb @@ -1,30 +1,30 @@ -<%= render :partial => '/admin/blog/submenu' %> +<%= render :partial => '/refinery/admin/blog/submenu' %>
<% if searching? %>

<%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %>

<% if @blog_comments.any? %> - <%=# will_paginate @blog_comments %> + <%= will_paginate @blog_comments %> - <%=# will_paginate @blog_comments %> + <%= will_paginate @blog_comments %> <% else %>

<%= t('search_no_results', :scope => 'admin') %>

<% end %> <% else %> <% if @blog_comments.any? %> - <%=# will_paginate @blog_comments %> + <%= will_paginate @blog_comments %> <%= render :partial => "sortable_list" %> - <%=# will_paginate @blog_comments %> + <%= will_paginate @blog_comments %> <% else %>

<%= t('.no_items_yet', - :type => t(action_name.gsub('index', 'new'), :scope => 'admin.blog.submenu.comments').downcase) %> + :type => action_name.gsub('index', 'new')).downcase %>

<% end %> <% end %> diff --git a/app/views/refinery/admin/blog/comments/show.html.erb b/app/views/refinery/admin/blog/comments/show.html.erb index 2e72eb0..3dc50ff 100644 --- a/app/views/refinery/admin/blog/comments/show.html.erb +++ b/app/views/refinery/admin/blog/comments/show.html.erb @@ -6,14 +6,14 @@

<%= t('.actions') %>

@@ -27,7 +27,7 @@ <%= link_to @blog_comment.post.title, - blog_post_url(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), + main_app.blog_post_path(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), :target => '_blank' %> diff --git a/app/views/refinery/admin/blog/settings/notification_recipients.html.erb b/app/views/refinery/admin/blog/settings/notification_recipients.html.erb index 41e7f2d..d321ded 100644 --- a/app/views/refinery/admin/blog/settings/notification_recipients.html.erb +++ b/app/views/refinery/admin/blog/settings/notification_recipients.html.erb @@ -14,7 +14,7 @@ <%= t('.example') %>

- <%= render :partial => "/shared/admin/form_actions", + <%= render :partial => "/refinery/admin/form_actions", :locals => { :f => nil, :continue_editing => false, -- cgit v1.2.3