Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit. Go, democracy!

commit 325cfbddbf7d47b913b2eefe22d2ff27dd9209e0 0 parents
@paulsmith paulsmith authored
Showing with 7,988 additions and 0 deletions.
  1. +18 −0 .gitignore
  2. +1 −0  .rbenv-version
  3. +1 −0  .rspec
  4. +43 −0 Gemfile
  5. +240 −0 Gemfile.lock
  6. +12 −0 LICENSE.md
  7. +127 −0 README.md
  8. +8 −0 Rakefile
  9. BIN  app/assets/images/rails.png
  10. BIN  app/assets/images/sign-in-with-twitter-d.png
  11. +16 −0 app/assets/javascripts/application.js
  12. +4 −0 app/assets/javascripts/bootstrap.js.coffee
  13. +3 −0  app/assets/javascripts/guidelines.js.coffee
  14. +3 −0  app/assets/javascripts/home.js.coffee
  15. +25 −0 app/assets/javascripts/register.js.coffee
  16. +3 −0  app/assets/stylesheets/application.css
  17. +476 −0 app/assets/stylesheets/bootstrap_and_overrides.css.less
  18. +3 −0  app/assets/stylesheets/guidelines.css.less
  19. +46 −0 app/assets/stylesheets/register.css.less
  20. +10 −0 app/assets/stylesheets/variables.less
  21. +10 −0 app/controllers/application_controller.rb
  22. +15 −0 app/controllers/guidelines_controller.rb
  23. +7 −0 app/controllers/home_controller.rb
  24. +67 −0 app/controllers/register_controller.rb
  25. +21 −0 app/controllers/sessions_controller.rb
  26. +3 −0  app/helpers/application_helper.rb
  27. +2 −0  app/helpers/guidelines_helper.rb
  28. +2 −0  app/helpers/home_helper.rb
  29. +20 −0 app/helpers/register_helper.rb
  30. 0  app/mailers/.gitkeep
  31. 0  app/models/.gitkeep
  32. +11 −0 app/models/admin.rb
  33. +3 −0  app/models/ethnicity.rb
  34. +7 −0 app/models/guidelines.rb
  35. +3 −0  app/models/instructions.rb
  36. +4 −0 app/models/political_party.rb
  37. +43 −0 app/models/register.rb
  38. +83 −0 app/pdfs/registration_pdf.rb
  39. +27 −0 app/views/guidelines/index.html.erb
  40. +83 −0 app/views/guidelines/show.html.erb
  41. +37 −0 app/views/home/index.html.erb
  42. +6 −0 app/views/layouts/_flash.html.erb
  43. +55 −0 app/views/layouts/application.html.erb
  44. +8 −0 app/views/pages/terms.html.erb
  45. +110 −0 app/views/register/_form.html.erb
  46. +22 −0 app/views/register/complete.html.erb
  47. +13 −0 app/views/register/index.html.erb
  48. +36 −0 app/views/register/new.html.erb
  49. +6 −0 config.ru
  50. +76 −0 config/application.rb
  51. +6 −0 config/boot.rb
  52. +25 −0 config/database.yml
  53. +5 −0 config/environment.rb
  54. +41 −0 config/environments/development.rb
  55. +68 −0 config/environments/production.rb
  56. +37 −0 config/environments/test.rb
  57. +7 −0 config/initializers/backtrace_silencers.rb
  58. +216 −0 config/initializers/devise.rb
  59. +15 −0 config/initializers/inflections.rb
  60. +9 −0 config/initializers/mail.rb
  61. +5 −0 config/initializers/mime_types.rb
  62. +4 −0 config/initializers/omniauth.rb
  63. +125 −0 config/initializers/rails_admin.rb
  64. +7 −0 config/initializers/secret_token.rb
  65. +8 −0 config/initializers/session_store.rb
  66. +178 −0 config/initializers/simple_form.rb
  67. +14 −0 config/initializers/wrap_parameters.rb
  68. +57 −0 config/locales/devise.en.yml
  69. +36 −0 config/locales/en.yml
  70. +26 −0 config/locales/simple_form.en.yml
  71. +20 −0 config/routes.rb
  72. +6 −0 data/README.md
  73. +439 −0 data/instructions.yml
  74. +53 −0 data/state_deadlines.en.json
  75. +3,726 −0 data/state_info_en.yml
  76. +18 −0 db/migrate/20120802170822_create_guidelines.rb
  77. +8 −0 db/migrate/20120804172146_add_mailing_address_to_guidelines.rb
  78. +6 −0 db/migrate/20120806173035_add_online_name_to_guidelines.rb
  79. +9 −0 db/migrate/20120806222856_create_political_parties.rb
  80. +46 −0 db/migrate/20120806234829_devise_create_admins.rb
  81. +18 −0 db/migrate/20120806234830_create_rails_admin_histories_table.rb
  82. +6 −0 db/migrate/20120807173451_add_online_requirements_to_guidelines.rb
  83. +9 −0 db/migrate/20120807185224_create_ethnicities.rb
  84. +6 −0 db/migrate/20120807193101_add_supported_to_guidelines.rb
  85. +13 −0 db/migrate/20120807234854_create_instructions.rb
  86. +94 −0 db/schema.rb
  87. +86 −0 db/seeds.rb
  88. +26 −0 doc/Modifying-Page-Content.md
  89. +44 −0 doc/Providers.md
  90. +7 −0 doc/README.md
  91. +9 −0 doc/Voter-PDF-Form.md
  92. 0  lib/assets/.gitkeep
  93. 0  lib/tasks/.gitkeep
  94. +67 −0 lib/tasks/load_state_info.rake
  95. +13 −0 lib/templates/erb/scaffold/_form.html.erb
  96. 0  log/.gitkeep
  97. +41 −0 public/404.html
  98. +41 −0 public/422.html
  99. +39 −0 public/500.html
  100. 0  public/favicon.ico
  101. BIN  public/nvra-en.pdf
  102. +5 −0 public/robots.txt
  103. +6 −0 script/rails
  104. +28 −0 spec/controllers/guidelines_controller_spec.rb
  105. +18 −0 spec/controllers/home_controller_spec.rb
  106. +128 −0 spec/controllers/register_controller_spec.rb
  107. +39 −0 spec/controllers/sessions_controller_spec.rb
  108. +7 −0 spec/factories/ethnicities.rb
  109. +9 −0 spec/factories/guidelines.rb
  110. +11 −0 spec/factories/instructions.rb
  111. +14 −0 spec/helpers/guidelines_helper_spec.rb
  112. +14 −0 spec/helpers/home_helper_spec.rb
  113. +28 −0 spec/helpers/register_helper_spec.rb
  114. +4 −0 spec/models/admin_spec.rb
  115. +4 −0 spec/models/ethnicity_spec.rb
  116. +4 −0 spec/models/guidelines_spec.rb
  117. +4 −0 spec/models/instructions_spec.rb
  118. +4 −0 spec/models/political_party_spec.rb
  119. +36 −0 spec/models/register_spec.rb
  120. +55 −0 spec/spec_helper.rb
  121. +4 −0 spec/views/guidelines/index.html.erb_spec.rb
  122. +4 −0 spec/views/home/index.html.erb_spec.rb
  123. +4 −0 spec/views/register/index.html.erb_spec.rb
  124. 0  vendor/assets/javascripts/.gitkeep
  125. 0  vendor/assets/stylesheets/.gitkeep
  126. 0  vendor/plugins/.gitkeep
