From 0990ebae0d5e66393de37e2899ad85cdeeba3408 Mon Sep 17 00:00:00 2001 From: paulcc Date: Mon, 6 Apr 2009 00:47:12 +0100 Subject: [PATCH] fixed some layout issues --- app/controllers/comments_controller.rb | 9 ++++++++- app/views/blog_entries/_blog.html.erb | 1 + app/views/blog_entries/show.html.erb | 2 +- app/views/shared/_blog_snippet.html.erb | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 4596408..27a4a08 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -3,7 +3,7 @@ class CommentsController < ApplicationController helper BlogEntriesHelper # no comments without login first - before_filter :login_required, :only => [:new,:create] + before_filter :require_user_account, :only => [:new,:create] def new @blog = BlogEntry.find(params[:blog_entry_id]) @@ -29,4 +29,11 @@ def create end end + private + def require_user_account + return if logged_in? + store_location + redirect_to signup_path + end + end diff --git a/app/views/blog_entries/_blog.html.erb b/app/views/blog_entries/_blog.html.erb index 8bfe63d..0101974 100644 --- a/app/views/blog_entries/_blog.html.erb +++ b/app/views/blog_entries/_blog.html.erb @@ -17,4 +17,5 @@
<%= expand_sku(b) %>
+

diff --git a/app/views/blog_entries/show.html.erb b/app/views/blog_entries/show.html.erb index d1eaeaa..0b3751b 100644 --- a/app/views/blog_entries/show.html.erb +++ b/app/views/blog_entries/show.html.erb @@ -26,5 +26,5 @@
-<%= link_to t('submit_a_comment'), new_blog_entry_comment_path(@blog) unless @blog.comments.approved.length < 10 %> +<%= link_to t('submit_a_comment'), new_blog_entry_comment_path(@blog) if @blog.comments.approved.length > 3 %>
diff --git a/app/views/shared/_blog_snippet.html.erb b/app/views/shared/_blog_snippet.html.erb index a38c992..59dcc02 100644 --- a/app/views/shared/_blog_snippet.html.erb +++ b/app/views/shared/_blog_snippet.html.erb @@ -9,7 +9,7 @@ <%= image_tag '/images/blog.jpg', :style => "flow: left;" %>