Permalink
Browse files

round of performance tweaks and optimizations

  • Loading branch information...
1 parent 92ae2f6 commit 7915ca21c375a9af22645c25e0b7d1696807c5e9 @aross aross committed Nov 12, 2012
Showing with 264 additions and 9,268 deletions.
  1. +1 −3 Gemfile
  2. +36 −36 Gemfile.lock
  3. +3 −0 app/controllers/admin/articles_controller.rb
  4. +3 −1 app/controllers/bill_controller.rb
  5. +2 −0 app/controllers/contact_congress_letters_controller.rb
  6. +19 −19 app/controllers/index_controller.rb
  7. +2 −0 app/controllers/people_controller.rb
  8. +7 −5 app/controllers/roll_call_controller.rb
  9. +9 −0 app/views/bill/_cosponsor.html.haml
  10. +11 −0 app/views/bill/_letter.html.erb
  11. +0 −15 app/views/bill/_letters.html.erb
  12. +2 −4 app/views/bill/_related_oc_blog_articles.html.erb
  13. +3 −3 app/views/bill/_vote.html.erb
  14. +2 −1 app/views/bill/letters.html.haml
  15. +42 −37 app/views/bill/show.html.erb
  16. +1 −1 app/views/index/index.html.erb
  17. +53 −48 app/views/people/show.html.erb
  18. +9 −8 app/views/shared/_recent_oc_blog_articles.html.erb
  19. +1 −1 config/application.rb
  20. +1 −1 config/initializers/airbrake.rb
  21. +53 −0 db/migrate/20121109062237_nov2012_improvements.rb
  22. +4 −3 public/stylesheets/bill.css
  23. +0 −217 vendor/plugins/acts_as_solr/CHANGE_LOG
  24. +0 −19 vendor/plugins/acts_as_solr/LICENSE
  25. +0 −44 vendor/plugins/acts_as_solr/README
  26. +0 −25 vendor/plugins/acts_as_solr/Rakefile
  27. +0 −8 vendor/plugins/acts_as_solr/TESTING_THE_PLUGIN
  28. +0 −16 vendor/plugins/acts_as_solr/config/environment.rb
  29. +0 −10 vendor/plugins/acts_as_solr/config/solr.yml
  30. +0 −21 vendor/plugins/acts_as_solr/init.rb
  31. +0 −11 vendor/plugins/acts_as_solr/install.rb
  32. +0 −59 vendor/plugins/acts_as_solr/lib/acts_as_solr.rb
  33. +0 −172 vendor/plugins/acts_as_solr/lib/acts_methods.rb
  34. +0 −159 vendor/plugins/acts_as_solr/lib/class_methods.rb
  35. +0 −76 vendor/plugins/acts_as_solr/lib/common_methods.rb
  36. +0 −61 vendor/plugins/acts_as_solr/lib/deprecation.rb
  37. +0 −139 vendor/plugins/acts_as_solr/lib/instance_methods.rb
  38. +0 −127 vendor/plugins/acts_as_solr/lib/parser_methods.rb
  39. +0 −64 vendor/plugins/acts_as_solr/lib/search_results.rb
  40. +0 −21 vendor/plugins/acts_as_solr/lib/solr.rb
  41. +0 −162 vendor/plugins/acts_as_solr/lib/solr/connection.rb
  42. +0 −73 vendor/plugins/acts_as_solr/lib/solr/document.rb
  43. +0 −13 vendor/plugins/acts_as_solr/lib/solr/exception.rb
  44. +0 −39 vendor/plugins/acts_as_solr/lib/solr/field.rb
  45. +0 −19 vendor/plugins/acts_as_solr/lib/solr/importer.rb
  46. +0 −26 vendor/plugins/acts_as_solr/lib/solr/importer/array_mapper.rb
  47. +0 −38 vendor/plugins/acts_as_solr/lib/solr/importer/delimited_file_source.rb
  48. +0 −27 vendor/plugins/acts_as_solr/lib/solr/importer/hpricot_mapper.rb
  49. +0 −51 vendor/plugins/acts_as_solr/lib/solr/importer/mapper.rb
  50. +0 −43 vendor/plugins/acts_as_solr/lib/solr/importer/solr_source.rb
  51. +0 −35 vendor/plugins/acts_as_solr/lib/solr/importer/xpath_mapper.rb
  52. +0 −52 vendor/plugins/acts_as_solr/lib/solr/indexer.rb
  53. +0 −24 vendor/plugins/acts_as_solr/lib/solr/request.rb
  54. +0 −63 vendor/plugins/acts_as_solr/lib/solr/request/add_document.rb
  55. +0 −36 vendor/plugins/acts_as_solr/lib/solr/request/base.rb
  56. +0 −31 vendor/plugins/acts_as_solr/lib/solr/request/commit.rb
  57. +0 −50 vendor/plugins/acts_as_solr/lib/solr/request/delete.rb
  58. +0 −46 vendor/plugins/acts_as_solr/lib/solr/request/dismax.rb
  59. +0 −22 vendor/plugins/acts_as_solr/lib/solr/request/index_info.rb
  60. +0 −21 vendor/plugins/acts_as_solr/lib/solr/request/optimize.rb
  61. +0 −36 vendor/plugins/acts_as_solr/lib/solr/request/ping.rb
  62. +0 −58 vendor/plugins/acts_as_solr/lib/solr/request/select.rb
  63. +0 −107 vendor/plugins/acts_as_solr/lib/solr/request/standard.rb
  64. +0 −23 vendor/plugins/acts_as_solr/lib/solr/request/update.rb
  65. +0 −24 vendor/plugins/acts_as_solr/lib/solr/response.rb
  66. +0 −17 vendor/plugins/acts_as_solr/lib/solr/response/add_document.rb
  67. +0 −42 vendor/plugins/acts_as_solr/lib/solr/response/base.rb
  68. +0 −17 vendor/plugins/acts_as_solr/lib/solr/response/commit.rb
  69. +0 −13 vendor/plugins/acts_as_solr/lib/solr/response/delete.rb
  70. +0 −8 vendor/plugins/acts_as_solr/lib/solr/response/dismax.rb
  71. +0 −26 vendor/plugins/acts_as_solr/lib/solr/response/index_info.rb
  72. +0 −14 vendor/plugins/acts_as_solr/lib/solr/response/optimize.rb
  73. +0 −28 vendor/plugins/acts_as_solr/lib/solr/response/ping.rb
  74. +0 −42 vendor/plugins/acts_as_solr/lib/solr/response/ruby.rb
  75. +0 −64 vendor/plugins/acts_as_solr/lib/solr/response/standard.rb
  76. +0 −42 vendor/plugins/acts_as_solr/lib/solr/response/xml.rb
  77. +0 −27 vendor/plugins/acts_as_solr/lib/solr/solrtasks.rb
  78. +0 −34 vendor/plugins/acts_as_solr/lib/solr/util.rb
  79. +0 −47 vendor/plugins/acts_as_solr/lib/solr/xml.rb
  80. +0 −13 vendor/plugins/acts_as_solr/lib/solr_fixtures.rb
  81. +0 −18 vendor/plugins/acts_as_solr/lib/tasks/database.rake
  82. +0 −58 vendor/plugins/acts_as_solr/lib/tasks/solr.rake
  83. +0 −7 vendor/plugins/acts_as_solr/lib/tasks/test.rake
  84. +0 −126 vendor/plugins/acts_as_solr/schema.xml
  85. +0 −562 vendor/plugins/acts_as_solr/solr/CHANGES.txt
  86. +0 −608 vendor/plugins/acts_as_solr/solr/LICENSE.txt
  87. +0 −57 vendor/plugins/acts_as_solr/solr/NOTICE.txt
  88. +0 −206 vendor/plugins/acts_as_solr/solr/etc/jetty.xml
  89. +0 −379 vendor/plugins/acts_as_solr/solr/etc/webdefault.xml
  90. BIN vendor/plugins/acts_as_solr/solr/lib/commons-codec-1.3.jar
  91. BIN vendor/plugins/acts_as_solr/solr/lib/commons-csv-0.1-SNAPSHOT.jar
  92. BIN vendor/plugins/acts_as_solr/solr/lib/commons-fileupload-1.2.jar
  93. BIN vendor/plugins/acts_as_solr/solr/lib/commons-io-1.2.jar
  94. BIN vendor/plugins/acts_as_solr/solr/lib/easymock.jar
  95. BIN vendor/plugins/acts_as_solr/solr/lib/jetty-6.1.3.jar
  96. BIN vendor/plugins/acts_as_solr/solr/lib/jetty-util-6.1.3.jar
  97. BIN vendor/plugins/acts_as_solr/solr/lib/jsp-2.1/ant-1.6.5.jar
  98. BIN vendor/plugins/acts_as_solr/solr/lib/jsp-2.1/core-3.1.1.jar
  99. BIN vendor/plugins/acts_as_solr/solr/lib/jsp-2.1/jsp-2.1.jar
  100. BIN vendor/plugins/acts_as_solr/solr/lib/jsp-2.1/jsp-api-2.1.jar
  101. BIN vendor/plugins/acts_as_solr/solr/lib/lucene-analyzers-2007-05-20_00-04-53.jar
  102. BIN vendor/plugins/acts_as_solr/solr/lib/lucene-core-2007-05-20_00-04-53.jar
  103. BIN vendor/plugins/acts_as_solr/solr/lib/lucene-highlighter-2007-05-20_00-04-53.jar
  104. BIN vendor/plugins/acts_as_solr/solr/lib/lucene-snowball-2007-05-20_00-04-53.jar
  105. BIN vendor/plugins/acts_as_solr/solr/lib/lucene-spellchecker-2007-05-20_00-04-53.jar
  106. BIN vendor/plugins/acts_as_solr/solr/lib/servlet-api-2.4.jar
  107. BIN vendor/plugins/acts_as_solr/solr/lib/servlet-api-2.5-6.1.3.jar
  108. BIN vendor/plugins/acts_as_solr/solr/lib/xpp3-1.1.3.4.O.jar
  109. +0 −52 vendor/plugins/acts_as_solr/solr/solr/README.txt
  110. +0 −176 vendor/plugins/acts_as_solr/solr/solr/bin/abc
  111. +0 −176 vendor/plugins/acts_as_solr/solr/solr/bin/abo
  112. +0 −108 vendor/plugins/acts_as_solr/solr/solr/bin/backup
  113. +0 −142 vendor/plugins/acts_as_solr/solr/solr/bin/backupcleaner
  114. +0 −128 vendor/plugins/acts_as_solr/solr/solr/bin/commit
  115. +0 −129 vendor/plugins/acts_as_solr/solr/solr/bin/optimize
  116. +0 −129 vendor/plugins/acts_as_solr/solr/solr/bin/readercycle
  117. +0 −77 vendor/plugins/acts_as_solr/solr/solr/bin/rsyncd-disable
  118. +0 −76 vendor/plugins/acts_as_solr/solr/solr/bin/rsyncd-enable
  119. +0 −145 vendor/plugins/acts_as_solr/solr/solr/bin/rsyncd-start
  120. +0 −105 vendor/plugins/acts_as_solr/solr/solr/bin/rsyncd-stop
  121. +0 −83 vendor/plugins/acts_as_solr/solr/solr/bin/scripts-util
  122. +0 −148 vendor/plugins/acts_as_solr/solr/solr/bin/snapcleaner
  123. +0 −168 vendor/plugins/acts_as_solr/solr/solr/bin/snapinstaller
  124. +0 −248 vendor/plugins/acts_as_solr/solr/solr/bin/snappuller
  125. +0 −77 vendor/plugins/acts_as_solr/solr/solr/bin/snappuller-disable
  126. +0 −77 vendor/plugins/acts_as_solr/solr/solr/bin/snappuller-enable
  127. +0 −109 vendor/plugins/acts_as_solr/solr/solr/bin/snapshooter
  128. +0 −31 vendor/plugins/acts_as_solr/solr/solr/conf/admin-extra.html
  129. +0 −21 vendor/plugins/acts_as_solr/solr/solr/conf/protwords.txt
  130. +0 −126 vendor/plugins/acts_as_solr/solr/solr/conf/schema.xml
  131. +0 −24 vendor/plugins/acts_as_solr/solr/solr/conf/scripts.conf
  132. +0 −456 vendor/plugins/acts_as_solr/solr/solr/conf/solrconfig.xml
  133. +0 −57 vendor/plugins/acts_as_solr/solr/solr/conf/stopwords.txt
  134. +0 −31 vendor/plugins/acts_as_solr/solr/solr/conf/synonyms.txt
  135. +0 −132 vendor/plugins/acts_as_solr/solr/solr/conf/xslt/example.xsl
  136. +0 −63 vendor/plugins/acts_as_solr/solr/solr/conf/xslt/example_atom.xsl
  137. +0 −62 vendor/plugins/acts_as_solr/solr/solr/conf/xslt/example_rss.xsl
  138. BIN vendor/plugins/acts_as_solr/solr/start.jar
  139. BIN vendor/plugins/acts_as_solr/solr/webapps/solr.war
  140. +0 −2 vendor/plugins/acts_as_solr/test/config/solr.yml
  141. +0 −10 vendor/plugins/acts_as_solr/test/db/connections/mysql/connection.rb
  142. +0 −8 vendor/plugins/acts_as_solr/test/db/connections/sqlite/connection.rb
  143. +0 −13 vendor/plugins/acts_as_solr/test/db/migrate/001_create_books.rb
  144. +0 −12 vendor/plugins/acts_as_solr/test/db/migrate/002_create_movies.rb
  145. +0 −11 vendor/plugins/acts_as_solr/test/db/migrate/003_create_categories.rb
  146. +0 −15 vendor/plugins/acts_as_solr/test/db/migrate/004_create_electronics.rb
  147. +0 −12 vendor/plugins/acts_as_solr/test/db/migrate/005_create_authors.rb
  148. +0 −9 vendor/plugins/acts_as_solr/test/db/migrate/006_create_postings.rb
  149. BIN vendor/plugins/acts_as_solr/test/db/test.db
  150. +0 −9 vendor/plugins/acts_as_solr/test/fixtures/authors.yml
  151. +0 −11 vendor/plugins/acts_as_solr/test/fixtures/books.yml
  152. +0 −7 vendor/plugins/acts_as_solr/test/fixtures/categories.yml
  153. +0 −41 vendor/plugins/acts_as_solr/test/fixtures/db_definitions/mysql.sql
  154. +0 −39 vendor/plugins/acts_as_solr/test/fixtures/electronics.yml
  155. +0 −9 vendor/plugins/acts_as_solr/test/fixtures/movies.yml
  156. +0 −10 vendor/plugins/acts_as_solr/test/fixtures/postings.yml
  157. +0 −10 vendor/plugins/acts_as_solr/test/models/author.rb
  158. +0 −10 vendor/plugins/acts_as_solr/test/models/book.rb
  159. +0 −8 vendor/plugins/acts_as_solr/test/models/category.rb
  160. +0 −20 vendor/plugins/acts_as_solr/test/models/electronic.rb
  161. +0 −17 vendor/plugins/acts_as_solr/test/models/movie.rb
  162. +0 −11 vendor/plugins/acts_as_solr/test/models/posting.rb
  163. +0 −36 vendor/plugins/acts_as_solr/test/test_helper.rb
  164. +0 −375 vendor/plugins/acts_as_solr/test/unit/acts_as_solr_test.rb
  165. +0 −37 vendor/plugins/acts_as_solr/test/unit/association_indexing_test.rb
  166. +0 −122 vendor/plugins/acts_as_solr/test/unit/faceted_search_test.rb
  167. +0 −39 vendor/plugins/acts_as_solr/test/unit/multi_solr_search_test.rb
