Permalink
Browse files

Added initial Rails app

  • Loading branch information...
0 parents commit b3d85637d8799e6125dcb97d7e00edac27c84961 @d2d d2d committed Aug 17, 2009
Showing 4,998 changed files with 186,069 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -0,0 +1,46 @@
+# OpenCongress - a Ruby on Rails application for displaying information about Congress
+#
+# Copyright (C) 2005-2006 Participatory Culture Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+The Participatory Politics Foundation is:
+
+Board of Directors
+
+Tiffiniy Cheng
+Nicholas Nassar
+David Moore
+Nicholas Reville
+Holmes Wilson
+
+Staff
+
+David Moore, Executive Director
+Andrew Packer, Project Coordinator
+Andy Ross, Software Developer
+Donny Shaw, Researcher / Blogger
+David Shettler, Software Developer
+
+Other Contributors
+
+Ben Matasar
+Neil Cook
+Jason Packer
+Scott Chacon
+Jeff Mielke
+
+Built with support from the Sunlight Foundation.
@@ -0,0 +1,3 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'config/deploy'
Oops, something went wrong.
@@ -0,0 +1,70 @@
+# OpenCongress - a Ruby on Rails application for displaying information about Congress
+#
+# Copyright (C) 2005-2006 Participatory Culture Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+== OpenCongress Rails Project
+
+-- Installing OpenCongress --
+
+First of all, the OpenCongress project is a PostgreSQL only project. Don't have delusions of using MySQL with it or you will be hurtin. Since I personally had little experience with Postgres before this, I will include some tips for all you Mysql only guys and gals out there.
+
+Here is what you have to do to get OpenCongress close to working on your personal machine :
+
+ 1. install postgresql
+
+ 2. install tsearch in contrib
+
+ 3. gem install ferret, bluecloth, simple-rss, postgres-pr
+
+ 4. copy config/database.sample to config/database.yml and edit it
+
+ 5. create the databases
+ createdb opencongress_dev
+ opencongress_dev < db/tsearch2.sql
+ createdb opencongress_test
+
+ 6. rake migrate
+
+--
+
+Next, you will have to get the data from govtrack and fill in your database with the parsed govtrack data
+
+ mkdir /data/govtrack/109
+ cd /data/govtrack/109
+ rsync -az govtrack.us::govtrackdata/us/109/bills .
+ rsync -az govtrack.us::govtrackdata/us/109/repstats .
+ rsync -az govtrack.us::govtrackdata/us/109/bills.index.xml .
+ rsync -az govtrack.us::govtrackdata/us/109/committeeschedule.xml .
+ rsync -az govtrack.us::govtrackdata/us/109/rolls .
+
+Now, you will have to actually parse the data
+
+ ruby bin/govtrack_parse_people.rb
+ ruby bin/govtrack_parse_bills.rb
+ ruby bin/govtrack_parse_committees.rb
+ ruby bin/govtrack_parse_committee_schedules.rb
+ ruby parse_individual_bills.rb
+
+--
+
+Now, just run 'mongrel_rails start' and you should have something going on localhost:3000 - have fun!
+
+Lastly, some Postgres tips:
+
+ starting pg: pg_ctl -D data -l logfile start
+ accessing pg from the command line : psql opencongress_dev
+
@@ -0,0 +1,10 @@
+# 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.join(File.dirname(__FILE__), 'config', 'boot'))
+
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+require 'tasks/rails'
@@ -0,0 +1,86 @@
+class AboutController < ApplicationController
+# caches_page :index, :blog, :resources, :congress, :howtouse, :rss, :feedback
+ skip_before_filter :has_accepted_tos?
+ skip_before_filter :store_location, :only => ["privacy_policy","terms_of_service"]
+
+
+ def index
+ @learn_off = true
+ @breadcrumb = {
+ 1 => { 'text' => "About", 'url' => { :controller => 'about' } }
+ }
+ @page_title = 'About Open Congress'
+ end
+
+ def blog
+ @learn_off = true
+ @breadcrumb = {
+ 1 => { 'text' => "About Blog", 'url' => { :controller => 'about', :action => 'blog' } }
+ }
+ @page_title = 'About OpenCongress Blog'
+ end
+
+ def resources
+ @page_title = "General Overview / Information about Congress"
+ @learn_off = true
+ @breadcrumb = {
+ 1 => { 'text' => "Congress Resources", 'url' => { :controller => 'about', :action => 'resources' } }
+ }
+ end
+
+ def congress
+ # Set @learn_off to remove "Learn More" from the layout
+ @learn_off = true
+ @page_title = 'About Congress'
+ end
+
+ def howtouse
+ @learn_off = true
+ @breadcrumb = {
+ 1 => { 'text' => "How To Use Open Congress", 'url' => { :controller => 'about', :action => 'howtouse'} }
+ }
+ @page_title = "How To Use Open Congress"
+ end
+
+ def beta_feedback
+ @learn_off = true
+ @breadcrumb = {
+ 1 => { 'text' => "Feedback", 'url' => { :controller => 'about', :action => 'beta_feedback'} }
+ }
+ @page_title = "Feedback"
+ end
+
+ def rss
+ @learn_off = true
+ @breadcrumb = {
+ 1 => { 'text' => "RSS", 'url' => { :controller => 'about', :action => 'rss' } }
+ }
+ @page_title = "Use RSS to Easily Track Developments in Congress"
+ end
+
+ def political_notebooks
+ @learn_off = true
+ @page_title = "About My Political Notebook"
+ end
+
+ def screencast
+ @learn_off
+ @page_title = "Screencast"
+ end
+
+ def terms_of_service
+ @head_title = "Terms of Service and Comment Policy"
+ end
+
+ def privacy_policy
+ @head_title = "Privacy Policy"
+ end
+
+private
+
+
+ def learn_from_controller(controller_name)
+ text = render_to_string(:partial => "#{controller_name}/learn")
+ process_bluecloth_text(text)
+ end
+end
Oops, something went wrong.

0 comments on commit b3d8563

Please sign in to comment.