Permalink
Browse files

Merge branch 'edge' into eksatx/TRY-pages/master

  • Loading branch information...
2 parents a7a736f + c295146 commit ce994e23794346f86fdfc5ea29a1a51a36b7096e @bborn bborn committed Sep 15, 2009
@@ -76,15 +76,16 @@ def new
def create
@commentable = comment_type.constantize.find(comment_id)
+
@comment = Comment.new(params[:comment])
- @comment.recipient = @commentable.owner
+ @comment.commentable = @commentable
+ @comment.recipient = @commentable.owner
@comment.user_id = current_user.id if current_user
@comment.author_ip = request.remote_ip #save the ip address for everyone, just because
respond_to do |format|
if (logged_in? || verify_recaptcha(@comment)) && @comment.save
- @commentable.add_comment @comment
@comment.send_notifications
flash.now[:notice] = :comment_was_successfully_created.l
@@ -314,7 +314,7 @@ def welcome_complete
def forgot_password
return unless request.post?
- @user = User.find_by_email(params[:email])
+ @user = User.active.find_by_email(params[:email])
if @user && @user.reset_password
UserNotifier.deliver_reset_password(@user)
@user.save
@@ -328,7 +328,7 @@ def forgot_password
def forgot_username
return unless request.post?
- if @user = User.find_by_email(params[:email])
+ if @user = User.active.find_by_email(params[:email])
UserNotifier.deliver_forgot_username(@user)
redirect_to login_url
flash[:info] = :your_username_was_emailed_to_you.l
@@ -5,7 +5,7 @@ class Comment < ActiveRecord::Base
belongs_to :recipient, :class_name => "User", :foreign_key => "recipient_id"
validates_presence_of :comment
- # validates_presence_of :recipient
+ validates_presence_of :commentable_id, :commentable_type
validates_length_of :comment, :maximum => 2000
@@ -30,7 +30,7 @@
= f.text_field :author_email, :size => 35
%br
%label
- =f.check_box :notify_by_email
+ =f.check_box :notify_by_email, :style => 'width: 10px;'
=:notify_me_of_follow_ups_via_email.l
%label{"for"=>"comment[author_url"}
@@ -68,6 +68,9 @@
advertise '/advertise', :controller => 'base', :action => 'advertise'
css_help '/css_help', :controller => 'base', :action => 'css_help'
+about '/about', :controller => 'base', :action => 'about'
+faq '/faq', :controller => 'base', :action => 'faq'
+
edit_account_from_email '/account/edit', :controller => 'users', :action => 'edit_account'
View
@@ -556,7 +556,7 @@
#en: sorry_there_was_an_error_requesting_friendship: Sorry, there was an error requesting friendship.
#en: sorry_there_was_an_error_uploading_the_photo: Sorry, there was an error uploading the photo.
#en: sorry_we_dont_have_any_pros_in_this_skill_category_yet: Sorry, we don't have any pros in this skill category yet.
-#en: sorry_we_dont_recognize_that_email_address: Sorry. We don't recognize that email address.
+#en: sorry_we_dont_recognize_that_email_address: "Sorry. That e-mail address is not associated with an active account. Are you sure you typed it correctly? Have you signed up and activated your account?"
#en: spread_the_word: Spread the word
#en: start_date: Start date
#en: start_time: Start time
View
@@ -1129,8 +1129,8 @@ en:
sorry_there_was_an_error_uploading_the_photo: "Sorry, there was an error uploading the photo."
#en: sorry_we_dont_have_any_pros_in_this_skill_category_yet: "Sorry, we don't have any pros in this skill category yet."
sorry_we_dont_have_any_pros_in_this_skill_category_yet: "Sorry, we don't have any pros in this skill category yet."
- #en: sorry_we_dont_recognize_that_email_address: "Sorry. We don't recognize that email address."
- sorry_we_dont_recognize_that_email_address: "Sorry. We don't recognize that email address."
+ #en: sorry_we_dont_recognize_that_email_address: "Sorry. That e-mail address is not associated with an active account. Are you sure you typed it correctly? Have you signed up and activated your account?"
+ sorry_we_dont_recognize_that_email_address: "Sorry. That e-mail address is not associated with an active account. Are you sure you typed it correctly? Have you signed up and activated your account?"
#en: spread_the_word: Spread the word
spread_the_word: Spread the word
#en: start_date: Start date
@@ -3,7 +3,8 @@
ActiveRecord::Base.send :include, WhiteListHelper
ActiveRecord::Base.class_eval do
- include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper
+ include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper, ActionView::Helpers::UrlHelper
+
def self.format_attribute(attr_name)
class << self; include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper; end
define_method(:body) { read_attribute attr_name }
@@ -185,8 +185,8 @@ function FileProgress(fileObj, target_id) {
FadeIn(this.fileProgressWrapper, 0);
} else {
- this.fileProgressElement = this.fileProgressWrapper.down('div');
- this.fileProgressElement.childNodes[1].firstChild.nodeValue = fileObj.name;
+ this.fileProgressElement = $(this.fileProgressWrapper).down('div');
+ this.fileProgressElement.childNodes[1].firstChild.nodeValue = fileObj.name;
}
this.height = this.fileProgressWrapper.offsetHeight;
@@ -1,7 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
class CommentsControllerTest < ActionController::TestCase
-# class CommentsControllerTest < ActiveSupport::TestCase
fixtures :users, :photos, :posts, :comments, :roles
def setup
@@ -5,8 +5,8 @@ class MonitorshipsControllerTest < ActionController::TestCase
all_fixtures
def test_should_require_login
- post :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:aaron).id, :format => 'js'
- assert_js_redirected_to login_path
+ post :create, :forum_id => forums(:rails).id, :topic_id => topics(:pdi).id, :id => users(:aaron).id
+ assert_redirected_to login_path
end
def test_should_add_monitorship
@@ -16,7 +16,7 @@ def test_should_add_monitorship
assert_response :success
end
- assert topics(:pdi).monitors(true).include?(users(:joe))
+ assert topics(:pdi).monitors.include?(users(:joe))
end
def test_should_activate_monitorship
@@ -65,6 +65,15 @@ def test_should_fail_cookie_login
get :new
assert !@controller.send(:logged_in?)
end
+
+ def test_should_login_with_reset_password
+ quentin = users(:quentin)
+ quentin.reset_password
+ newpass = quentin.password
+ quentin.save!
+ post :create, :login => 'quentin', :password => newpass
+ assert session[:user]
+ end
protected
def auth_token(token)

0 comments on commit ce994e2

Please sign in to comment.