--- /dev/null
+class AboutController < ApplicationController
+ layout 'main'
+
+ before_filter :add_sidebar
+
+ def index
+ redirect_to :action => 'overview'
+ end
+
+ def features
+ end
+
+ private
+ def add_sidebar
+ @sidebar_content = render_to_string :partial => 'sidebar',
+ :locals => { :page => action_name }
+ end
+
+end
+
self.current_user.remember_me
cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
end
- redirect_back_or_default(:controller => '/site', :action => 'index')
+ redirect_back_or_default :controller => 'front'
flash[:notice] = "Logged in successfully"
end
end
return unless request.post?
@user.save!
self.current_user = @user
- redirect_back_or_default(:controller => '/site', :action => 'index')
+ redirect_back_or_default :controller => 'front'
flash[:notice] = "Thanks for signing up!"
rescue ActiveRecord::RecordInvalid
render :action => 'signup'
cookies.delete :auth_token
reset_session
flash[:notice] = "You have been logged out."
- redirect_back_or_default(:controller => '/site', :action => 'index')
+ redirect_back_or_default :controller => 'front'
end
#======================================================================
-# Filters added to this controller will be run for all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
+# Filters added to this controller will be run for all controllers in
+# the application. Likewise, all the methods added will be available
+# for all controllers.
class ApplicationController < ActionController::Base
+ # add authentication methods and hooks
include AuthenticatedSystem
helper :user
require_dependency "user"
- before_filter :add_stylesheets
+ # add sitealizer statistics and tracking information
+ include Sitealizer
+
+ before_filter :use_sitealizer, :add_stylesheets
def initialize
@stylesheets = []
+
+ # this is defined is a sketchy way in the sitealizer mixin
+ # initalize. since i'm overloading that, i'm calling it here
+ $visits = [] unless $visits
end
def add_stylesheets
require_dependency "candidate"
layout 'main'
- #before_filter :login_required
-
## methods for displaying, creating,
## and manipulating election overview data
####################################################################
-class SiteController < ApplicationController
+class FrontController < ApplicationController
layout 'frontpage'
require_dependency "user"
require_dependency "election"
require_dependency "account"
- include Sitealizer
- before_filter :use_sitealizer
def index
@quickvotes = QuickVote.find(:all).sort {|a,b| b.enddate <=> a.enddate}[0..1]
# if we have no record of them, set the user back to
# nothing and start again
session[:user] = nil
-
end
end
end
@voter.reload
end
else
- redirect_to :controller => 'site'
+ redirect_to :controller => 'front'
end
end
def results
unless @election = QuickVote.ident_to_quickvote(params[:ident])
flash[:notice] = "Cannot find quickvote #{params[:ident]}."
- redirect_to :controller => 'site'
+ redirect_to :controller => 'front'
return
end
if @election.viewable == 0 && @election.active == 1
--- /dev/null
+<h2>Information and Documentation</h2>
+
+<% steps = [ ['overview', 'Overview'],
+ ['features', 'Major Features' ],
+# ['why', 'Why Selectricity?' ],
+ ['team', 'The Team'],
+ ['thanks', 'Acknowledgements'],
+ ['privacy', 'Privacy Policy' ],
+ ['anywhere', 'Selectricity Anywhere'] ] %>
+
+<div id="progress_bar">
+
+<ul>
+<% steps.each_with_index do |kv, i| -%>
+ <% step, description = *kv %>
+ <li class="<%= step == page ? 'step_selected' : 'step_unselected' -%><%=
+ " last" if i + 1 == steps.length -%>">
+ <% if step == page %>
+ <%= description %>
+ <% else %>
+ <%= link_to description, :action => step %>
+ <% end %>
+ </li>
+<% end %>
+</ul>
+
+</div>
+
-<html>
- <link rel="stylesheet" type="text/css" href="stylesheets/main.css" />
- <div id="top">
- <h3>Selectricity Anywhere<br />
- <font size="-1">Voting Machinery for the <em>Mobile</em> Masses</font></h3>
+<div id="title-header">
+ <span class="header">Selectricity Anywhere</span>
+ <span class="subheader"></span>
</div>
-
<p><em>Selectricity Anywhere</em> tries to help groups make better
decisions in their everyday lives. It tries to make voting technology
created for state elections and government use easily accessible for
It is similar to <a href="http://selectricity.media.mit.edu">Selectricity</a>,
a flexible web-based interface to the same voting machinery.</p>
-<h2>Usage</h2>
+<div class="normal-header">
+ <span class="header">Usage</span>
+ <span class="subheader"></span>
+</div>
<p>You can use <em>Selectricity Anywhere</em> entirely by sending and
receiving emails or short text messages (SMS). In the US, most mobile
non-preferential voting methods.</p>
</div>
-<p>Please direct messages to: <strong><em><a href="mailto:vote@mako.cc">vote@mako.cc</a></em></strong></p>
+<p>Please direct messages to: <strong><em><a href="mailto:vote@selectricity.org">vote@selectricity.org</a></em></strong></p>
-<h3>Creating a New Election</h3>
+<div class="normal-header">
+ <span class="header">Creating a New Election</span>
+ <span class="subheader"></span>
+</div>
<p>To create a new election, send a message of the following form:</p>
<p><tt>new lunch CVMT</tt></p>
</div>
-<h3>Voting</h3>
+
+<div class="normal-header">
+ <span class="header">Voting</span>
+ <span class="subheader"></span>
+</div>
<p>To vote in an election, send a message of the following form:</p>
in the election created in the example above.</p>
</div>
-<h3>View Results</h3>
+<div class="normal-header">
+ <span class="header">View Results</span>
+ <span class="subheader"></span>
+</div>
<p>To view the results of an election, send a message of one of the
following forms:</p>
<p><tt>res lunch</tt></p>
</div>
-<h3>Information on a Vote</h3>
+<div class="normal-header">
+ <span class="header">Information on a Vote</span>
+ <span class="subheader"></span>
+</div>
<p>To receive information on a vote, send a message of the following
form:</p>
<p><tt>info lunch</tt></p>
</div>
-<h3>General Help</h3>
+<h2>General Help</h2>
<p>To receive help on using the system, send a message of the following
form:</p>
designed to fit inside a 155 character text message and will be
<em>much</em> less extensive than the help on this page.</p>
-
-<h2>Advanced Usage</h2>
+<div class="normal-header">
+ <span class="header">Advanced Usage</span>
+ <span class="subheader"></span>
+</div>
<p>There are two advanced types of usages that users of <em>Selectricity
Anywhere</em> might want to be aware of.</p>
<p><tt>new lunch CVMT c:chinese v:vietnamese m:mexican t:thai</tt></p>
</div>
-<h3>Alternative Voting Methods</h3>
-
<p>During vote creation, users can specify a voting method other than
the default (Condorcet with cloneproof Schwartz sequential dropping).
<p><tt>new lunch CVMT method:approval</tt></p>
</div>
-<hr />
-<p><font size="-1">Copyleft 2006 ::
-<a href="http://www.media.mit.edu">MIT Media Lab</a> and
-<a href="http://mako.cc">Benjamin Mako Hill</a></font></p>
-</html>
--- /dev/null
+<div id="title-header">
+ <span class="header">Features</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Selectricity is a flexible and powerful. This page lists some of the
+major features that Selectricity has to offer. <!-- We're adding
+features quickly. You can stay up to date on feature development on the
+<%= link_to("Selectricity News blog", "http://blog.selectricity.org") %>
+--></p>
+
+<div class="normal-header">
+ <span class="header">QuickVotes</span>
+ <span class="subheader"></span>
+</div>
+
+<p>QuickVotes are elections that are designed to be as simple and easy
+as possible. They are like polls but are built on Selectricity's
+heavy-duty election manchinery. They can be created in under a minute
+and voted on in just a few seconds.</p>
+
+<p>QuickVotes are meant for simple, quick decisions. They are not
+limited to registered lists of voters. They support simple lists of
+options -- no pictures, no position statements, and no long
+descriptions. They are simple enough to decide where a group is going to
+dinner, what you're going to name a project, or when to have a group
+meeting.</p>
+
+<p>The best way to learn more is to <%= link_to "create a quickvote",
+:controller => 'quickvote', :action => 'create' %> now!</p>
+
+<div class="normal-header">
+ <span class="header">Anywhere</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Selectricity puts powerful election machinery into the palm of your
+hand.</p>
+
+<p>To use Selectricity, users need to access to a computer and a web
+browser -- which they don't always have in front of them. <%= link_to(
+"Sectricity Anywhere", :action => 'anywhere') %> solves this problem.
+It provides an interface to the system technology entirely accessible
+through short emails and optimized for sending use over email/SMS from
+any mobile phone.</p>
+
+<div class="normal-header">
+ <span class="header">Elections</span>
+ <span class="subheader">Coming Soon</span>
+</div>
+
+<p>Selectricity Elections showcase all of what Selectricity has to
+offer. They support lists of candidates or choices with position
+statements and pictures and secure lists of voters. They have start and
+end dates and features to help made votes both anonymous and
+voter-verifiable.</p>
+
+<p>Selectricity Elections have been used by student groups to elect
+officers and by non-profit organizations to elect their boards of
+directors. They bring some of the best of what the world of high-tech
+election technology has to offer to bear on every day
+decision-making.</p>
+
+<!--
+<p>To create a Selectriicty Election you must first <%= link_to "log in",
+:controller => 'account', :action => 'login' %>.</p>
+-->
+
+<div class="normal-header">
+ <span class="header">API</span>
+ <span class="subheader">Coming Soon</span>
+</div>
+
+Programmers and hackers may want to use Selectricity from within their
+own site or to embed Selectricity functional into their own system.
+Selectricity makes that simple with a featureful API and the ability to
+"embed" elections.
--- /dev/null
+<div id="title-header">
+ <span class="header">About Selectricity</span>
+ <span class="subheader"></span>
+</div>
+
+<p> Selectricity is voting machinery for the masses. We help groups make
+better decisions, more easily. We allow voting, usually in form of
+ranking a list of choices in order of preference, and have the computer
+help groups make better decisions.</p>
+
+<p>Selectricity is simple to use and convenient. Anyone can create the
+simplest election in under a minute and voting is even easier. Results
+can be computed instaneously.</p>
+
+<p>Selectricity is powerful and secure. It has been used for electing
+the boards of non-profit organizations and or choosing the officers of
+student groups. It is simple and fast enough to help a group decide
+where to go to dinner or when to have a meeting. It's flexible enough to
+be integrated into an outside website or used from a mobile phone.</p>
+
+<p>The best way to learn more about Selectricity is to use it. Get started
+by <%= link_to "creating a QuickVote", :controller => 'quickvote',
+:action => 'create' %> now!</p>
+
--- /dev/null
+<div id="title-header">
+ <span class="header">Privacy Policy</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Selectricity respects its users' privacy. Private information on how
+individuals use Selectricity including, but not limited to, information
+on how users vote in anonymous elections will <em>never</em> be shared
+with any third party. Private information will never be sold for any
+reason.</p>
+
+<p>QuickVotes publish list of IP addresses of voters to all voters to
+allow them to check results for vote flooding. Please be aware of this
+feature and the fact that this information may be publicly disclosed for
+QuickVotes to other voters. This does not affect full Selectricity
+Elections. Users wanting to use these features anonymously are
+encouraged to use an anonymity system like <%= link_to("Tor",
+"http://tor.eff.org") %>.</p>
+
+<p>Aggregate information on site usage (e.g., summaries of how many
+users, how often they visited, the average time spent on the site, etc.)
+may be collected and shared with others in <em>aggregated form</em>
+after being stripped of any identifiable information.</p>
+
--- /dev/null
+<div id="title-header">
+ <span class="header">Team</span>
+ <span class="subheader"></span>
+</div>
+
+<div class="photo">
+ <img src="/images/selectricity_team_photo.jpg" alt="Team Photo" />
+</div>
+
+<p>Selectricity was designed and built in the <%= link_to("MIT Media
+Lab", "http://www.media.mit.edu") %> in the <%= link_to("Computing
+Culture group", "http://compcult.media.mit.edu") %>. The team (pictured
+above from left to right), includes Benjamin Mako Hill, Alyssa Wright,
+Justin Sharps, Courtland Allen, and John Dong.</p>
+
+<div class="normal-header">
+ <span class="header">Benjamin Mako Hill</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Benjamin Mako Hill is the founder and leader of the project. He is a
+long-time free software developer and advocate and a rebel with rather
+too many causes. More information on Mako and his many projects can be
+found on <%= link_to("his website", "http://mako.cc") %></p>
+
+<div class="normal-header">
+ <span class="header">Alyssa Wright</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Alyssa Wright is a Masters student at the MIT Media Lab. Her role in
+Selectricity includes coordination of design and business
+development.</p>
+
+<div class="normal-header">
+ <span class="header">Justin Sharps</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Justin Sharps is a native of Southern California who spent summer
+2007 in Massachusetts (bleh) convincing himself that sitting in front of
+a computer for more than 8 hours a day is, in fact, an OK way to spend
+the summer. For the project, Justin focused on visualizing the results
+of the elections and implementing the user system to keep track of
+voters. Justin loves programming when not occupied by any of his
+numerous hobbies such as homework, doing homework, hiding from homework,
+or setting homework on fire. He also likes cars, expensive jeans, and
+sunsets.</p>
+
+
+<div class="normal-header">
+ <span class="header">Courtland Allen</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Hailing from the cold, hard, paved, 2-lane streets of Atlanta,
+Courtland Allen is now a junior at MIT majoring in Computer Science.
+When not sitting in front of his computer creating websites and what
+not, he can be found teaching beginner CSS classes or spending
+(generally) unproductive time chilling with his fraternity brothers.
+His motto is, "Think for yourself." Courtland contributed to the visual
+design of the site including its HTML, CSS styling, and images.</p>
+
+<div class="normal-header">
+ <span class="header">John Dong</span>
+ <span class="subheader"></span>
+</div>
+
+<p>John Dong is a MIT undergraduate and a hacker. His role on
+Selectricity involved writing tests and designing and building the API
+interface. He's also an administrator on the <%= link_to("Ubuntu Forums",
+"http://www.ubuntuforums.com") %> and leader of the Ubuntu backports
+project.</p>
+
--- /dev/null
+<div id="title-header">
+ <span class="header">Acknowledgments</span>
+ <span class="subheader"></span>
+</div>
+
+<p>Selectricity is made possible through the generous support of a
+series of organizations and groups.</p>
+
+<p>The <%= link_to "MIT Media Lab", "http://www.media.mit.edu" %> funded
+work on the project during its first year as a research prototype. In
+particular, the <%= link_to("Electronic Publishing",
+"http://ep.media.mit.edu") %> research group supported the creation of
+the <%= link_to("RubyVote", "http://rubyvote.rubyforge.org") %> library
+while the <%= link_to("Computing Culture",
+"http://compcult.media.mit.edu") %> research group supported the
+creation of much of Selectricity and an earlier research prototype
+called <em>HyperChad</em>.</p>
+
+<p>Funding for the current version of the project comes from the <%=
+link_to("Digital Incubator", "http://www.digitalincubator.net/") %>
+initiative -- a joint effort between <%= link_to("MTV",
+"http://www.mtv.com") %>/<%= link_to("MTVu", "http://www.mtvu.com") %>
+and <%= link_to("Cisco", "http://www.cisco.com") %>. <em>MTVu</em> has
+also played an important role in publicizing the project.</p>
+
--- /dev/null
+<div id="title-header">
+ <span class="header">Features</span>
+ <span class="subheader"></span>
+</div>
+
+
+<div id="title-header">
+ <span class="header">Account Login</span>
+ <span class="subheader"></span>
+</div>
+
<% form_tag do -%>
<p><label for="login">Login</label><br/>
<%= text_field_tag 'login' %></p>
+<div id="title-header">
+ <span class="header">Account Sign Up</span>
+ <span class="subheader"></span>
+</div>
+
<%= error_messages_for :user %>
<% form_for :user do |f| -%>
<p><label for="email">Email</label><br/>
<%= f.text_field :email %><br />
-People participating in elections you're administrating will contact you
+
+<p>People participating in elections you're administrating will contact you
at this address.</p>
<p><label for="password">Password</label><br/>
-<h3>This is your user summary profile, <%=h @user.login.capitalize %></h3>
+<div id="title-header">
+ <span class="header">Account Summary</span>
+ <span class="subheader"></span>
+</div>
+
+<h3>This is your account summary profile, <%=h @user.login.capitalize %></h3>
<p>
E-mail: <%=h @user.email %><br />
-<% progress_steps = [ ['overview', 'General Information'],
- ['candidates', 'Candidates'],
- ['voters', 'Voters'],
- ['review', 'Review'] ] %>
<h2>Progress</h2>
-<div id="election_creation_progress_bar">
+
+<div id="progress_bar">
<ul>
<% progress_steps.each_with_index do |kv, i| -%>
<% step, description = kv -%>
<li class="<%= step == page ? 'step_selected' : 'step_unselected' -%>
<%= " last" if i + 1 == progress_steps.length -%>
- ">Step <%= i + 1 %>: <%= description %></li>
+ ">Step <%= {i + 1 %>: <%= description %></li>
<% end -%>
</ul>
<p><%= submit_tag 'Log in' %></p>
<% end %>
-<p><%= link_to 'Register for an account', :controller => 'account', :action => 'signup' %></p>
-
<p><%= link_to 'Lost or forgot your password?', :controller => 'account', :action => 'forgot_password' %></p>
+
<% if @current_elections.length < 1 %>
- <em>You have not created any elections.</em>
+ <p><em>You have not created any elections.</em></p>
<% else %>
<ul>
<% for election in @current_elections %>
</ul>
<% end %>
-<p><%= link_to "Create a new election", :controller => 'election', :action => 'new' %></p>
-<p></p>
-
<% else %>
<p>You must have an account to start a new vote or to administer an
- existing vote. You can log in or create a new account below.</p>
+ existing vote. You can log in <!-- or create a new account -->below.</p>
<%= render :partial => 'basic_login' %>
<% end %>
+ <p>Full elections creation is not yet public. <%= link_to("Contact us",
+ "mailto:team@selectricity.org") %> for access.</p>
</div>
</div>
<% else %>
<%= link_to("login", :controller => "account", :action => "login")
%>
- <%= link_to("sign up", :controller => "account",
- :action => "signup")%>
+ <%= link_to "sign up", :controller => "account",
+ :action => "signup" %>
<% end -%>
- <%= link_to("help/about", :controller => "site",
- :action => 'about')%>
+ <%= link_to "help/about", :controller => 'about' %>
</div>
<a href="index.html"><h1>selectricity: voting machinery for the masses</h1></a>
</div>
<div id="page-wrapper">
<div id="left-side">
- <%= link_to "<h1>Selectricity</h1>",
- :controller => 'site', :action => 'index' %>
+ <%= link_to "<h1>Selectricity</h1>", :controller => 'front' %>
<div id="left-side-content">
<% if flash[:notice]%>
<%= link_to "logout", :controller => "account",
:action => "logout" %>
<% else %>
- <%= link_to("login", :controller => "account", :action => "login")
- %>/<%= link_to("sign up", :controller => "account", :action => "signup")%>
+ <%= link_to "login", :controller => "account", :action => "login"
+ %>/<%= link_to "sign up", :controller => "account", :action => "signup" %>
<% end %>
</div>
<div id="bar-right">
- <%= link_to("help/about", :controller => "site", :action => "about") %>
+ <%= link_to "help/about", :controller => 'about' %>
</div>
</div> <!-- end of top-bar -->
<p>Sorry, the creator of this QuickVote has decided this election shouldn't
be visible while the QuickVote is running. </p>
-<%= link_to "Selectricity Home", :controller => 'site' %>
\ No newline at end of file
+<%= link_to "Selectricity Home", :controller => 'front' %>
# You can have the root of your site routed by hooking up ''
# -- just remember to delete public/index.html.
- map.connect 'index.html', :controller => "site", :action => "index"
- map.connect '', :controller => "site", :action => "index"
+ map.connect '', :controller => "front"
+
map.connect '/sitealizer/:action', :controller => 'sitealizer'
+
+
map.connect 'quickvote/:action/:id',
:controller => 'quickvote',
:requirements => { :action => /(create|add_candidate|sort_candidates|my_quickvotes)/ }
--- /dev/null
+election.css
\ No newline at end of file
--- /dev/null
+election.css
\ No newline at end of file
color: #dc0d13;
}
-#title-header {
- background-color: #dc0d13;
-}
-
#title-header .header {
background-color: #dc0d13;
}
width: 400px;
border-width: 2px;
border-style: solid;
- border-color: #73BF26;
+ border-color: #999999;
padding: 7px;
padding-bottom: 12px;
margin-bottom: 20px;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
- background-color: #73BF26;
+ background-color: #999999;
color: #fff;
border-bottom: 0px;
}
width: 400px;
border-width: 2px;
border-style: solid;
- border-color: #4D801A;
+ border-color: #dc0d13;
padding: 7px;
padding-bottom: 12px;
margin-bottom: 20px;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
- background-color: #4D801A;
+ background-color: #dc0d13;
color: #fff;
border-bottom: 0px;
}
padding: 5px;
}
-#election_creation_progress_bar ul li {
+#progress_bar ul li {
display: block;
list-style: default;
}
-#election_creation_progress_bar li.step_selected {
+#progress_bar li.step_selected {
+ font-weight: bold;
+}
+
+#progress_bar li.step_unselected {
+ color: #CCCCCC;
font-weight: bold;
}
-#election_creation_progress_bar li.step_unselected {
+#progress_bar li.step_unselected {
color: #CCCCCC;
font-weight: bold;
}
+#progress_bar li.step_unselected a {
+ text-decoration: none;
+}
+
+div.photo {
+ text-align: center;
+ margin-bottom: 1.5em;
+}
+div.photo img {
+ border: 1px black solid;
+}
color: #005cd9;
}
-#title-header {
- background-color: #005cd9;
-}
-
#title-header .header {
background-color: #005cd9;
}
require File.dirname(__FILE__) + '/../test_helper'
-require 'site_controller'
+require 'front_controller'
# Re-raise errors caught by the controller.
-class SiteController; def rescue_action(e) raise e end; end
+class FrontController; def rescue_action(e) raise e end; end
-class SiteControllerTest < Test::Unit::TestCase
+class FrontControllerTest < Test::Unit::TestCase
def setup
- @controller = SiteController.new
+ @controller = FrontController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end