18 .gitignore
@@ -0,0 +1,18 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile ~/.gitignore_global
+
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
+
+#Ignore the coverage directory
+coverage
1  .rbenv-version
@@ -0,0 +1 @@
+1.9.3-p194
1  .rspec
@@ -0,0 +1 @@
+--color
43 Gemfile
@@ -0,0 +1,43 @@
+source 'https://rubygems.org'
+ruby '1.9.3'
+
+gem 'rails', '3.2.8'
+
+gem 'active_attr'
+gem 'devise'
+gem 'encrypted-cookie-store'
+gem 'high_voltage'
+gem 'jquery-rails'
+gem 'omniauth', '~> 1.1.0'
+gem 'omniauth-twitter'
+gem 'prawn'
+gem 'prawn-fillform'
+gem 'rails_admin', '~> 0.0.5'
+gem 'simple_form'
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'less-rails', '~> 2.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+ gem 'uglifier', '>= 1.0.3'
+ gem 'therubyracer'
+ gem 'twitter-bootstrap-rails'
+end
+
+group :test, :development do
+ gem 'rspec-rails', '~> 2.0'
+ gem 'sqlite3'
+ gem 'faker'
+ gem 'factory_girl_rails', '~> 4.0'
+end
+
+group :test do
+ gem 'simplecov', :require => false
+end
+
+group :production do
+ gem 'pg', '0.14.0'
+ gem 'puma'
+end
+
240 Gemfile.lock
@@ -0,0 +1,240 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ Ascii85 (1.0.1)
+ actionmailer (3.2.8)
+ actionpack (= 3.2.8)
+ mail (~> 2.4.4)
+ actionpack (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.3)
+ active_attr (0.6.0)
+ activemodel (>= 3.0.2, < 4.1)
+ activesupport (>= 3.0.2, < 4.1)
+ activemodel (3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ activerecord (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ activesupport (3.2.8)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ bbenezech-nested_form (0.0.6)
+ bcrypt-ruby (3.0.1)
+ bootstrap-sass (2.0.4.0)
+ builder (3.0.0)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.3)
+ commonjs (0.2.6)
+ devise (2.1.0)
+ bcrypt-ruby (~> 3.0)
+ orm_adapter (~> 0.0.7)
+ railties (~> 3.1)
+ warden (~> 1.1.1)
+ diff-lcs (1.1.3)
+ encrypted-cookie-store (1.0)
+ encrypted-cookies (~> 1.0)
+ rails (~> 3.0)
+ encrypted-cookies (1.0)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ factory_girl (4.0.0)
+ activesupport (>= 3.0.0)
+ factory_girl_rails (4.0.0)
+ factory_girl (~> 4.0.0)
+ railties (>= 3.0.0)
+ faker (1.0.1)
+ i18n (~> 0.4)
+ haml (3.1.6)
+ hashie (1.2.0)
+ high_voltage (1.1.1)
+ hike (1.2.1)
+ hpricot (0.8.6)
+ i18n (0.6.0)
+ journey (1.0.4)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ jquery-ui-rails (1.1.0)
+ jquery-rails
+ railties (>= 3.1.0)
+ json (1.7.4)
+ kaminari (0.13.0)
+ actionpack (>= 3.0.0)
+ activesupport (>= 3.0.0)
+ railties (>= 3.0.0)
+ less (2.2.1)
+ commonjs (~> 0.2.6)
+ less-rails (2.2.3)
+ actionpack (>= 3.1)
+ less (~> 2.2.0)
+ libv8 (3.3.10.4)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.3.6)
+ oauth (0.4.6)
+ omniauth (1.1.0)
+ hashie (~> 1.2)
+ rack
+ omniauth-oauth (1.0.0)
+ oauth
+ omniauth (~> 1.0)
+ omniauth-twitter (0.0.8)
+ omniauth-oauth (~> 1.0)
+ orm_adapter (0.0.7)
+ pdf-reader (1.1.1)
+ Ascii85 (~> 1.0.0)
+ ruby-rc4
+ pg (0.14.0)
+ polyglot (0.3.3)
+ prawn (0.12.0)
+ pdf-reader (>= 0.9.0)
+ ttfunk (~> 1.0.2)
+ prawn-fillform (0.0.12)
+ puma (1.5.0)
+ rack (~> 1.2)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-pjax (0.5.9)
+ hpricot (~> 0.8.6)
+ rack (~> 1.3)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.8)
+ actionmailer (= 3.2.8)
+ actionpack (= 3.2.8)
+ activerecord (= 3.2.8)
+ activeresource (= 3.2.8)
+ activesupport (= 3.2.8)
+ bundler (~> 1.0)
+ railties (= 3.2.8)
+ rails_admin (0.0.5)
+ bbenezech-nested_form (~> 0.0.6)
+ bootstrap-sass (~> 2.0, >= 2.0.3)
+ builder (~> 3.0)
+ coffee-rails (~> 3.1)
+ haml (~> 3.1)
+ jquery-rails (>= 1.0.17)
+ jquery-ui-rails (>= 0.5, < 2)
+ kaminari (~> 0.12)
+ rack-pjax (~> 0.5)
+ rails (~> 3.1)
+ remotipart (~> 1.0)
+ sass-rails (~> 3.1)
+ railties (3.2.8)
+ actionpack (= 3.2.8)
+ activesupport (= 3.2.8)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ remotipart (1.0.2)
+ rspec (2.11.0)
+ rspec-core (~> 2.11.0)
+ rspec-expectations (~> 2.11.0)
+ rspec-mocks (~> 2.11.0)
+ rspec-core (2.11.1)
+ rspec-expectations (2.11.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.11.1)
+ rspec-rails (2.11.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.11.0)
+ ruby-rc4 (0.1.5)
+ sass (3.1.20)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ simple_form (2.0.2)
+ actionpack (~> 3.0)
+ activemodel (~> 3.0)
+ simplecov (0.6.4)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.5.3)
+ simplecov-html (0.5.3)
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
+ therubyracer (0.10.1)
+ libv8 (~> 3.3.10)
+ thor (0.15.4)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ ttfunk (1.0.3)
+ twitter-bootstrap-rails (2.1.2)
+ actionpack (>= 3.1)
+ less-rails (~> 2.2.3)
+ railties (>= 3.1)
+ tzinfo (0.3.33)
+ uglifier (1.2.7)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.3)
+ warden (1.1.1)
+ rack (>= 1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ active_attr
+ coffee-rails (~> 3.2.1)
+ devise
+ encrypted-cookie-store
+ factory_girl_rails (~> 4.0)
+ faker
+ high_voltage
+ jquery-rails
+ less-rails (~> 2.2.3)
+ omniauth (~> 1.1.0)
+ omniauth-twitter
+ pg (= 0.14.0)
+ prawn
+ prawn-fillform
+ puma
+ rails (= 3.2.8)
+ rails_admin (~> 0.0.5)
+ rspec-rails (~> 2.0)
+ simple_form
+ simplecov
+ sqlite3
+ therubyracer
+ twitter-bootstrap-rails
+ uglifier (>= 1.0.3)
12 LICENSE.md
@@ -0,0 +1,12 @@
+Copyright © 2012 DNC Services Corporation
+http://www.democrats.org/
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+This permission does not include: (a) any use of the Software other than for its intended purpose; or (b) any use of the Software in any manner that violates applicable law. Any use of the Software other than as specifically authorized herein is strictly prohibited and will terminate the license granted herein.
+
+All information, dates and content included in the Software are subject to change given the subject matter of the Software. It is the responsibility of the user of the Software hereunder to monitor changes in applicable law. Future versions of the Software may include updated content to reflect any changes in applicable law.
127 README.md
@@ -0,0 +1,127 @@
+#Voter Registration
+
+##About
+
+We need more Americans to have a say in their government, not just the special interests. That's why we should be taking down roadblocks to voting. We believe in an America where everybody can make their voices heard.
+
+That is why the Democratic National Committee created this open source application to provide more opportunities to register to vote in November! States have varying laws for voter registration, so this application is a one stop shop that contains all the voter registration information and voting checklists that you will need to vote. **This information should not be altered.**
+
+You can help all eligible voters register to vote by using this software.
+
+# What is it?
+
+A Ruby on Rails Application that generates a [National Voter Registration Form](http://www.eac.gov/voter_resources/register_to_vote.aspx) PDF from a webform.
+Includes the guidelines for the National Voter Registration form in all states.
+
+## Demo
+You can see a running version of the application at [http://voter-registration.herokuapp.com/](http://voter-registration.herokuapp.com/)
+
+## Requirements
+1. Make sure the machine that you're using has Ruby 1.9.3 installed.
+ We use [rbenv](https://github.com/sstephenson/rbenv/) for Ruby version management
+2. You'll need the RubyGem "bundler" installed.
+
+## Installation
+
+ git clone git@github.com:ofa/voter-registration.git
+ cd voter-registration
+ bundle install
+ rake db:migrate
+ rake db:seed #This will load all the State information
+
+## Usage
+ rails server
+
+Open up your browser and go to http://localhost:3000
+
+## Deploying to [Heroku](http://www.heroku.com)
+You can setup a Heroku account for free [https://devcenter.heroku.com/articles/quickstart](https://devcenter.heroku.com/articles/quickstart)
+
+ heroku create
+ heroku addons:add sendgrid:starter #Free addon used for devise emails
+ git push heroku master
+ heroku run rake db:migrate
+ heroku run rake db:seed
+
+## Running Tests
+
+We use RSpec for tests: `bundle exec rake spec`
+
+## Admin the pages
+We use [rails_admin](https://www.github.com/sferik/rails_admin) to manage the State Guidelines
+Go to "/admin" to login and manage the Guidelines
+
+The default email: admin@example.com
+The default password: p@ssw0rd
+
+## Supported Ruby Versions
+This application aims to support and is tested against the following Ruby
+implementations:
+
+* Ruby 1.9.2
+* Ruby 1.9.3
+
+## Contributing
+In the spirit of [free software][free-sw], **everyone** is encouraged to help
+improve this project.
+
+[free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
+
+Here are some ways *you* can contribute:
+
+* by using alpha, beta, and prerelease versions
+* by reporting bugs
+* by suggesting new features
+* by [translating to a new language][locales]
+* by writing or editing documentation
+* by writing specifications
+* by writing code (**no patch is too small**: fix typos, add comments, clean up
+ inconsistent whitespace)
+* by refactoring code
+* by closing [issues][]
+* by reviewing patches
+
+[locales]: https://github.com/democrats/voter-registration/tree/master/config/locales
+[issues]: https://github.com/democrats/voter-registration/issues
+
+## Submitting an Issue
+We use the [GitHub issue tracker][issues] to track bugs and features. Before
+submitting a bug report or feature request, check to make sure it hasn't
+already been submitted. You can indicate support for an existing issue by
+voting it up. When submitting a bug report, please include a [Gist][] that
+includes a stack trace and any details that may be necessary to reproduce the
+bug, including your gem version, Ruby version, and operating system. Ideally, a
+bug report should include a pull request with failing specs.
+
+[gist]: https://gist.github.com/
+
+## Submitting a Pull Request
+1. Fork the project.
+2. Create a topic branch. (`git checkout -b my_awesome_branch`)
+3. Implement your feature or bug fix.
+4. Add tests for your feature or bug fix.
+5. Run `bundle exec rake spec`. If your changes are not 100% covered, go back
+ to step 4.
+6. Commit your changes. (`git commit -am "Added some cool things"`)
+7. Push to the branch (`git push origin my_awesome_branch`)
+8. Submit a [pull request](https://help.github.com/articles/using-pull-requests/)
+
+## Documentation
+
+Documentation is available in the **/doc** directory in the root of the project.
+
+## License
+
+Copyright © 2012 DNC Services Corporation
+http://www.democrats.org/
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+This permission does not include: (a) any use of the Software other than for its intended purpose; or (b) any use of the Software in any manner that violates applicable law. Any use of the Software other than as specifically authorized herein is strictly prohibited and will terminate the license granted herein.
+
+All information, dates and content included in the Software are subject to change given the subject matter of the Software. It is the responsibility of the user of the Software hereunder to monitor changes in applicable law. Future versions of the Software may include updated content to reflect any changes in applicable law.
+
8 Rakefile
@@ -0,0 +1,8 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+VoterRegistration::Application.load_tasks
+task :test => :spec
BIN  app/assets/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/sign-in-with-twitter-d.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 app/assets/javascripts/application.js
@@ -0,0 +1,16 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require twitter/bootstrap
+//= require_tree .
4 app/assets/javascripts/bootstrap.js.coffee
@@ -0,0 +1,4 @@
+jQuery ->
+ $("a[rel=popover]").popover()
+ $(".tooltip").tooltip()
+ $("a[rel=tooltip]").tooltip()
3  app/assets/javascripts/guidelines.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
3  app/assets/javascripts/home.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
25 app/assets/javascripts/register.js.coffee
@@ -0,0 +1,25 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
+$(document).scroll ->
+
+ # If has not activated (has no attribute "data-top"
+ unless $(".subnav").attr("data-top")
+
+ # If already fixed, then do nothing
+ return if $(".subnav").hasClass("subnav-fixed")
+
+ # Remember top position
+ offset = $(".subnav").offset()
+ $(".subnav").attr "data-top", offset.top
+ if $(".subnav").attr("data-top") - $(".subnav").outerHeight() <= $(this).scrollTop()
+ $(".subnav").addClass "subnav-fixed"
+ else
+ $(".subnav").removeClass "subnav-fixed"
+
+jQuery ->
+ $('#register_citizen').change ->
+ us_citizen = $('#register_citizen')
+ if us_citizen.is(":checked")
+ else
+ alert "You must be a U.S. citizen to vote."
3  app/assets/stylesheets/application.css
@@ -0,0 +1,3 @@
+/*
+ *= require_tree .
+*/
476 app/assets/stylesheets/bootstrap_and_overrides.css.less
@@ -0,0 +1,476 @@
+@import "twitter/bootstrap/bootstrap";
+body {
+ padding-top: 60px !important;
+}
+
+@import "twitter/bootstrap/responsive";
+
+// Set the correct sprite paths
+@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
+@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
+
+// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
+// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
+// have the proper paths. So for now we use the absolute path.
+//@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
+//@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
+//@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
+//@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
+
+// Font Awesome
+//@import "fontawesome";
+
+@import "variables";
+body {
+ margin: 0;
+ font-family: 'Crimson Text', "Times New Roman", Times, serif;
+ font-size: 17px;
+ line-height: 1.3em;
+ color: @grey;
+ background-color: @beige;
+}
+
+@linkColor: @blueDark;
+@dropdownLinkColor: @blueDark;
+
+.nav-list > .active > a,
+.nav-list > .active > a:hover {
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
+ background-color: @blueDark;
+}
+
+.nav-pills > .active > a,
+.nav-pills > .active > a:hover {
+ color: #ffffff;
+ background-color: @blueDark;
+}
+
+.nav-tabs .dropdown-toggle .caret,
+.nav-pills .dropdown-toggle .caret {
+ border-top-color: @blueDark;
+ border-bottom-color: @blueDark;
+ margin-top: 6px;
+}
+.navbar-inner {
+ min-height: 50px;
+ padding-left: 20px;
+ padding-right: 20px;
+ background-color: #fff !important;
+ background-repeat: repeat-x;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
+ -moz-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
+ border-bottom: 3px solid @beigeLight;
+ box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.25), 0 0 0 rgba(0, 0, 0, 0.1) inset;
+}
+
+.navbar {
+ color: @grey;
+}
+
+@navbarBrandColor: @grey;
+@navbarLinkColor: @blueDark;
+
+.navbar .brand {
+ font-weight: bold;
+ line-height: 1em;
+ padding: 10px 10px;
+ padding: 15px 10px 5px \0;
+}
+
+.navbar .nav > li > a {
+ float: none;
+ padding: 9px 10px 11px;
+ line-height: 19px;
+ color: @blueDark;
+ text-decoration: none;
+}
+.navbar .nav > li > a:hover {
+ background-color: transparent;
+ color: #c50001;
+ text-decoration: none;
+}
+
+.navbar .nav > li > a:hover {
+ background-color: transparent;
+ color: #c50001;
+ text-decoration: none;
+}
+
+@navbarLinkBackgroundActive: @beige;
+
+.navbar .divider-vertical {
+ height: 40px;
+ width: 1px;
+ margin: 0 9px;
+ overflow: hidden;
+ background-color: @beige;
+ border-right: 1px solid @beige;
+}
+
+.hero-unit {
+ margin-top: 50px;
+ padding: 20px 45px 30px;
+ margin-bottom: 30px;
+ background-color: #ffffff;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+}
+
+.well,
+.hero-unit {
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ border: 1px solid #D4D4D4;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 5px;
+ background-color: #ffffff;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ line-height: 2em;
+ color: @grey;
+}
+.navbar .nav > li.active > a,
+.navbar .open .dropdown-toggle {
+ color: @greyLight;
+}
+.navbar .nav li.dropdown.active > .dropdown-toggle,
+.navbar .nav li.dropdown.open > .dropdown-toggle,
+.navbar .nav li.dropdown.active.open > .dropdown-toggle {
+ color: @greyLight;
+}
+.navbar .nav li.dropdown .dropdown-toggle .caret,
+.navbar .nav li.dropdown.open .caret {
+ border-top-color: @blueDark;
+ opacity: 1;
+}
+
+.navbar .nav-collapse.in .nav li > a {
+ color: @blueDark;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 0;
+ font-weight: normal;
+}
+nav-tabs li.active > a,
+.nav-tabs li.active > a:hover {
+ color: @grey;
+ background-color: @beige;
+}
+.nav-pills li > a:hover {
+ background-color: @beige;
+}
+.nav-pills li.active > a,
+.nav-pills li.active > a:hover {
+ color: @grey;
+ background-color: @beige;
+}
+.nav-pills .open .dropdown-toggle {
+ background-color: transparent;
+ color: @blueDark;
+ border-left: 1px solid whiteSmoke;
+ border-right: 1px solid #E5E5E5;
+}
+.nav-pills li.dropdown.open .dropdown-toggle .caret {
+ border-top-color: @blueDark;
+}
+.nav-list li.active > a,
+.nav-list li.active > a:hover {
+ color: @grey;
+}
+.pagination li.active > a:hover {
+ color: @grey;
+ background-color: #F5F5F5;
+}
+div.subnav {
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 0;
+ font-size: 15px;
+
+ background-color: @tan;
+ background-image: none;
+}
+div.subnav .nav {
+ padding: 0;
+}
+div.subnav .nav > li.active > a,
+div.subnav .nav > li:active > a {
+ color: @greyLight;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ background-color: @beige;
+}
+div.subnav .nav > li > a:hover,
+div.subnav .nav > li.active > a:hover,
+div.subnav .nav > li:active > a:hover {
+ color: #c50001;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ background-color: transparent;
+}
+div.subnav-fixed {
+ left: auto;
+ width: 100%;
+ margin: 0;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ border: 1px solid #E5E5E5;
+}
+div.subnav-fixed .nav {
+ margin: 0 auto;
+ padding: 0 1px;
+ width: 938px;
+}
+
+
+.navbar .nav-collapse.in .nav li > a {
+ color: @blueDark;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 0;
+ font-weight: normal;
+}
+.nav-tabs li.active > a,
+.nav-tabs li.active > a:hover {
+ color: @grey;
+ background-color: @beige;
+}
+.nav-pills li > a:hover {
+ background-color: @beige;
+}
+.nav-pills li.active > a,
+.nav-pills li.active > a:hover {
+ color: @grey;
+ background-color: @beige;
+}
+.nav-pills .open .dropdown-toggle {
+ background-color: transparent;
+ color: @blueDark;
+ border-left: 1px solid whiteSmoke;
+ border-right: 1px solid #E5E5E5;
+}
+.nav-pills li.dropdown.open .dropdown-toggle .caret {
+ border-top-color: @blueDark;
+}
+.nav-list li.active > a,
+.nav-list li.active > a:hover {
+ color: @grey;
+}
+.pagination li.active > a:hover {
+ color: @grey;
+ background-color: #F5F5F5;
+}
+.btn-primary {
+ background-color: @blueDark;
+ background-image: -moz-linear-gradient(top, @blue, @blueDark);
+ background-image: -ms-linear-gradient(top, @blue, @blueDark);
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@blue), to(@blueDark));
+ background-image: -webkit-linear-gradient(top, @blue, @blueDark);
+ background-image: -o-linear-gradient(top, @blue, @blueDark);
+ background-image: linear-gradient(top, @blue, @blueDark);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cf0001', endColorstr='@blueDark', GradientType=0);
+ border-color: @blueDark @blueDark @blue;
+ *background-color: @blueDark;
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
+
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+}
+.btn-primary:active,
+.btn-primary.active,
+.btn-primary.disabled,
+.btn-primary[disabled] {
+ background-color: @blueDark;
+ *background-color: @blueDark;
+}
+.btn-primary:active,
+.btn-primary.active {
+ background-color: @blueDark;
+}
+.btn-primary[disabled] {
+ background-color: @blueDark;
+ *background-color: @blueDark;
+}
+.btn-primary:active,
+.btn-primary.active {
+ background-color: @blueDark;
+}
+input,
+textarea,
+select {
+ color: @grey;
+}
+
+.modal-footer {
+ background-color: @beige;
+}
+label,
+input,
+button,
+select,
+textarea {
+ font-size: 17px;
+ font-weight: normal;
+ line-height: 1.3em;
+}
+input,
+button,
+select,
+textarea {
+ font-family: 'Crimson Text', "Times New Roman", Times, serif;
+}
+
+.nav-list > .active > a,
+.nav-list > .active > a:hover {
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
+ background-color: @tan;
+}
+
+/* Sidenav for Docs
+-------------------------------------------------- */
+
+/* prevent column from collapsing when affixing */
+.span3 {
+ min-height: 1px;
+}
+
+.sidenav {
+ width: 228px;
+ margin: 30px 0 0;
+ padding: 0;
+ background-color: #fff;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+ -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
+ -moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
+ box-shadow: 0 1px 4px rgba(0,0,0,.065);
+}
+.sidenav > li > a {
+ display: block;
+ *width: 190px;
+ margin: 0 0 -1px;
+ padding: 8px 14px;
+ border: 1px solid #e5e5e5;
+}
+.sidenav > li:first-child > a {
+ -webkit-border-radius: 6px 6px 0 0;
+ -moz-border-radius: 6px 6px 0 0;
+ border-radius: 6px 6px 0 0;
+}
+.sidenav > li:last-child > a {
+ -webkit-border-radius: 0 0 6px 6px;
+ -moz-border-radius: 0 0 6px 6px;
+ border-radius: 0 0 6px 6px;
+}
+.sidenav > .active > a {
+ position: relative;
+ z-index: 2;
+ padding: 9px 15px;
+ border: 0;
+ text-shadow: 0 1px 0 rgba(0,0,0,.15);
+ -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
+ -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
+ box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
+}
+/* Chevrons */
+.sidenav .icon-chevron-right {
+ float: right;
+ margin-top: 2px;
+ margin-right: -6px;
+ opacity: .25;
+}
+.sidenav > li > a:hover {
+ background-color: @beige;
+}
+.sidenav a:hover .icon-chevron-right {
+ opacity: .5;
+}
+.sidenav .active .icon-chevron-right,
+.sidenav .active a:hover .icon-chevron-right {
+ background-image: url(@iconSpritePath);
+ opacity: 1;
+}
+.sidenav.affix {
+ top: 40px;
+}
+.sidenav.affix-bottom {
+ position: absolute;
+ top: auto;
+ bottom: 270px;
+}
+
+/* Responsive
+-------------------------------------------------- */
+
+/* Desktop large
+------------------------- */
+@media (min-width: 1200px) {
+ .sidenav {
+ width: 258px;
+ }
+}
+
+/* Desktop
+------------------------- */
+@media (max-width: 980px) {
+ /* When affixed, space properly */
+ .sidenav {
+ top: 0;
+ margin-top: 30px;
+ margin-right: 0;
+ }
+}
+
+/* Tablet to desktop
+------------------------- */
+@media (min-width: 768px) and (max-width: 980px) {
+ /* Adjust sidenav width */
+ .sidenav {
+ width: 166px;
+ margin-top: 20px;
+ }
+ .sidenav.affix {
+ top: 0;
+ }
+}
+
+/* Tablet
+------------------------- */
+@media (max-width: 768px) {
+ /* Sidenav */
+ .sidenav {
+ width: auto;
+ margin-bottom: 20px;
+ }
+ .sidenav.affix {
+ position: static;
+ width: auto;
+ top: 0;
+ }
+}
+
3  app/assets/stylesheets/guidelines.css.less
@@ -0,0 +1,3 @@
+// Place all the styles related to the guidelines controller here.
+// They will automatically be included in application.css.
+// You can use Less here: http://lesscss.org/
46 app/assets/stylesheets/register.css.less
@@ -0,0 +1,46 @@
+// Place all the styles related to the register controller here.
+// They will automatically be included in application.css.
+// You can use Less here: http://lesscss.org/
+
+@media (max-width: 979px) {
+ body {
+ padding-top: 0 !important;
+ }
+ .hero-unit {
+ margin-top: 15px;
+ }
+ h1 {
+ padding-top: 0;
+ }
+ .subnav .nav > li > a {
+ border-right: 0;
+ }
+ .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner {
+ padding: 1px 3px 0 10px !important;
+}
+}
+
+.section-header {
+ text-align: center;
+ margin: 0px 0 10px;
+ border-bottom: 1px solid #ccc;
+}
+
+.footer {
+ padding: 70px 0;
+ margin-top: 70px;
+ border-top: 1px solid #e5e5e5;
+ background-color: #f5f5f5;
+}
+.footer p {
+ margin-bottom: 0;
+ color: #777;
+}
+.footer-links {
+ margin: 10px 0;
+}
+.footer-links li {
+ display: inline;
+ margin-right: 10px;
+}
+
10 app/assets/stylesheets/variables.less
@@ -0,0 +1,10 @@
+
+@red: #6688BB;
+@grey: #283744;
+@greyLight: #7B8784;
+@tan: #F3EfE0;
+@beige: #FAF9F5;
+@beigeLight: #F8F5EB;
+@blueDark: #4574BA;
+@blue: #6688BB;
+@blueLight: #6699CC;
10 app/controllers/application_controller.rb
@@ -0,0 +1,10 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+
+ before_filter :set_locale
+
+ def set_locale
+ I18n.locale = params[:locale] || I18n.default_locale
+ end
+
+end
15 app/controllers/guidelines_controller.rb
@@ -0,0 +1,15 @@
+class GuidelinesController < ApplicationController
+ def index
+ @states = Guidelines.all
+ end
+
+ def show
+ @guidelines = Guidelines.find_by_state(params[:id])
+
+ if @guidelines.nil?
+ redirect_to guidelines_path, :alert => "Invalid state"
+ end
+
+ end
+
+end
7 app/controllers/home_controller.rb
@@ -0,0 +1,7 @@
+class HomeController < ApplicationController
+ def index
+ if params[:state]
+ redirect_to register_new_path(params[:state])
+ end
+ end
+end
67 app/controllers/register_controller.rb
@@ -0,0 +1,67 @@
+class RegisterController < ApplicationController
+ def index
+ unless params[:state].blank?
+ redirect_to register_new_path(params[:state])
+ end
+
+ end
+
+ def new
+
+ session[:register] = nil
+ @guidelines = Guidelines.find_by_state(params[:state])
+ @state = params[:state]
+
+
+ if @guidelines.nil?
+ redirect_to register_index_path, :alert => "Invalid State"
+ else
+ @instructions = Instructions.where(:state => @state)
+ if session[:user].nil?
+ @register = Register.new
+ else
+ auth = session[:user]
+ name = auth.info.name.split
+ @register = Register.new(:first_name => name[0], :last_name => name[1], :home_city => auth.info.location)
+ end
+ end
+ end
+
+ def create
+ birth_date = Date.strptime("#{params[:register]['date_of_birth(2i)']}/#{params[:register]['date_of_birth(3i)']}/#{params[:register]['date_of_birth(1i)']}", '%m/%d/%Y')
+ #Assembling the multi parameter because active_attr doesn't support this yet
+ #see - https://github.com/cgriego/active_attr/issues/9
+
+ @register = Register.new(params[:register].merge(:date_of_birth => birth_date))
+ @state = params[:state]
+
+ if @register.valid?
+ session[:register] = @register
+ redirect_to register_complete_path(@register.home_state), :notice => "Registration Complete"
+ else
+ @guidelines = Guidelines.find_by_state(@state)
+ @instructions = Instructions.where(:state => @state)
+ render :action => 'new'
+ end
+ end
+
+ def complete
+
+ if session[:register].blank?
+ redirect_to root_path
+ else
+ @register = session[:register]
+ @state_info = Guidelines.find_by_state(@register.home_state)
+
+ respond_to do |format|
+ format.html
+ format.pdf do
+ pdf = RegistrationPdf.new(@register, @state_info, view_context)
+ send_data pdf.render, filename: "voter_registration.pdf",
+ type: "application/pdf",
+ disposition: "attachment"
+ end
+ end
+ end
+ end
+end
21 app/controllers/sessions_controller.rb
@@ -0,0 +1,21 @@
+class SessionsController < ApplicationController
+ def create
+ session[:user] = auth_hash
+ redirect_to request.env['omniauth.origin']
+ end
+
+ def error
+ flash[:error] = "Sign in failed"
+ redirect_to request.env['omniauth.origin']
+ end
+
+ protected
+
+ def auth_hash
+ auth = request.env['omniauth.auth']
+ unless auth.extra.nil?
+ auth = request.env['omniauth.auth'].except("extra")
+ end
+ auth
+ end
+end
3  app/helpers/application_helper.rb
@@ -0,0 +1,3 @@
+module ApplicationHelper
+
+end
2  app/helpers/guidelines_helper.rb
@@ -0,0 +1,2 @@
+module GuidelinesHelper
+end
2  app/helpers/home_helper.rb
@@ -0,0 +1,2 @@
+module HomeHelper
+end
20 app/helpers/register_helper.rb
@@ -0,0 +1,20 @@
+module RegisterHelper
+
+ def help_text(instructions, field_name)
+ unless instructions.nil?
+ info = instructions.detect { |f| f[:name] == field_name }
+ if info
+ info.help_text
+ end
+ end
+ end
+
+ def title_select
+ ["Mr.","Mrs.","Miss","Ms."]
+ end
+
+ def suffix_select
+ ["Jr","Sr","II","III","IV"]
+ end
+
+end
0  app/mailers/.gitkeep
No changes.
0  app/models/.gitkeep
No changes.
11 app/models/admin.rb
@@ -0,0 +1,11 @@
+class Admin < ActiveRecord::Base
+ # Include default devise modules. Others available are:
+ # :token_authenticatable, :confirmable,
+ # :lockable, :timeoutable and :omniauthable
+ devise :database_authenticatable,
+ :recoverable, :rememberable, :trackable, :validatable
+
+ # Setup accessible (or protected) attributes for your model
+ attr_accessible :email, :password, :password_confirmation, :remember_me
+ # attr_accessible :title, :body
+end
3  app/models/ethnicity.rb
@@ -0,0 +1,3 @@
+class Ethnicity < ActiveRecord::Base
+ attr_accessible :name
+end
7 app/models/guidelines.rb
@@ -0,0 +1,7 @@
+class Guidelines < ActiveRecord::Base
+ attr_accessible :deadline, :early_voting, :felony, :identification, :locale, :requirements, :same_day, :state, :student, :url,
+ :mail_to_address_1, :mail_to_address_2, :mail_to_address_3, :mail_to_address_4, :name, :online, :online_requirements, :online_url,
+ :supported, :unsupported
+
+ default_scope order("name")
+end
3  app/models/instructions.rb
@@ -0,0 +1,3 @@
+class Instructions < ActiveRecord::Base
+ attr_accessible :help_text, :locale, :name, :required, :state
+end
4 app/models/political_party.rb
@@ -0,0 +1,4 @@
+class PoliticalParty < ActiveRecord::Base
+ attr_accessible :name
+ default_scope order("name")
+end
43 app/models/register.rb
@@ -0,0 +1,43 @@
+class Register
+ include ActiveAttr::Model
+
+ attribute :citizen
+ attribute :title
+ attribute :first_name
+ attribute :middle_name
+ attribute :last_name
+ attribute :name_suffix
+ attribute :home_address
+ attribute :home_apt
+ attribute :home_city
+ attribute :home_state
+ attribute :home_zip_code
+ attribute :mailing_address
+ attribute :mailing_apt
+ attribute :mailing_city
+ attribute :mailing_state
+ attribute :mailing_zip_code
+ attribute :previous_address
+ attribute :previous_apt
+ attribute :previous_city
+ attribute :previous_state
+ attribute :previous_zip_code
+ attribute :previous_title
+ attribute :previous_first_name
+ attribute :previous_middle_name
+ attribute :previous_last_name
+ attribute :previous_suffix
+ attribute :date_of_birth
+ attribute :phone
+ attribute :id_number
+ attribute :political_party
+ attribute :ethnicity
+
+ attr_accessible :citizen, :title, :first_name, :middle_name, :last_name, :home_address, :home_apt, :home_city, :home_state, :home_zip_code,
+ :mailing_address, :mailing_apt, :mailing_city, :mailing_state, :mailing_zip_code, :previous_address, :previous_apt,
+ :previous_city, :previous_state, :previous_zip_code, :previous_title, :previous_first_name, :previous_middle_name,
+ :previous_last_name, :date_of_birth, :phone, :id_number, :political_party, :ethnicity, :name_suffix, :previous_suffix
+
+ validates_presence_of :title, :first_name, :last_name, :home_address, :home_city, :home_state, :home_zip_code, :date_of_birth, :id_number
+
+end
83 app/pdfs/registration_pdf.rb
@@ -0,0 +1,83 @@
+require 'prawn-fillform'
+
+class RegistrationPdf < Prawn::Document
+ def initialize(register, state_info, view)
+ filename = "#{Rails.root}/public/nvra-en.pdf"
+ super(:template => filename)
+
+ font("Helvetica", :size=> 10)
+
+ #Secretary of State
+ text_box state_info.mail_to_address_1, :at => [80, cursor-550]
+ text_box state_info.mail_to_address_2, :at => [80, cursor-580]
+ text_box state_info.mail_to_address_3, :at => [80, cursor-610]
+ text_box state_info.mail_to_address_4, :at => [80, cursor-640]
+
+ go_to_page(2)
+ #Age / Citizen
+ text_box "X", :at => [175, cursor-22]
+ text_box "X", :at => [175, cursor-35]
+
+ #Name - Box1
+ text_box register.title, :at => [5, cursor-80]
+ text_box register.last_name, :at => [70, cursor-80]
+ text_box register.first_name, :at => [200, cursor-80]
+ text_box register.middle_name, :at => [340, cursor-80]
+ text_box register.name_suffix, :at => [480, cursor-80]
+
+ #Home Address - Box2
+ text_box register.home_address, :at => [1, cursor-110]
+ text_box register.home_apt, :at => [225, cursor-110]
+ text_box register.home_city, :at => [282, cursor-110]
+ text_box register.home_state, :at => [400, cursor-110]
+ text_box register.home_zip_code, :at => [468, cursor-110]
+
+ #Mailing Address - Box3
+ text_box "#{register.mailing_address} #{register.mailing_apt}", :at => [1, cursor-140]
+ text_box register.mailing_city, :at => [282, cursor-140]
+ text_box register.mailing_state, :at => [400, cursor-140] unless register.mailing_state.nil?
+ text_box register.mailing_zip_code, :at => [468, cursor-140]
+
+ #DOB,Race,Ethnicity,Political Party, ID - Boxes 4,5,6,7,8
+ text_box register.date_of_birth.strftime("%m %d %Y"), :at => [63, cursor-165]
+ text_box register.phone, :at => [160, cursor-175]
+ text_box register.id_number, :at => [310, cursor-190]
+ text_box register.political_party, :at => [1, cursor-210]
+ text_box register.ethnicity, :at => [160, cursor-210]
+
+ #Previous Name - Box A
+ text_box register.previous_title, :at => [-4, cursor-430] unless register.previous_title.nil?
+ text_box register.previous_last_name, :at => [17, cursor-430]
+ text_box register.previous_first_name, :at => [200, cursor-430]
+ text_box register.previous_middle_name, :at => [345, cursor-430]
+ text_box register.previous_suffix, :at => [480, cursor-430]
+
+ #Previous Address - Box B
+ text_box register.previous_address, :at => [1,cursor-475]
+ text_box register.previous_apt, :at => [220,cursor-475]
+ text_box register.previous_city, :at => [290, cursor-475]
+ text_box register.previous_state, :at => [400, cursor-475] unless register.previous_state.nil?
+ text_box register.previous_zip_code, :at => [470, cursor-475]
+
+ go_to_page(3)
+
+ #Return Address
+ text_box "#{register.title} #{register.first_name} #{register.last_name}", :at => [-20, cursor-390]
+ text_box "#{register.home_address} #{register.home_apt}", :at => [-20, cursor-415]
+ text_box "#{register.home_city}, #{register.home_state} #{register.home_zip_code}", :at => [-20, cursor-435]
+
+ #Secretary of State
+ text_box state_info.mail_to_address_1, :at => [80, cursor-580]
+ text_box state_info.mail_to_address_2, :at => [80, cursor-610]
+ text_box state_info.mail_to_address_3, :at => [80, cursor-640]
+ text_box state_info.mail_to_address_4, :at => [80, cursor-670]
+
+ #Prawn doesnt support filling in forms
+ #prawn-fillform has a bug that doesnt display the offset correctly
+ #https://github.com/moessimple/prawn-fillform/pull/2
+ #So we are faking in the filled in form
+ data = {}
+ fill_form_with(data)
+ end
+
+end
27 app/views/guidelines/index.html.erb
@@ -0,0 +1,27 @@
+<div class="page-header">
+ <h1>State Guidelines</h1>
+</div>
+<p>Choose a state below to see specific voter registration guidelines.</p>
+<div class="row">
+ <div class="span4">
+ <ul>
+ <% @states[0..16].each do |state| %>
+ <li><%= link_to state.name, guideline_path(state.state) %></li>
+ <% end %>
+ </ul>
+ </div>
+ <div class="span4">
+ <ul>
+ <% @states[17..33].each do |state| %>
+ <li><%= link_to state.name, guideline_path(state.state) %></li>
+ <% end %>
+ </ul>
+ </div>
+ <div class="span4">
+ <ul>
+ <% @states[34..50].each do |state| %>
+ <li><%= link_to state.name, guideline_path(state.state) %></li>
+ <% end %>
+ </ul>
+ </div>
+</div>
83 app/views/guidelines/show.html.erb
@@ -0,0 +1,83 @@
+<div class="row">
+ <div class="span3 sidebar">
+ <ul class="nav nav-list sidenav affix">
+ <li><a href="#registration">Registration</a><li>
+ <li><a href="#deadline">Deadline</a></li>
+ <li><a href="#felony">Felony Information</a></li>
+ <li><a href="#students">Students</a></li>
+ <li><a href="#identification">Identification</a></li>
+ <li><a href="#same-day">Same Day</a></li>
+ <li><a href="#early-vote">Early Vote</a></li>
+ </ul>
+ </div>
+
+ <div class="span9">
+ <div class="page-header">
+ <h1> Guidelines in <%= @guidelines.name %> </h1>
+ </div>
+ <section id="registration">
+ <h2> Voter Registration Requirements </h2>
+ <div class="row">
+ <div class="span9">
+ <%= raw @guidelines.requirements %>
+ </div>
+ </div>
+ </section>
+ <section id="deadline">
+ <h2> Registration Deadline </h2>
+ <div class="row">
+ <div class="span9">
+ <%= raw @guidelines.deadline %>
+ </div>
+ </div>
+ </section>
+ <section id="felony">
+ <h2> Felony Information </h2>
+ <div class="row">
+ <div class="span9">
+ <%= raw @guidelines.felony %>
+ </div>
+ </div>
+ </section>
+ <section id="students">
+ <h2> Information for Students </h2>
+ <div class="row">
+ <div class="span9">
+ <%= raw @guidelines.student %>
+ </div>
+ </div>
+ </section>
+ <section id="identification">
+ <h2> Identification Information </h2>
+ <div class="row">
+ <div class="span9">
+ <%= raw @guidelines.identification %>
+ </div>
+ </div>
+ </section>
+ <section id="same-day">
+ <h2> Same Day Registration </h2>
+ <div class="row">
+ <div class="span9">
+ <%= raw @guidelines.same_day %>
+ </div>
+ </div>
+ </section>
+ <section id="early-vote">
+ <h2> Early Voting Information </h2>
+ <div class="row">
+ <div class="span9">
+ <%= raw @guidelines.early_voting %>
+ </div>
+ </div>
+ </section>
+ <section id="sos">
+ <h2> Secretary of State </h2>
+ <div class="row">
+ <div class="span9">
+ <%= link_to @guidelines.url, @guidelines.url, :target=>"_blank" %>
+ </div>
+ </div>
+ </section>
+ </div>
+</div>
37 app/views/home/index.html.erb
@@ -0,0 +1,37 @@
+<div class="hero-unit">
+ <h1>Voter Registration</h1>
+ <h2>Register to Vote in your state!</h2>
+ <%= form_tag("", :method => "GET", :class => "form-inline") do %>
+ <%= label_tag 'Select a state' %>
+ <%= select_tag("state", options_for_select(Guidelines.all.collect {|s| [ s.name, s.state ] })) %>
+ <%= submit_tag 'Go', :class=> "btn btn-primary" %>
+ <% end %>
+</div>
+<div class="row">
+ <div class="span12 section-header">
+ <h1>About</h1>
+ </div>
+</div>
+<div class="row">
+ <div class="span4">
+ <h2>Vote</h2>
+ <p>We need more Americans to have a say in their government, not just the special interests.
+ That's why we should be taking down roadblocks to voting.
+ We believe in an America where everybody can make their voices heard.</p>
+ </div>
+ <div class="span4">
+ <h2>How It Works</h2>
+ <ol>
+ <li>Choose a state</li>
+ <li>Read the guidelines for the state</li>
+ <li>Fill out the form</li>
+ <li>Download your voter registration form</li>
+ <li>Add a stamp and mail in your form</li>
+ </ol>
+ </div>
+ <div class="span4">
+ <h2>State Guidelines</h2>
+ <p>Make sure you checkout the <%= link_to 'guidelines', guidelines_path %> for your state</p>
+ </div>
+</div>
+
6 app/views/layouts/_flash.html.erb
@@ -0,0 +1,6 @@
+<% flash.each do |name, msg| %>
+ <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
+ <a class="close" data-dismiss="alert">×</a>
+ <%= msg %>
+ </div>
+<% end %>
55 app/views/layouts/application.html.erb
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>VoterRegistration</title>
+ <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link href='http://fonts.googleapis.com/css?family=Crimson+Text:600,400' rel='stylesheet' type='text/css'>
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', '<%= ENV['GOOGLE_ANALYTICS'] %>']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+</head>
+<body data-spy="scroll" data-target=".sidebar" data-offset="50">
+ <div class="navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </a>
+ <%= link_to 'Voter Registration', root_path, :class=>"brand" %>
+ <div class="nav-collapse">
+ <ul class="nav">
+ <li class=<%= 'active' if current_page?(root_path) %>><%= link_to 'Home', root_path %></li>
+ <li class=<%= 'active' if params[:controller] == 'register' %>><%= link_to 'Register to Vote', register_index_path %></li>
+ <li class=<%= 'active' if params[:controller] == 'guidelines' %>><%= link_to 'State Guidelines', guidelines_path %></li>
+ </ul>
+ </div><!--/.nav-collapse -->
+ </div>
+ </div>
+ </div>
+ <div class="container">
+ <%= render :partial => "layouts/flash", :locals => {:flash => flash} %>
+ <%= yield %>
+ </div> <!-- /container -->
+ <footer class="footer">
+ <div class="container">
+ <p><%= link_to 'Terms of use', page_path(:id => "terms") %></p>
+ </div>
+ </footer>
+
+</body>
+</html>
8 app/views/pages/terms.html.erb
@@ -0,0 +1,8 @@
+<h2> Terms of Use </h2>
+<div class="row">
+ <div class="span12">
+ <p>All information, dates and content included on this site are subject to change given the subject matter of the site.
+ It is the responsibility of the user of the site here under to monitor changes in applicable law.
+ Future versions of the site may include updated content to reflect any changes in applicable law.</p>
+ </div>
+</div>
110 app/views/register/_form.html.erb
@@ -0,0 +1,110 @@
+<%= simple_form_for @register, :url => register_create_path(@state), :html => { :class => 'form-horizontal' } do |f| %>
+ <br/>
+ <% if notification = f.error_notification %>
+ <div class="alert alert-error fade in">
+ <a class="close" data-dismiss="alert" href="#">&times;</a>
+ <%= notification %>
+ </div>
+ <% end %>
+ <p>Fill out the form below to generate a voter registration form</p>
+ <section id="legal_name">
+ <fieldset>
+ <legend>Name</legend>
+ <%= f.input :citizen do %>
+ <%= f.check_box :citizen, :checked => "checked" %> Are you a citizen of the United States of America?
+ <% end %>
+ <%= f.input :title, :collection => title_select %>
+ <%= f.input :first_name %>
+ <%= f.input :middle_name %>
+ <%= f.input :last_name %>
+ <%= f.input :name_suffix, :collection => suffix_select %>
+ </fieldset>
+ </section>
+ <section id="home_address">
+ <fieldset>
+ <legend>Home Address</legend>
+ <%= f.input :home_address %>
+ <%= f.input :home_apt, :label => "Apt or Lot#" %>
+ <%= f.input :home_city, :label => "City" %>
+ <%= f.input :home_state, :label => "State" do %>
+ <%= f.select(:home_state, options_for_select(Guidelines.all.collect {|s| [ s.name, s.state ] }, params[:state])) %>
+ <% end %>
+ <%= f.input :home_zip_code, :label => "ZIP code" %>
+ </fieldset>
+ </section>
+ <section id="m-address">
+ <legend>Mailing Address</legend>
+ <div class="control-group">
+ <div class="controls">
+ <input type="checkbox" data-toggle="collapse" data-target="#mailing_address"/> I have a different mailing address
+ </div>
+ </div>
+ <div id="mailing_address" class="collapse out">
+ <fieldset>
+ <%= f.input :mailing_address %>
+ <%= f.input :mailing_apt, :label => "Apt or Lot#" %>
+ <%= f.input :mailing_city %>
+ <%= f.input :mailing_state do %>
+ <%= f.select(:mailing_state, options_for_select(Guidelines.all.collect {|s| [ s.name, s.state ] }), :include_blank => true) %>
+ <% end %>
+ <%= f.input :mailing_zip_code, :label => "Mailing ZIP code" %>
+ </fieldset>
+ </div>
+ </section>
+ <section id="p-address">
+ <legend>Previous Address</legend>
+ <div class="control-group">
+ <div class="controls">
+ <input type="checkbox" data-toggle="collapse" data-target="#previous_address"/> I have recently moved
+ </div>
+ </div>
+ <div id="previous_address" class="collapse out">
+ <fieldset>
+ <%= f.input :previous_address %>
+ <%= f.input :previous_apt, :label => "Apt or Lot#" %>
+ <%= f.input :previous_city %>
+ <%= f.input(:previous_state) do %>
+ <%= f.select(:previous_state, options_for_select(Guidelines.all.collect {|s| [ s.name, s.state ] }), :include_blank => true) %>
+ <% end %>
+ <%= f.input :previous_zip_code, :label => "Previous ZIP code" %>
+ </fieldset>
+ </div>
+ </section>
+ <section id="p-name">
+ <legend>Previous Name</legend>
+ <div class="control-group">
+ <div class="controls">
+ <input type="checkbox" data-toggle="collapse" data-target="#previous_name"/> I have recently changed my name
+ </div>
+ </div>
+ <div id="previous_name" class="collapse out">
+ <fieldset>
+ <%= f.input :previous_title, :collection => title_select, :label => "Title" %>
+ <%= f.input :previous_first_name, :label => "First name" %>
+ <%= f.input :previous_middle_name, :label => "Middle name" %>
+ <%= f.input :previous_last_name, :label => "Last name" %>
+ <%= f.input :previous_suffix, :collection => suffix_select, :lavel => "Suffix" %>
+ </fieldset>
+ </div>
+ </section>
+ <section id="identification">
+ <fieldset>
+ <legend>Identification</legend>
+ <%= f.input :date_of_birth, :as => :date, :start_year => Date.today.year - 100,
+ :end_year => Date.today.year - 17,
+ :order => [:month, :day, :year],
+ :default => {:month => 1, :day => 1, :year => Date.today.year - 50} %>
+ <%= f.input :phone %>
+ <%= f.input :id_number, :hint => help_text(@instructions, "id_number") %>
+ </fieldset>
+ <fieldset id="additional">
+ <legend>Additional Information</legend>
+ <%= f.input :political_party, :collection => PoliticalParty.pluck(:name), :hint => help_text(@instructions,"political_party") %>
+ <%= f.input :ethnicity, :collection => Ethnicity.pluck(:name), :hint => help_text(@instructions, "ethnicity") %>
+ </fieldset>
+ </section>
+ <div class="form-actions">
+ <%= f.submit "Submit", :class => "btn btn-primary" %>
+ </div>
+<% end %>
+
22 app/views/register/complete.html.erb
@@ -0,0 +1,22 @@
+<div class="row">
+ <div class="span11">
+ <br/>
+ <p>Congratulations! You’ve completed your voter registration form.</p>
+ <%= link_to "Download Voter Registration Form (PDF)", register_complete_path(format: "pdf") , :class => "btn-large btn-success" %>
+ </div>
+</div>
+<br/>
+
+<h2> Registration Deadlines </h2>
+<div class="row">
+ <div class="span10">
+ <%= raw @state_info.deadline %>
+ </div>
+</div>
+
+<h2> Registration Guidelines </h2>
+<div class="row">
+ <div class="span10">
+ <%= raw @state_info.requirements %>
+ </div>
+</div>
13 app/views/register/index.html.erb
@@ -0,0 +1,13 @@
+<div class="page-header">
+ <h1>Register to Vote</h1>
+</div>
+<div class="row">
+ <div class="span11">
+ <%= form_tag(register_index_path, :method => "GET", :class => "well form-inline") do %>
+ <%= label_tag 'Select a state' %>
+ <%= select_tag("state", options_for_select(Guidelines.all.collect {|s| [ s.name, s.state ] })) %>
+ <%= submit_tag 'Go', :class=> "btn btn-primary" %>
+ <% end %>
+ </div>
+</div>
+
36 app/views/register/new.html.erb
@@ -0,0 +1,36 @@
+<div class="row">
+ <div class="span3 sidebar">
+ <ul class="nav nav-list sidenav affix">
+ <li><a href="#legal_name">Name</a><li>
+ <li><a href="#home_address">Home Address</a></li>
+ <li><a href="#m-address">Mailing Address</a></li>
+ <li><a href="#p-address">Previous Address</a></li>
+ <li><a href="#p-name">Previous Name</a></li>
+ <li><a href="#identification">Identification</a></li>
+ <li><a href="#additional">Additional Information</a></li>
+ </ul>
+ </div>
+ <div class="span9">
+ <div class="page-header">
+ <h1>Register in <%= @guidelines.name %></h1>
+ </div>
+ <% if @guidelines.supported %>
+ <% if @guidelines.online? && !@register.errors.any?%>
+ <h2><%= @guidelines.name %> offers online registration</h2>
+ <h4>To register to vote online in <%= @guidelines.name %>, you must:</h4>
+ <%= raw @guidelines.online_requirements %>
+ <p>Register online here: <%= link_to @guidelines.online_url, @guidelines.online_url %>
+ <h4>OR</h4>
+ <p>Continue filling out the form below for registration by mail</p>
+ <% end %>
+ <% if ENV['TWITTER_KEY'] %>
+ <br/>
+ <%= link_to image_tag('sign-in-with-twitter-d.png'), '/auth/twitter' %>
+ <% end %>
+ <br/>
+ <%= render 'form' %>
+ <% else %>
+ <%= raw @guidelines.unsupported %>
+ <% end %>
+ </div>
+</div>
6 config.ru
@@ -0,0 +1,6 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run VoterRegistration::Application
+
+$stdout.sync = true
76 config/application.rb
@@ -0,0 +1,76 @@
+require File.expand_path('../boot', __FILE__)
+
+# Pick the frameworks you want:
+require "active_record/railtie"
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "active_resource/railtie"
+require "sprockets/railtie"
+# require "rails/test_unit/railtie"
+
+if defined?(Bundler)
+ # If you precompile assets before deploying to production, use this line
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
+ # If you want your assets lazily compiled in production, use this line
+ # Bundler.require(:default, :assets, Rails.env)
+end
+
+module VoterRegistration
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password, :first_name, :last_name, :home_address, :mailing_address,
+ :previous_first_name, :previous_last_name, :previous_address, :date_of_birth,
+ :previous_middle_name, :middle_name,:id_number]
+
+ # Enable escaping HTML in JSON.
+ config.active_support.escape_html_entities_in_json = true
+
+ # Use SQL instead of Active Record's schema dumper when creating the database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Enforce whitelist mode for mass assignment.
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
+ # parameters by using an attr_accessible or attr_protected declaration.
+ config.active_record.whitelist_attributes = true
+
+ # Enable the asset pipeline
+ config.assets.enabled = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+
+ # For running on Heroku
+ config.assets.initialize_on_precompile = false
+
+ #Stylesheet engine uses less
+ config.app_generators.stylesheet_engine :less
+ end
+end
6 config/boot.rb
@@ -0,0 +1,6 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
25 config/database.yml
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem 'sqlite3'
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
5 config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+VoterRegistration::Application.initialize!
41 config/environments/development.rb
@@ -0,0 +1,41 @@
+VoterRegistration::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
+
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
+
+ # Action mailer default
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
+
+end
68 config/environments/production.rb
@@ -0,0 +1,68 @@
+VoterRegistration::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # Code is not reloaded between requests
+ config.cache_classes = true
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this)
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to nil and saved in location specified by config.assets.prefix
+ # config.assets.manifest = YOUR_PATH
+
+ # Specifies the header that your server uses for sending files
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Prepend all log lines with the following tags
+ # config.log_tags = [ :subdomain, :uuid ]
+
+