diff options
author | Simon Hambly <simon.hambly@unclouded.co.uk> | 2011-02-20 22:11:45 +0000 |
---|---|---|
committer | Simon Hambly <simon.hambly@unclouded.co.uk> | 2011-02-20 22:11:45 +0000 |
commit | 8c01bcece45b0c132c595e5940ebcacc52fafaad (patch) | |
tree | 3db9555942e26328a0724503878ae6644401beff /app | |
parent | 6fda9d4fa747310b9b6037987ec27f46c438fb10 (diff) | |
download | refinerycms-blog-8c01bcece45b0c132c595e5940ebcacc52fafaad.tar.gz refinerycms-blog-8c01bcece45b0c132c595e5940ebcacc52fafaad.tar.bz2 refinerycms-blog-8c01bcece45b0c132c595e5940ebcacc52fafaad.zip |
tidy up views, removing reference to comments when comments disable
Diffstat (limited to 'app')
-rw-r--r-- | app/views/admin/blog/_submenu.html.erb | 49 | ||||
-rw-r--r-- | app/views/blog/posts/show.html.erb | 1 | ||||
-rw-r--r-- | app/views/blog/shared/_post.html.erb | 10 |
3 files changed, 31 insertions, 29 deletions
diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb index e5343e1..f7b95dd 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/admin/blog/_submenu.html.erb @@ -26,30 +26,31 @@ :class => 'page_add_icon' %> </li> </ul> - - <ul class='collapsible_menu'> - <li> - <% if BlogComment.unmoderated.any? %> - <% title = t('.comments.title_with_count', :new_count => BlogComment.unmoderated.size) %> - <% else %> - <% title = t('.comments.title') %> - <% end %> - <%= link_to title, '#', - :class => 'comments_icon' %> - </li> - <li> - <%= link_to t('.comments.new'), admin_blog_comments_path, - :class => 'comment_icon' %> - </li> - <li> - <%= link_to t('.comments.approved'), approved_admin_blog_comments_path, - :class => 'comment_tick_icon' %> - </li> - <li> - <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path, - :class => 'comment_cross_icon' %> - </li> - </ul> + <% if BlogPost.comments_allowed? %> + <ul class='collapsible_menu'> + <li> + <% if BlogComment.unmoderated.any? %> + <% title = t('.comments.title_with_count', :new_count => BlogComment.unmoderated.size) %> + <% else %> + <% title = t('.comments.title') %> + <% end %> + <%= link_to title, '#', + :class => 'comments_icon' %> + </li> + <li> + <%= link_to t('.comments.new'), admin_blog_comments_path, + :class => 'comment_icon' %> + </li> + <li> + <%= link_to t('.comments.approved'), approved_admin_blog_comments_path, + :class => 'comment_tick_icon' %> + </li> + <li> + <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path, + :class => 'comment_cross_icon' %> + </li> + </ul> + <% end %> <ul class='collapsible_menu'> <li> diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb index 5ac4c76..48ca0b8 100644 --- a/app/views/blog/posts/show.html.erb +++ b/app/views/blog/posts/show.html.erb @@ -6,7 +6,6 @@ <% 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 %> diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb index 16483a5..2bc71e0 100644 --- a/app/views/blog/shared/_post.html.erb +++ b/app/views/blog/shared/_post.html.erb @@ -26,10 +26,12 @@ <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %> <aside class='comment_count'> - <% if post.comments.any? %> - (<%= pluralize(post.comments.approved.count, t('blog.shared.comments.singular')) %>) - <% else %> - (<%= t('blog.shared.comments.none') %>) + <% if BlogPost.comments_allowed? %> + <% if post.comments.any? %> + (<%= pluralize(post.comments.approved.count, t('blog.shared.comments.singular')) %>) + <% else %> + (<%= t('blog.shared.comments.none') %>) + <% end %> <% end %> </aside> </p> |