From 469888b30ec666c4f5e11f0be42cab539b2a7ab4 Mon Sep 17 00:00:00 2001
From:
Date: Wed, 16 Aug 2006 16:57:38 -0400
Subject: [PATCH] Added a new site wide design and some other bits and pieces.
---
app/controllers/site_controller.rb | 6 ++
app/helpers/site_helper.rb | 2 +
app/views/layouts/election.rhtml | 14 ---
app/views/layouts/vb.rhtml | 50 +++++++++++
app/views/site/index.rhtml | 23 +++++
config/routes.rb | 2 +-
public/index.html | 78 -----------------
public/stylesheets/scaffold.css | 74 ----------------
public/stylesheets/vb.css | 108 ++++++++++++++++++++++++
test/functional/site_controller_test.rb | 18 ++++
10 files changed, 208 insertions(+), 167 deletions(-)
create mode 100644 app/controllers/site_controller.rb
create mode 100644 app/helpers/site_helper.rb
delete mode 100644 app/views/layouts/election.rhtml
create mode 100644 app/views/layouts/vb.rhtml
create mode 100644 app/views/site/index.rhtml
delete mode 100644 public/index.html
delete mode 100644 public/stylesheets/scaffold.css
create mode 100644 public/stylesheets/vb.css
create mode 100644 test/functional/site_controller_test.rb
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb
new file mode 100644
index 0000000..6e77b48
--- /dev/null
+++ b/app/controllers/site_controller.rb
@@ -0,0 +1,6 @@
+class SiteController < ApplicationController
+ layout 'vb'
+
+ def index
+ end
+end
diff --git a/app/helpers/site_helper.rb b/app/helpers/site_helper.rb
new file mode 100644
index 0000000..c879486
--- /dev/null
+++ b/app/helpers/site_helper.rb
@@ -0,0 +1,2 @@
+module SiteHelper
+end
diff --git a/app/views/layouts/election.rhtml b/app/views/layouts/election.rhtml
deleted file mode 100644
index fbac7a9..0000000
--- a/app/views/layouts/election.rhtml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- Elections: <%= controller.action_name %>
- <%= javascript_include_tag "prototype", "effects" %>
- <%= stylesheet_link_tag 'scaffold' %>
-
-
-
-<%= flash[:notice] %>
-
-<%= @content_for_layout %>
-
-
-
diff --git a/app/views/layouts/vb.rhtml b/app/views/layouts/vb.rhtml
new file mode 100644
index 0000000..1161c7f
--- /dev/null
+++ b/app/views/layouts/vb.rhtml
@@ -0,0 +1,50 @@
+<% %>
+
+
+ <%= @page_title || "VotingBooth" %>
+ <%= stylesheet_link_tag "vb", :media => "all" %>
+ <%= javascript_include_tag "prototype", "effects", "dragdrop", "controls" %>
+
+
+
+ <% if @page_title %>
+
<%= @page_title %>
+ <% else %>
+
Voting Booth
+ Preferential Voting on the Web
+ <% end %>
+
+
+ <% if session[:user] %>
+ Welcome <%= session[:user].login.capitalize %>
+ <% 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") %>
+
+
+
+ <% if @flash[:notice]%>
+ <%= @flash[:notice] %>
+ <% end%>
+
+
+ <%= @content_for_layout %>
+
+
+
+
+
+
+
diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml
new file mode 100644
index 0000000..e4ef59c
--- /dev/null
+++ b/app/views/site/index.rhtml
@@ -0,0 +1,23 @@
+<% %>
+
+
+
+
+Voters
+
+Please enter your password/token to log in and vote:
+
+<%= form_tag :controller => 'voter', :action => 'index' %>
+<%= text_field :vote, :password %>
+<%= submit_tag "Log In" %>
+<%= end_form_tag %>
+ |
+
+ |
+
+
+Vote Administrators
+
+ |
+
+
diff --git a/config/routes.rb b/config/routes.rb
index 0b6d80a..c9beb55 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -8,7 +8,7 @@ ActionController::Routing::Routes.draw do |map|
# 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'
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index d780f8e..0000000
--- a/public/index.html
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
- Rails: Welcome on board
-
-
-
-
-Congratulations, you've put Ruby on Rails!
-
-Before you move on, verify that the following conditions have been met:
-
-
- - The log and public directories must be writable to the web server (
chmod -R 775 log
and chmod -R 775 public
).
- -
- The shebang line in the public/dispatch* files must reference your Ruby installation.
- You might need to change it to #!/usr/bin/env ruby
or point directly at the installation.
-
- -
- Rails on Apache needs to have the cgi handler and mod_rewrite enabled.
- Somewhere in your httpd.conf, you should have:
- AddHandler cgi-script .cgi
- LoadModule rewrite_module libexec/httpd/mod_rewrite.so
- AddModule mod_rewrite.c
-
-
-
-Take the following steps to get started:
-
-
- - Create empty development and test databases for your application.
- Recommendation: Use *_development and *_test names, such as basecamp_development and basecamp_test
- Warning: Don't point your test database at your development database, it'll destroy the latter on test runs!
- - Edit config/database.yml with your database settings.
-
- Create controllers and models using the generator in
script/generate
- Help: Run the generator with no arguments for documentation
- - See all the tests run by running
rake
.
- - Develop your Rails application!
-
- Setup Apache with FastCGI (and Ruby bindings), if you need better performance
-
- Remove the dispatches you don't use (so if you're on FastCGI, delete/move dispatch.rb, dispatch.cgi and gateway.cgi)
-
-
-
- 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 config/routes.rb of the form:
-
map.connect '', :controller => 'wiki/page', :action => 'show', :title => 'Welcome'
-
-
-
- Having problems getting up and running? First try debugging it yourself by looking at the log files.
- Then try the friendly Rails community on the web or on IRC
- (FreeNode#rubyonrails).
-
-
-
-
diff --git a/public/stylesheets/scaffold.css b/public/stylesheets/scaffold.css
deleted file mode 100644
index de2ccc5..0000000
--- a/public/stylesheets/scaffold.css
+++ /dev/null
@@ -1,74 +0,0 @@
-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%;
-}
-
diff --git a/public/stylesheets/vb.css b/public/stylesheets/vb.css
new file mode 100644
index 0000000..79800a8
--- /dev/null
+++ b/public/stylesheets/vb.css
@@ -0,0 +1,108 @@
+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;
+
+}
+
diff --git a/test/functional/site_controller_test.rb b/test/functional/site_controller_test.rb
new file mode 100644
index 0000000..69b9348
--- /dev/null
+++ b/test/functional/site_controller_test.rb
@@ -0,0 +1,18 @@
+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
--
2.39.5