From: Date: Wed, 16 Aug 2006 22:12:13 +0000 (-0400) Subject: Overrode a number of the new account defaults and added some of my own X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/657351a625ff99ca5f5aa5f32a6f070eb8e40ba8 Overrode a number of the new account defaults and added some of my own features. --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb new file mode 100644 index 0000000..f88f7d5 --- /dev/null +++ b/app/controllers/user_controller.rb @@ -0,0 +1,3 @@ +class UserController < ApplicationController + layout 'vb' +end diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb new file mode 100644 index 0000000..0147c3f --- /dev/null +++ b/app/helpers/user_helper.rb @@ -0,0 +1,2 @@ +module UserHelper +end diff --git a/app/views/layouts/vb.rhtml b/app/views/layouts/vb.rhtml index 76b6d36..d4cbb86 100644 --- a/app/views/layouts/vb.rhtml +++ b/app/views/layouts/vb.rhtml @@ -3,7 +3,7 @@ <%= @page_title || "VotingBooth" %> <%= stylesheet_link_tag "vb", :media => "all" %> - <%= engine_stylesheet 'login_engine' %> + <% #engine_stylesheet 'login_engine' %> <%= javascript_include_tag "prototype", "effects", "dragdrop", "controls" %> diff --git a/app/views/site/_basic_login.rhtml b/app/views/site/_basic_login.rhtml new file mode 100644 index 0000000..f9bbd4a --- /dev/null +++ b/app/views/site/_basic_login.rhtml @@ -0,0 +1,12 @@ +<% -%> + <%= start_form_tag :controller => 'user', :action => 'login' %> + + <%= form_input :text_field, "Login ID", "login", :size => 30 %> + <%= form_input :password_field, "Password", "password", :size => 30 %> +
+ +
+ <%= submit_tag 'Login' %> + <%= link_to 'Register for an account', :controller => 'user', :action => 'signup' %> | + <%= link_to 'Forgot my password', :controller => 'user', :action => 'forgot_password' %>
+ <%= end_form_tag %> diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index bd30dfe..5fce40f 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -5,20 +5,26 @@

Voters

-

Please enter your password/token to log in and vote:

+

If you have received an email with a token inviting you to vote in an +ongoing election, you can log in to vote using your token here.

<%= form_tag :controller => 'voter', :action => 'index' %> <%= text_field :vote, :password %> <%= submit_tag "Log In" %> <%= end_form_tag %> + +

<%= link_to 'Lost or forgot your token?', :controller => 'voter', :action => 'forgot_password' %>

Vote Administrators

-<%= render :controller => 'user', :action => 'login' %> -hi! + +

You must have an account to start a new election or to administer an +existing vote. You can log in or create a new account below.

+ +<%= render_partial 'basic_login' %> diff --git a/test/functional/user_controller_test.rb b/test/functional/user_controller_test.rb new file mode 100644 index 0000000..b97a404 --- /dev/null +++ b/test/functional/user_controller_test.rb @@ -0,0 +1,18 @@ +require File.dirname(__FILE__) + '/../test_helper' +require 'user_controller' + +# Re-raise errors caught by the controller. +class UserController; def rescue_action(e) raise e end; end + +class UserControllerTest < Test::Unit::TestCase + def setup + @controller = UserController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + # Replace this with your real tests. + def test_truth + assert true + end +end