View
@@ -1,12 +1,11 @@
source 'http://rubygems.org'
-gem 'rails', '3.0.7'
+gem 'rails', '3.0.17'
gem 'rake', '0.8.7'
# database gems -- need both pg and mysql for app and wiki
gem 'pg'
gem 'mysql'
-gem 'system_timer'
gem "settingslogic"
@@ -51,7 +50,6 @@ gem 'rack-openid'
gem 'rack-contrib'
# memcache
-gem 'memcache'
gem 'memcache-client'
# markup tools and parsers
View
@@ -30,32 +30,32 @@ GEM
RedCloth (4.2.9)
ZenTest (4.5.0)
abstract (1.0.0)
- actionmailer (3.0.7)
- actionpack (= 3.0.7)
- mail (~> 2.2.15)
- actionpack (3.0.7)
- activemodel (= 3.0.7)
- activesupport (= 3.0.7)
+ actionmailer (3.0.17)
+ actionpack (= 3.0.17)
+ mail (~> 2.2.19)
+ actionpack (3.0.17)
+ activemodel (= 3.0.17)
+ activesupport (= 3.0.17)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
- rack (~> 1.2.1)
+ rack (~> 1.2.5)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
- activemodel (3.0.7)
- activesupport (= 3.0.7)
+ activemodel (3.0.17)
+ activesupport (= 3.0.17)
builder (~> 2.1.2)
i18n (~> 0.5.0)
- activerecord (3.0.7)
- activemodel (= 3.0.7)
- activesupport (= 3.0.7)
- arel (~> 2.0.2)
+ activerecord (3.0.17)
+ activemodel (= 3.0.17)
+ activesupport (= 3.0.17)
+ arel (~> 2.0.10)
tzinfo (~> 0.3.23)
- activeresource (3.0.7)
- activemodel (= 3.0.7)
- activesupport (= 3.0.7)
- activesupport (3.0.7)
+ activeresource (3.0.17)
+ activemodel (= 3.0.17)
+ activesupport (= 3.0.17)
+ activesupport (3.0.17)
addressable (2.2.6)
airbrake (3.0.9)
activesupport
@@ -178,9 +178,8 @@ GEM
nokogiri (~> 1.4)
webrobots (~> 0.0, >= 0.0.9)
mediacloth (0.0.3)
- memcache (1.2.13)
memcache-client (1.8.5)
- mime-types (1.16)
+ mime-types (1.19)
mogli (0.0.36)
hashie (~> 1.1.0)
httmultiparty (>= 0.3.6)
@@ -209,7 +208,7 @@ GEM
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
pg (0.11.0)
- polyglot (0.3.1)
+ polyglot (0.3.3)
rabl (0.2.8)
rack (1.2.5)
rack-contrib (1.1.0)
@@ -221,20 +220,23 @@ GEM
ruby-openid (>= 2.1.8)
rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.7)
- actionmailer (= 3.0.7)
- actionpack (= 3.0.7)
- activerecord (= 3.0.7)
- activeresource (= 3.0.7)
- activesupport (= 3.0.7)
+ rails (3.0.17)
+ actionmailer (= 3.0.17)
+ actionpack (= 3.0.17)
+ activerecord (= 3.0.17)
+ activeresource (= 3.0.17)
+ activesupport (= 3.0.17)
bundler (~> 1.0)
- railties (= 3.0.7)
- railties (3.0.7)
- actionpack (= 3.0.7)
- activesupport (= 3.0.7)
+ railties (= 3.0.17)
+ railties (3.0.17)
+ actionpack (= 3.0.17)
+ activesupport (= 3.0.17)
rake (>= 0.8.7)
+ rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.8.7)
+ rdoc (3.12)
+ json (~> 1.4)
rmagick (2.13.1)
rspec (2.8.0)
rspec-core (~> 2.8.0)
@@ -261,11 +263,11 @@ GEM
settingslogic (2.0.6)
silent-postgres (0.0.8)
simple-rss (1.2.3)
- system_timer (1.2.4)
thor (0.14.6)
- treetop (1.4.9)
+ treetop (1.4.12)
+ polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.31)
+ tzinfo (0.3.35)
validates_captcha (0.9.7)
actionpack (>= 2.3.2)
activerecord (>= 2.3.2)
@@ -314,7 +316,6 @@ DEPENDENCIES
json
mechanize
mediacloth
- memcache
memcache-client
mysql
newrelic_rpm
@@ -326,7 +327,7 @@ DEPENDENCIES
rabl
rack-contrib
rack-openid
- rails (= 3.0.7)
+ rails (= 3.0.17)
rake (= 0.8.7)
rmagick (= 2.13.1)
rspec-rails (~> 2.4)
@@ -336,7 +337,6 @@ DEPENDENCIES
silent-postgres
simple-rss
simple_captcha!
- system_timer
validates_captcha
webrat
will_paginate (~> 3.0.pre2)
@@ -35,6 +35,8 @@ def create
expire_page :controller => 'index'
expire_page :controller => 'articles', :action => 'view', :id => @article
+ expire_fragment 'recent_oc_blog_articles'
+
flash[:notice] = 'Article was successfully created.'
redirect_to :action => 'list'
else
@@ -65,6 +67,7 @@ def update
expire_page :controller => 'articles'
expire_page :controller => 'index'
expire_page :controller => 'articles', :action => 'view', :id => @article
+ expire_fragment 'recent_oc_blog_articles'
flash[:notice] = 'Article was successfully updated.'
redirect_to :action => 'show', :id => @article
@@ -400,13 +400,15 @@ def show
format.html {
comment_redirect(params[:goto_comment]) and return if params[:goto_comment]
+ @related_articles = @bill.related_articles
+
@include_vids_styles = true
@tracking_suggestions = @bill.tracking_suggestions
@supporting_suggestions = @bill.support_suggestions
@opposing_suggestions = @bill.oppose_suggestions
- @latest_letters = @bill.contact_congress_letters.includes(:formageddon_threads).where("formageddon_threads.privacy='PUBLIC'").order("contact_congress_letters.created_at DESC").limit(3)
+ @latest_letters = @bill.contact_congress_letters.where("contact_congress_letters.is_public='t'").order("contact_congress_letters.created_at DESC").limit(3)
# create roll call variable to include chart JS
@roll_call = @bill.roll_calls.empty? ? nil : @bill.roll_calls.first
@@ -213,6 +213,7 @@ def create_from_formageddon
end
end
end
+ @contact_congress_letter.is_public = (@contact_congress_letter.formageddon_threads.first.privacy == 'PUBLIC')
@contact_congress_letter.save
else
@new_user_notice = false
@@ -262,6 +263,7 @@ def update
t.save
end
+ @contact_congress_letter.is_public = (params[:privacy] == 'PUBLIC')
end
@contact_congress_letter.save
@@ -6,33 +6,33 @@ class IndexController < ApplicationController
def index
unless read_fragment("frontpage_rightside")
@index_tabs = [
- {:title => 'Bills in the News',
- :partial => 'bill',
- :collection => Bill.find_by_most_commentary('news', 5, 7.days, Settings.default_congress),
- :id => 'bns',
- :link => 'bill/most/news?types=all',
- :count_type => 'news_articles'},
- {:title => 'Bills on Blogs',
+ # {:title => 'Bills in the News',
+ # :partial => 'bill',
+ # :collection => Bill.find_by_most_commentary('news', 5, 7.days, Settings.default_congress),
+ # :id => 'bns',
+ # :link => 'bill/most/news?types=all',
+ # :count_type => 'news_articles'},
+ # {:title => 'Bills on Blogs',
+ # :partial => 'bill',
+ # :collection => Bill.find_by_most_commentary('blog', 5, 7.days, Settings.default_congress),
+ # :id => 'bbg',
+ # :link => 'bill/most/blog?types=all',
+ # :style => 'display: none;',
+ # :count_type => 'blog_articles'},
+ {:title => 'Most-Viewed Bills',
:partial => 'bill',
- :collection => Bill.find_by_most_commentary('blog', 5, 7.days, Settings.default_congress),
- :id => 'bbg',
- :link => 'bill/most/blog?types=all',
- :style => 'display: none;',
- :count_type => 'blog_articles'},
+ :collection => ObjectAggregate.popular('Bill', Settings.default_count_time, 5),
+ :id => "bv",
+ :link => '/bill/most/viewed',
+ # :style => 'display: none;',
+ :count_type => 'views'},
{:title => 'Newest Bills',
:partial => 'bill',
:collection => Bill.find(:all, :order => 'introduced DESC', :limit => 5),
:id => 'bn',
:link => '/bill/all',
:style => 'display: none;',
:count_type => 'views'},
- {:title => 'Most-Viewed Bills',
- :partial => 'bill',
- :collection => ObjectAggregate.popular('Bill', Settings.default_count_time, 5),
- :id => "bv",
- :link => '/bill/most/viewed',
- :style => 'display: none;',
- :count_type => 'views'},
{:title => 'Most-Viewed Senators',
:partial => 'person',
:collection => Person.list_chamber('sen', Settings.default_congress, "view_count desc", 5),
@@ -251,9 +251,11 @@ def show
@include_vids_styles = true
@featured_person_text = @person.featured_people.first
+
@person_tracking_suggestions = @person.tracking_suggestions
@supporting_suggestions = @person.support_suggestions
@opposing_suggestions = @person.oppose_suggestions
+
@bio_summary = @person.wiki_bio_summary
@atom = {'link' => url_for(:only_path => false, :controller => 'people', :action => 'atom', :id => @person), 'title' => "Track " + @person.name}
@hide_atom = true
@@ -11,7 +11,8 @@ class RollCallController < ApplicationController
@@PIE_OPTIONS = {
:start_angle => 270,
:no_labels => true,
- :tip => "#label#\n(Click for Details)",
+ # :tip => "#label#\n(Click for Details)",
+ :tip => "#label#",
:gradient_fill => false
}
@@ -77,17 +78,18 @@ def partyvote_piechart_data
colors = []
if republican_votes.size > 0
- vals << OFC2::PieValue.new(:value => republican_votes.size, :label => "Republican (#{republican_votes.size})", :on_click => "openRollCallOverlay('Republican_#{@@VOTE_TYPES[params[:breakdown_type]]}')")
+# vals << OFC2::PieValue.new(:value => republican_votes.size, :label => "Republican (#{republican_votes.size})", :on_click => "openRollCallOverlay('Republican_#{@@VOTE_TYPES[params[:breakdown_type]]}')")
+ vals << OFC2::PieValue.new(:value => republican_votes.size, :label => "Republican (#{republican_votes.size})", :on_click => "alert('boom!');")
colors << "#F84835"
end
if democrat_votes.size > 0
- vals << OFC2::PieValue.new(:value => democrat_votes.size, :label => "Democrat (#{democrat_votes.size})", :on_click => "openRollCallOverlay('Democrat_#{@@VOTE_TYPES[params[:breakdown_type]]}')")
+ vals << OFC2::PieValue.new(:value => democrat_votes.size, :label => "Democrat (#{democrat_votes.size})", :on_click => "window.location.href='/roll_call/sublist/#{@roll_call.id}?party=Democrat&vote=#{@@VOTE_TYPES[params[:breakdown_type]]}'")
colors << "#5D77DA"
end
if other_votes_size > 0
- vals << OFC2::PieValue.new(:value => other_votes_size, :label =>"Other (#{other_votes_size})", :on_click => "openRollCallOverlay('Other_#{@@VOTE_TYPES[params[:breakdown_type]]}')")
+ vals << OFC2::PieValue.new(:value => other_votes_size, :label =>"Other (#{other_votes_size})", :on_click => "window.location.href='/roll_call/sublist/#{@roll_call.id}?party=Other&vote=#{@@VOTE_TYPES[params[:breakdown_type]]}'")
colors << "#DDDDDD"
end
@@ -170,7 +172,7 @@ def index
def all
@page = params[:page].blank? ? 1 : params[:page]
- #logger.debug "IIIIIIIIII #{Settings.inspect}"
+
if params[:sort] == 'hotbills'
@sort = 'hotbills'
@rolls = RollCall.find(:all, :include => [:bill, :amendment], :order => 'roll_calls.date DESC',
@@ -0,0 +1,9 @@
+%li
+ = link_to "<span class='small#{' withdrawn' unless cosponsor.date_withdrawn.blank?}'>#{cosponsor.person.name}</span>".html_safe, :controller => 'people', :action => 'show', :id => cosponsor.person
+
+ - unless cosponsor.date_added.blank?
+ %br
+ %span.small= "Added #{cosponsor.date_added.strftime('%B %d, %Y')}"
+ - unless cosponsor.date_withdrawn.blank?
+ %br
+ %span.small= "Withdrawn #{cosponsor.date_withdrawn.strftime('%B %d, %Y')}"
@@ -0,0 +1,11 @@
+<li class='<%= letter.disposition %>'>
+ <a href="<%= contact_congress_letter_path(letter) %>">
+ <span class='subject'><%= letter.subject %></span>
+ <% if letter.user %>
+ <span class='user'><%= letter.user.login %></span>
+ <% end %>
+ <span class='date'><%= letter.created_at.strftime('%B %d, %Y')%></span>
+
+ <p><%= truncate(letter.message, :length => 500).gsub(/\n/, "<br />").html_safe %></p>
+ </a>
+</li>
@@ -1,15 +0,0 @@
-<ul class='most_viewed_letters'>
- <% letters.each do |l| %>
- <li class='<%= l.disposition %>'>
- <a href="<%= contact_congress_letter_path(l) %>">
- <span class='subject'><%= l.subject %></span>
- <% if l.user %>
- <span class='user'><%= l.user.login %></span>
- <% end %>
- <span class='date'><%= l.created_at.strftime('%B %d, %Y')%></span>
-
- <p><%= truncate(l.message, :length => 500).gsub(/\n/, "<br />").html_safe %></p>
- </a>
- </li>
- <% end %>
-</ul>
@@ -1,10 +1,8 @@
-<% articles = @bill.related_articles %>
-
-<% unless articles.empty? %>
+<% unless @related_articles.empty? %>
<div class="sidebar_recent_articles">
<h4>OC Blog Articles Related To This Bill</h4>
<ul>
- <% articles.each do |article| %>
+ <% @related_articles.each do |article| %>
<li>
<a href="<%= url_for :controller => 'articles', :action => 'view', :id => article %>">
<span class='title'><%= article.title %></span>
@@ -36,17 +36,17 @@
<div class="pies clear">
- <%= roll_call_sublists_by_vote_type('+', vote).html_safe %>
+ <%#= roll_call_sublists_by_vote_type('+', vote).html_safe %>
<div class="pie-chart" id='roll_call_Aye_chart_<%= vote.id %>'>
<%= ofc2(165,120, "roll_call/partyvote_piechart_data/#{vote.id}?breakdown_type=#{CGI.escape("+")}&disclaimer_off=true&radius=40").html_safe %>
</div>
- <% roll_call_sublists_by_vote_type('-', vote).html_safe %>
+ <%# roll_call_sublists_by_vote_type('-', vote).html_safe %>
<div class="pie-chart" id='roll_call_Nay_chart_<%= vote.id %>'>
<%= ofc2(165,120, "roll_call/partyvote_piechart_data/#{vote.id}?breakdown_type=-&disclaimer_off=true&radius=40").html_safe %>
</div>
- <%= roll_call_sublists_by_vote_type('0', vote).html_safe %>
+ <%#= roll_call_sublists_by_vote_type('0', vote).html_safe %>
<div class="pie-chart last" id='roll_call_Abstain_chart_<%= vote.id %>'>
<%= ofc2(165,120, "roll_call/partyvote_piechart_data/#{vote.id}?breakdown_type=0&disclaimer_off=true&radius=40").html_safe %>
</div>
Oops, something went wrong.

0 comments on commit 7915ca2

Please sign in to comment.