From ce412a9a0ccce22b5b9d90f70369b91d5fc46e4f Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 23 Jan 2014 11:36:17 -0800 Subject: added a customizable 'bye' page for when a user leaves --- app/views/pages/bye.html.haml | 6 ++++++ config/routes.rb | 1 + users/app/controllers/users_controller.rb | 2 +- users/config/locales/en.yml | 3 ++- users/test/functional/users_controller_test.rb | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 app/views/pages/bye.html.haml diff --git a/app/views/pages/bye.html.haml b/app/views/pages/bye.html.haml new file mode 100644 index 0000000..30b52e0 --- /dev/null +++ b/app/views/pages/bye.html.haml @@ -0,0 +1,6 @@ +%br/ +.hero-unit + %h2= t :bye + = t :bye_message + += render 'common/home_page_buttons' \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index f8f0c26..f8bb8fb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,6 +12,7 @@ LeapWeb::Application.routes.draw do get 'about', :as => 'about' get 'contact', :as => 'contact' get 'pricing', :as => 'pricing' + get 'bye', :as => 'bye' end get '/provider.json' => 'static_config#provider' diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb index a874772..a5461cd 100644 --- a/users/app/controllers/users_controller.rb +++ b/users/app/controllers/users_controller.rb @@ -61,7 +61,7 @@ class UsersController < UsersBaseController else # let's remove the invalid session logout - redirect_to home_url + redirect_to bye_url end end diff --git a/users/config/locales/en.yml b/users/config/locales/en.yml index 934fcee..e597164 100644 --- a/users/config/locales/en.yml +++ b/users/config/locales/en.yml @@ -37,7 +37,8 @@ en: enable_description: "This will restore the account to full functionality" deactivate_account: "Deactivate the account %{username}" deactivate_description: "This will temporarily deactivate some account functionality." #todo detail exact functionality. can receive email but not send or renew client certificate? - + bye: "Goodbye!" + bye_message: "So long and thanks for all the fish." # # overview diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb index 002a011..57ae94d 100644 --- a/users/test/functional/users_controller_test.rb +++ b/users/test/functional/users_controller_test.rb @@ -103,7 +103,7 @@ class UsersControllerTest < ActionController::TestCase delete :destroy, :id => @current_user.id assert_response :redirect - assert_redirected_to home_path + assert_redirected_to bye_url end test "non-admin can't destroy user" do -- cgit v1.2.3