diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index e85b91e..7a231d1 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -6,7 +6,9 @@ class AccountController < ApplicationController # say something nice, you goof! something sweet. def index - redirect_to(:action => 'signup') unless logged_in? || User.count > 0 + unless logged_in? + render :action => 'index_anonymous' + end end def login diff --git a/app/views/account/index.rhtml b/app/views/account/index.rhtml index d600d59..9466e0b 100644 --- a/app/views/account/index.rhtml +++ b/app/views/account/index.rhtml @@ -1,56 +1,3 @@ -

In the Caboose.

-<% content_for 'poem' do -%> -"Train delayed? and what's to say?" -"Blocked by last night's snow they say." -Seven hours or so to wait; -Well, that's pleasant! but there's the freight. -Depot loafing no one fancies, -We'll try the caboose and take our chances. - -Cool this morning in Watertown, -Somewhat frosty___mercury down; -Enter caboose___roaring fire, -With never an air-hole; heat so dire -That we shrivel and pant; we are roasted through- -Outside, thermometer thirty-two. - -We start with a jerk and suddenly stop. -"What's broke?" says one; another "What's up?", -"Oh, nothing," they answer, "That's our way: -You must stand the jerking, sorry to say." -We "stand it" with oft this painful thought: -Are our heads on yet, or are they not? - -Comrades in misery___let me see; -Girl like a statue opposite me; -Back and forth the others jostle___ -She never winks, nor moves a muscle; -See her, as she sits there now; -She's "well balanced," anyhow. - -Woman in trouble, tearful eyes, -Sits by the window, softly cries, -Pity___for griefs we may not know, -For breasts that ache, for tears that flow, -Though we know not why. Her eyelids red -Tell a sorrowful tale___some hope is dead. - -Man who follows the Golden Rule, -And lends his papers___a pocket full, -Has a blank book___once in a minute -Has an idea, and writes it in it. -Guess him? Yes, of course I can, -He's a___well___a newspaper man. - -Blue-eyed fairy, wrapped in fur; -Sweet young mother tending her. -Fairy thinks it's "awful far," -Wants to get off this "naughty car." -So do we, young golden-hair; -All this crowd are with you there! -<% end -%> - -<%= simple_format @content_for_poem %> - -

-- Ellen P. Allerton.

\ No newline at end of file +<%= link_to _('Change password'), :action => 'change_password' %> +<%= link_to _('Edit Personal details'), :action => 'edit_details' %> diff --git a/app/views/account/index_anonymous.rhtml b/app/views/account/index_anonymous.rhtml new file mode 100644 index 0000000..c8ec006 --- /dev/null +++ b/app/views/account/index_anonymous.rhtml @@ -0,0 +1,2 @@ +<%= link_to _('Login'), :action => 'login' %> +<%= link_to _('Sign up'), :action => 'signup' %> diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 3c8cd22..ba34cc7 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -113,6 +113,17 @@ class AccountControllerTest < Test::Unit::TestCase assert !@controller.send(:logged_in?) end + def test_should_display_anonymous_user_options + get :index + assert_template 'index_unregistered' + end + + def test_should_display_logged_in_user_options + login_as 'quentin' + get :index + assert_template 'index' + end + protected def create_user(options = {}) post :signup, :user => { :login => 'quire', :email => 'quire@example.com', -- libgit2 0.21.2