Skip to content

Commit

Permalink
fixed some layout issues
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcc committed Apr 5, 2009
1 parent 9757e69 commit 0990eba
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion app/controllers/comments_controller.rb
Expand Up @@ -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])
Expand All @@ -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
1 change: 1 addition & 0 deletions app/views/blog_entries/_blog.html.erb
Expand Up @@ -17,4 +17,5 @@
<div style="background-color: #ffffff; margin: 10px; padding: 3px;">
<%= expand_sku(b) %>
</div>
<div style="clear:both;"></div>
<br/>
2 changes: 1 addition & 1 deletion app/views/blog_entries/show.html.erb
Expand Up @@ -26,5 +26,5 @@
</ul>

<br/>
<%= 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 %>
<br/>
2 changes: 1 addition & 1 deletion app/views/shared/_blog_snippet.html.erb
Expand Up @@ -9,7 +9,7 @@
<%= image_tag '/images/blog.jpg', :style => "flow: left;" %>
<ul>
<% BlogEntry.latest.each do |b| %>
<li> <%= link_to b.title, blog_entry_path(b) %>
<li> <%= link_to b.title, blog_entry_path(b) %> </li>
<% end %>
</ul>

Expand Down

0 comments on commit 0990eba

Please sign in to comment.