Overrode a number of the new account defaults and added some of my own
author<mako@atdot.cc> <>
Wed, 16 Aug 2006 22:12:13 +0000 (18:12 -0400)
committer<mako@atdot.cc> <>
Wed, 16 Aug 2006 22:12:13 +0000 (18:12 -0400)
features.

app/controllers/user_controller.rb [new file with mode: 0644]
app/helpers/user_helper.rb [new file with mode: 0644]
app/views/layouts/vb.rhtml
app/views/site/_basic_login.rhtml [new file with mode: 0644]
app/views/site/index.rhtml
test/functional/user_controller_test.rb [new file with mode: 0644]

diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
new file mode 100644 (file)
index 0000000..f88f7d5
--- /dev/null
@@ -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 (file)
index 0000000..0147c3f
--- /dev/null
@@ -0,0 +1,2 @@
+module UserHelper
+end
index 76b6d36e330c08e2bbb9e47fb28ecbb6f005eaa4..d4cbb86a5021ef633100126c1f6b64ef4a9852fc 100644 (file)
@@ -3,7 +3,7 @@
     <head>
         <title><%= @page_title || "VotingBooth" %></title>
         <%= stylesheet_link_tag "vb", :media => "all" %>
-        <%engine_stylesheet 'login_engine' %>
+        <% #engine_stylesheet 'login_engine' %>
  
         <%= javascript_include_tag "prototype", "effects", "dragdrop", "controls" %>
     </head>
diff --git a/app/views/site/_basic_login.rhtml b/app/views/site/_basic_login.rhtml
new file mode 100644 (file)
index 0000000..f9bbd4a
--- /dev/null
@@ -0,0 +1,12 @@
+<% -%>
+  <%= start_form_tag :controller => 'user', :action => 'login'  %>
+    <table>
+      <%= form_input :text_field, "Login ID", "login", :size => 30 %>
+      <%= form_input :password_field, "Password", "password", :size => 30 %>
+    </table>
+
+    <div class="button-bar">
+      <%= submit_tag 'Login' %>
+      <%= link_to 'Register for an account', :controller => 'user', :action => 'signup' %> |
+      <%= link_to 'Forgot my password', :controller => 'user', :action => 'forgot_password' %>      </div>
+  <%= end_form_tag %>
index bd30dfe21f51bc1865b9f9dbcb4f613f1d11ea75..5fce40fe1d51bfeea3c4267c10a7a364c641e3a1 100644 (file)
@@ -5,20 +5,26 @@
 <td width="47%" valign="top">
 <h2>Voters</h2>
 
-<p>Please enter your password/token to log in and vote:</p>
+<p>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.</p>
 
 <%= form_tag :controller => 'voter', :action => 'index' %>
 <%= text_field :vote, :password %>
 <%= submit_tag "Log In" %>
 <%= end_form_tag %>
+
+<p><%= link_to 'Lost or forgot your token?', :controller => 'voter', :action => 'forgot_password' %></p>
 </td>
 
 <td width="6%"></td>
 
 <td width="47%" valign="top">
 <h2>Vote Administrators</h2>
-<%= render :controller => 'user', :action => 'login' %>
-hi!
+
+<p>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.</p>
+
+<%= render_partial 'basic_login' %>
 </td>
 </tr>
 </table>
diff --git a/test/functional/user_controller_test.rb b/test/functional/user_controller_test.rb
new file mode 100644 (file)
index 0000000..b97a404
--- /dev/null
@@ -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

Benjamin Mako Hill || Want to submit a patch?