aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/user_controller.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-08-19 00:54:48 +0100
committerFrancis Irving <francis@mysociety.org>2010-08-19 00:54:48 +0100
commite62ba5ae28f6d424c755178298b9920a2eb40c63 (patch)
tree452c9c516c742778748edbfc96dc89604e04d233 /app/controllers/user_controller.rb
parent906d27d850604f908ac9be757bbc85871c4640b7 (diff)
Cross advertise about text and photo when you edit one
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r--app/controllers/user_controller.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index e9b5f8676..e31f91778 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -386,8 +386,15 @@ class UserController < ApplicationController
:x => params[:x], :y => params[:y], :w => params[:w], :h => params[:h])
@user.set_profile_photo(@profile_photo)
draft_profile_photo.destroy
- flash[:notice] = "Thank you for updating your profile photo"
- redirect_to user_url(@user)
+
+ if !@user.get_about_me_for_html_display.empty?
+ flash[:notice] = "Thank you for updating your profile photo"
+ redirect_to user_url(@user)
+ else
+ flash[:notice] = "<p>Thanks for updating your profile photo.</p>
+ <p><strong>Next...</strong> You can put some text about you and your research on your profile.</p>"
+ redirect_to set_profile_about_me_url()
+ end
else
render :template => 'user/set_draft_profile_photo.rhtml'
end
@@ -458,8 +465,14 @@ class UserController < ApplicationController
@user.about_me = @about_me.about_me
@user.save!
- flash[:notice] = "You have now changed the text about you on your profile."
- redirect_to user_url(@user)
+ if @user.profile_photo
+ flash[:notice] = "You have now changed the text about you on your profile."
+ redirect_to user_url(@user)
+ else
+ flash[:notice] = "<p>Thanks for changing the text about you on your profile.</p>
+ <p><strong>Next...</strong> You can upload a profile photograph too.</p>"
+ redirect_to set_profile_photo_url()
+ end
end
private