From e62ba5ae28f6d424c755178298b9920a2eb40c63 Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Thu, 19 Aug 2010 00:54:48 +0100 Subject: Cross advertise about text and photo when you edit one --- app/controllers/user_controller.rb | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'app/controllers/user_controller.rb') 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] = "

Thanks for updating your profile photo.

+

Next... You can put some text about you and your research on your profile.

" + 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] = "

Thanks for changing the text about you on your profile.

+

Next... You can upload a profile photograph too.

" + redirect_to set_profile_photo_url() + end end private -- cgit v1.2.3