--- /dev/null
+class SiteController < ApplicationController
+ layout 'vb'
+
+ def index
+ end
+end
--- /dev/null
+module SiteHelper
+end
+++ /dev/null
-<html>
-<head>
- <title>Elections: <%= controller.action_name %></title>
- <%= javascript_include_tag "prototype", "effects" %>
- <%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-
-<p style="color: green"><%= flash[:notice] %></p>
-
-<%= @content_for_layout %>
-
-</body>
-</html>
--- /dev/null
+<% %>
+<html>
+ <head>
+ <title><%= @page_title || "VotingBooth" %></title>
+ <%= stylesheet_link_tag "vb", :media => "all" %>
+ <%= javascript_include_tag "prototype", "effects", "dragdrop", "controls" %>
+ </head>
+ <body>
+ <div id="top">
+ <% if @page_title %>
+ <h3><%= @page_title %></h3>
+ <% else %>
+ <h3>Voting Booth<br />
+ <font size="-1">Preferential Voting on the Web</font></h3>
+ <% end %>
+
+ <div id="links">
+ <% if session[:user] %>
+ Welcome <strong><%= session[:user].login.capitalize %></strong>
+ <% else %>
+ <%= link_to("Login",:controller => "account", :action => "login") %>/<%= link_to("Sign up", :controller => "account", :action => "signup")%>
+ <% end %> |
+
+ <%= link_to("Home", :controller => "site", :action => "index")%> |
+ <%= link_to("Browse", :controller => "site", :action => "index")%> |
+
+ <% if session[:user] %>
+ <%= link_to("Logout", :controller => "account", :action => "logout") %> |
+ <% end %>
+
+ <%= link_to("Help/About", :controller => "site", :action => "about") %>
+ </div>
+ </div>
+
+ <% if @flash[:notice]%>
+ <div id="notice"><%= @flash[:notice] %></div>
+ <% end%>
+
+ <div id="main">
+ <%= @content_for_layout %>
+ </div>
+
+ <hr />
+ <div id="footer">(C) 2006 |
+ <%= link_to "MIT Media Lab", "http://www.media.mit.edu" %> and
+ <a href="http://mako.cc">Benjamin Mako Hill</a>
+ </div>
+
+ </body>
+</html>
--- /dev/null
+<% %>
+
+<table width="auto" padding="5px">
+<tr>
+<td width="47%" valign="top">
+<h2>Voters</h2>
+
+<p>Please enter your password/token to log in and vote:</p>
+
+<%= form_tag :controller => 'voter', :action => 'index' %>
+<%= text_field :vote, :password %>
+<%= submit_tag "Log In" %>
+<%= end_form_tag %>
+</td>
+
+<td width="6%"></td>
+
+<td width="47%" valign="top">
+<h2>Vote Administrators</h2>
+
+</td>
+</tr>
+</table>
# You can have the root of your site routed by hooking up ''
# -- just remember to delete public/index.html.
- # map.connect '', :controller => "welcome"
+ map.connect '', :controller => "site"
# Allow downloading Web Service WSDL as a file with an extension
# instead of a file named 'wsdl'
+++ /dev/null
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title>Rails: Welcome on board</title>
- <style>
- body { background-color: #fff; color: #333; }
-
- body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 12px;
- line-height: 18px;
- }
-
- li {
- margin-bottom: 7px;
- }
-
- pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
- }
-
- a { color: #000; }
- a:visited { color: #666; }
- a:hover { color: #fff; background-color:#000; }
- </style>
-</head>
-<body>
-
-<h1>Congratulations, you've put Ruby on Rails!</h1>
-
-<p><b>Before you move on</b>, verify that the following conditions have been met:</p>
-
-<ol>
- <li>The log and public directories must be writable to the web server (<code>chmod -R 775 log</code> and <code>chmod -R 775 public</code>).
- <li>
- The shebang line in the public/dispatch* files must reference your Ruby installation. <br/>
- You might need to change it to <code>#!/usr/bin/env ruby</code> or point directly at the installation.
- </li>
- <li>
- Rails on Apache needs to have the cgi handler and mod_rewrite enabled. <br/>
- Somewhere in your httpd.conf, you should have:<br/>
- <code>AddHandler cgi-script .cgi</code><br/>
- <code>LoadModule rewrite_module libexec/httpd/mod_rewrite.so</code><br/>
- <code>AddModule mod_rewrite.c</code>
- </li>
-</ol>
-
-<p>Take the following steps to get started:</p>
-
-<ol>
- <li>Create empty development and test databases for your application.<br/>
- <small>Recommendation: Use *_development and *_test names, such as basecamp_development and basecamp_test</small><br/>
- <small>Warning: Don't point your test database at your development database, it'll destroy the latter on test runs!</small>
- <li>Edit config/database.yml with your database settings.
- <li>Create controllers and models using the generator in <code>script/generate</code> <br/>
- <small>Help: Run the generator with no arguments for documentation</small>
- <li>See all the tests run by running <code>rake</code>.
- <li>Develop your Rails application!
- <li>Setup Apache with <a href="http://www.fastcgi.com">FastCGI</a> (and <a href="http://raa.ruby-lang.org/list.rhtml?name=fcgi">Ruby bindings</a>), if you need better performance
- <li>Remove the dispatches you don't use (so if you're on FastCGI, delete/move dispatch.rb, dispatch.cgi and gateway.cgi)</li>
-</ol>
-
-<p>
- Trying to setup a default page for Rails using Routes? You'll have to delete this file (public/index.html) to get under way. Then define a new route in <tt>config/routes.rb</tt> of the form:
- <pre> map.connect '', :controller => 'wiki/page', :action => 'show', :title => 'Welcome'</pre>
-</p>
-
-<p>
- Having problems getting up and running? First try debugging it yourself by looking at the log files. <br/>
- Then try the friendly Rails community <a href="http://www.rubyonrails.org">on the web</a> or <a href="http://www.rubyonrails.org/show/IRC">on IRC</a>
- (<a href="irc://irc.freenode.net/#rubyonrails">FreeNode#rubyonrails</a>).
-</p>
-
-</body>
-</html>
+++ /dev/null
-body { background-color: #fff; color: #333; }
-
-body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
-}
-
-pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
-}
-
-a { color: #000; }
-a:visited { color: #666; }
-a:hover { color: #fff; background-color:#000; }
-
-.fieldWithErrors {
- padding: 2px;
- background-color: red;
- display: table;
-}
-
-#ErrorExplanation {
- width: 400px;
- border: 2px solid red;
- padding: 7px;
- padding-bottom: 12px;
- margin-bottom: 20px;
- background-color: #f0f0f0;
-}
-
-#ErrorExplanation h2 {
- text-align: left;
- font-weight: bold;
- padding: 5px 5px 5px 15px;
- font-size: 12px;
- margin: -7px;
- background-color: #c00;
- color: #fff;
-}
-
-#ErrorExplanation p {
- color: #333;
- margin-bottom: 0;
- padding: 5px;
-}
-
-#ErrorExplanation ul li {
- font-size: 12px;
- list-style: square;
-}
-
-div.uploadStatus {
- margin: 5px;
-}
-
-div.progressBar {
- margin: 5px;
-}
-
-div.progressBar div.border {
- background-color: #fff;
- border: 1px solid grey;
- width: 100%;
-}
-
-div.progressBar div.background {
- background-color: #333;
- height: 18px;
- width: 0%;
-}
-
--- /dev/null
+body {
+ font-size: 1em;
+ font-weight: normal;
+ word-spacing: normal;
+ letter-spacing: normal;
+ text-transform: none;
+ font-family: Myriad Web, Geneva, Arial, Helvetica, sans-serif;
+ font-size-adjust: .48;
+}
+p, blockquote, ul, ol, dl, dd, li, dir, menu {}
+
+h1, h2, h3, h4 {
+ border-bottom: 1px solid #009999;
+ text-shadow: #999999 0.2em 0.2em 3px;
+
+}
+a:link { font-weight: bold; color: #066; text-decoration: underline; }
+a:visited { color: #066; text-decoration: underline; }
+a:hover { color: #FFFFFF; text-decoration: none; background: #0063DC; }
+a:active { color: #FFFFFF; text-decoration: none; background: #0259C4; }
+
+#loginbox {
+ padding: 10px;
+ border: 1px solid;
+ width: 400px;
+ text-align: left;
+}
+
+#ErrorExplanation {
+ width: 400px;
+ border: 2px solid 'red';
+ padding: 7px;
+ padding-bottom: 12px;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+}
+
+#ErrorExplanation h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 5px 5px 15px;
+ font-size: 12px;
+ margin: -7px;
+ background-color: #c00;
+ color: #fff;
+}
+
+#ErrorExplanation p {
+ color: #333;
+ margin-bottom: 0;
+ padding: 5px;
+}
+
+#ErrorExplanation ul li {
+ font-size: 12px;
+ list-style: square;
+}
+
+
+
+#top { margin : 0px;
+ padding : 3px;
+ font-weight: normal;
+ background: #009999;
+ color: #FFFFFF;
+
+}
+
+#top h3 { font-size: 30px; }
+
+#links { text-align : right;
+ margin-right: 50px; }
+#links a { color: #EAFFD0; }
+#links a:visited { font-weight: bold; }
+
+.ListLine0 {
+ background: #e0f8f8;
+
+}
+.ListLine1 {
+ background: #cccccc;
+
+}
+
+#main { margin: 30px; }
+
+#notice { background: #FFFBB3;
+ text-align: left;
+ font-weight: bold;
+ border: 2px dotted 'red';
+ margin-top: 10px;
+ margin-left: 50px;
+ padding: 5px 5px 5px 15px;
+ width: 85%; }
+
+#footer { text-align: center;
+ font-size: 12px;
+ color: #464646; }
+
+#footer a { font-weight: normal; }
+
+#subtext {
+ text-align: center;
+ font-size: 12px;
+ font-weight: bold;
+
+}
+
--- /dev/null
+require File.dirname(__FILE__) + '/../test_helper'
+require 'site_controller'
+
+# Re-raise errors caught by the controller.
+class SiteController; def rescue_action(e) raise e end; end
+
+class SiteControllerTest < Test::Unit::TestCase
+ def setup
+ @controller = SiteController.new
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
+ end
+
+ # Replace this with your real tests.
+ def test_truth
+ assert true
+ end
+end