Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 19 commits
  • 157 files changed
  • 0 commit comments
  • 4 contributors
Showing with 8,725 additions and 3,009 deletions.
  1. +1 −0  .rvmrc
  2. +0 −2  .travis.yml
  3. +6 −4 Gemfile
  4. +33 −27 Gemfile.lock
  5. +1 −1  app/assets/stylesheets/default_v3.sass
  6. +8 −1 app/controllers/application_controller.rb
  7. +1 −1  app/controllers/prediction_groups_controller.rb
  8. +1 −0  app/models/announcement.rb
  9. +2 −1  app/models/answer.rb
  10. +4 −3 app/models/article.rb
  11. +1 −0  app/models/audio.rb
  12. +1 −0  app/models/authentication.rb
  13. +1 −0  app/models/card.rb
  14. +1 −0  app/models/categorization.rb
  15. +1 −0  app/models/category.rb
  16. +1 −0  app/models/chirp.rb
  17. +1 −0  app/models/classified.rb
  18. +2 −1  app/models/comment.rb
  19. +1 −1  app/models/consumer_token.rb
  20. +4 −3 app/models/content.rb
  21. +1 −1  app/models/content_image.rb
  22. +1 −2  app/models/dashboard_message.rb
  23. +2 −1  app/models/event.rb
  24. +8 −0 app/models/external_auth_key.rb
  25. +9 −0 app/models/external_auth_keys.rb
  26. +1 −0  app/models/featured_item.rb
  27. +1 −0  app/models/feed.rb
  28. +1 −0  app/models/flag.rb
  29. +2 −1  app/models/forum.rb
  30. +2 −1  app/models/gallery.rb
  31. +1 −0  app/models/gallery_item.rb
  32. +2 −0  app/models/go.rb
  33. +2 −1  app/models/idea.rb
  34. +1 −0  app/models/idea_board.rb
  35. +2 −1  app/models/image.rb
  36. +2 −1  app/models/item_action.rb
  37. +1 −0  app/models/item_score.rb
  38. +1 −0  app/models/item_tweet.rb
  39. +1 −0  app/models/menu_item.rb
  40. +1 −0  app/models/message.rb
  41. +1 −0  app/models/metadata.rb
  42. +1 −0  app/models/newswire.rb
  43. +1 −0  app/models/prediction_group.rb
  44. +2 −0  app/models/prediction_guess.rb
  45. +2 −1  app/models/prediction_question.rb
  46. +1 −0  app/models/prediction_result.rb
  47. +1 −0  app/models/prediction_score.rb
  48. +2 −1  app/models/question.rb
  49. +1 −0  app/models/related_item.rb
  50. +2 −1  app/models/resource.rb
  51. +1 −0  app/models/resource_section.rb
  52. +1 −0  app/models/role.rb
  53. +4 −0 app/models/score.rb
  54. +1 −0  app/models/sent_card.rb
  55. +18 −0 app/models/site.rb
  56. +6 −0 app/models/site_group.rb
  57. +5 −0 app/models/smtp_setting.rb
  58. +1 −0  app/models/source.rb
  59. +1 −0  app/models/topic.rb
  60. +1 −0  app/models/tweet.rb
  61. +1 −0  app/models/tweet_account.rb
  62. +1 −0  app/models/tweet_stream.rb
  63. +1 −0  app/models/tweet_url.rb
  64. +1 −1  app/models/tweeted_item.rb
  65. +4 −4 app/models/url.rb
  66. +9 −1 app/models/user.rb
  67. +1 −1  app/models/user_profile.rb
  68. +2 −1  app/models/video.rb
  69. +1 −0  app/models/view_object.rb
  70. +1 −0  app/models/view_object_template.rb
  71. +1 −0  app/models/view_tree_edge.rb
  72. +5 −0 app/models/vote.rb
  73. +1 −0  app/models/widget.rb
  74. +1 −0  app/models/widget_page.rb
  75. +10 −10 app/views/articles/edit.html.haml
  76. +9 −9 app/views/articles/new.html.haml
  77. +1 −1  app/views/articles/old_new.html.haml
  78. +7 −7 app/views/classifieds/edit.html.haml
  79. +9 −9 app/views/classifieds/new.html.haml
  80. +1 −1  app/views/galleries/add_gallery_item.html.haml
  81. +1 −1  app/views/galleries/edit.html.haml
  82. +1 −1  app/views/galleries/new.html.haml
  83. +7 −7 app/views/ideas/new.html.haml
  84. +1 −1  app/views/prediction_groups/new.html.haml
  85. +1 −1  app/views/prediction_questions/new.html.haml
  86. +1 −1  app/views/prediction_results/new.html.haml
  87. +1 −1  app/views/questions/index.html.haml
  88. +1 −1  app/views/questions/new.html.haml
  89. +1 −1  app/views/questions/show.html.haml
  90. +10 −10 app/views/resources/new.html.haml
  91. +1 −1  app/views/shared/_prediction_question.html.haml
  92. +5 −5 app/views/shared/forms/_simple_story_post.html.haml
  93. +1 −1  app/views/shared/sidebar/_who_liked.html.haml
  94. +10 −10 app/views/stories/new.html.haml
  95. +1 −0  config/application.rb
  96. +14 −0 config/database.old
  97. +2 −19 config/initializers/001_application_settings.rb
  98. +1 −1  config/initializers/hoptoad.rb
  99. +14 −0 config/initializers/omniauth.rb
  100. +12 −0 config/initializers/resque.rb
  101. +0 −32 config/initializers/resque_connection_fix.rb
  102. +0 −1  config/locales.yml.sample
  103. +2 −0  config/locales/en.yml
  104. +34 −0 config/mysql2psql.yml.example
  105. +9 −7 config/sitemap.rb
  106. +5,932 −0 db/development_structure.seed.sql
  107. +0 −1,583 db/development_structure.sql
  108. +126 −0 db/migrate/20111213194038_create_sites.rb
  109. +34 −0 db/migrate/20120102034459_create_external_auth_keys.rb
  110. +0 −25 db/migrate/20120122122155_move_admin_notes_to_comments.rb
  111. +34 −0 db/migrate/20120217004232_create_smtp_settings.rb
  112. +0 −1,183 db/schema.rb
  113. +8 −3 lib/activerecord_model_extensions.rb
  114. +1 −1  lib/acts_as_featured_item.rb
  115. +2 −2 lib/acts_as_moderatable.rb
  116. +37 −0 lib/n2/current_site.rb
  117. +16 −0 lib/rack/n2/site_switcher.rb
  118. +6 −3 lib/tweeter.rb
  119. +36 −0 multisite/migrate_site.rb
  120. +173 −0 multisite/migrate_sql.rb
  121. +95 −0 multisite/migrate_utils.rb
  122. +6 −0 multisite/mysql2postgres/.gitignore
  123. +6 −0 multisite/mysql2postgres/Gemfile
  124. +21 −0 multisite/mysql2postgres/Gemfile.lock
  125. +20 −0 multisite/mysql2postgres/MIT-LICENSE
  126. +133 −0 multisite/mysql2postgres/README.rdoc
  127. +87 −0 multisite/mysql2postgres/Rakefile
  128. +7 −0 multisite/mysql2postgres/bin/mysql2psql
  129. +41 −0 multisite/mysql2postgres/lib/mysql2psql.rb
  130. +100 −0 multisite/mysql2postgres/lib/mysql2psql/config.rb
  131. +39 −0 multisite/mysql2postgres/lib/mysql2psql/config_base.rb
  132. +55 −0 multisite/mysql2postgres/lib/mysql2psql/converter.rb
  133. +16 −0 multisite/mysql2postgres/lib/mysql2psql/errors.rb
  134. +210 −0 multisite/mysql2postgres/lib/mysql2psql/mysql_reader.rb
  135. +179 −0 multisite/mysql2postgres/lib/mysql2psql/postgres_db_writer.rb
  136. +142 −0 multisite/mysql2postgres/lib/mysql2psql/postgres_file_writer.rb
  137. +143 −0 multisite/mysql2postgres/lib/mysql2psql/postgres_writer.rb
  138. +9 −0 multisite/mysql2postgres/lib/mysql2psql/version.rb
  139. +6 −0 multisite/mysql2postgres/lib/mysql2psql/writer.rb
  140. +90 −0 multisite/mysql2postgres/mysql2psql.gemspec
  141. +29 −0 multisite/mysql2postgres/test/integration/convert_to_db_test.rb
  142. +66 −0 multisite/mysql2postgres/test/integration/convert_to_file_test.rb
  143. +34 −0 multisite/mysql2postgres/test/integration/converter_test.rb
  144. +42 −0 multisite/mysql2postgres/test/integration/mysql_reader_base_test.rb
  145. +47 −0 multisite/mysql2postgres/test/integration/mysql_reader_test.rb
  146. +30 −0 multisite/mysql2postgres/test/integration/postgres_db_writer_base_test.rb
  147. +29 −0 multisite/mysql2postgres/test/lib/ext_test_unit.rb
  148. +88 −0 multisite/mysql2postgres/test/lib/test_helper.rb
  149. +49 −0 multisite/mysql2postgres/test/units/config_base_test.rb
  150. +31 −0 multisite/mysql2postgres/test/units/config_test.rb
  151. +29 −0 multisite/mysql2postgres/test/units/postgres_file_writer_test.rb
  152. +26 −0 multisite/n2_pg_migration.yml
  153. +36 −0 mysql2psql.yml
  154. +0 −5 public/robots.txt
  155. +5 −0 spec/models/external_auth_keys_spec.rb
  156. +5 −0 spec/models/site_spec.rb
  157. +5 −0 spec/models/smtp_setting_spec.rb
View
1  .rvmrc
@@ -0,0 +1 @@
+rvm use ree@n2 --create
View
2  .travis.yml
@@ -1,6 +1,4 @@
before_script:
- - "mysql -e 'create database n2_test'; mysql n2_test < db/development_structure.sql"
- - "mysql -e 'create database n2_development'; mysql n2_development < db/development_structure.sql"
script:
- "echo $PWD; ruby script/copy_configs.rb; bundle exec rake db:migrate db:setup db:test:clone_structure spec"
View
10 Gemfile
@@ -17,11 +17,12 @@ gem "friendly_id", '3.3.1'
gem 'will_paginate'
gem "oauth-plugin", ">= 0.4.0.pre1"
gem "twitter", :git => "https://github.com/jnunemaker/twitter.git"
-gem "mysql2"
+gem "pg"
gem "bitly"
gem "redis"
gem "redis-namespace"
gem "resque", :git => 'git://github.com/defunkt/resque.git'
+gem "resque-retry"
gem "resque-scheduler", :require => 'resque_scheduler'
gem 'sitemap_generator'
gem "SystemTimer"
@@ -38,9 +39,10 @@ gem 'routing-filter'
# Patched this to fix issues with the Translation model
gem 'i18n_backend_database', :git => "git://github.com/chewbranca/i18n_backend_database.git"
# JVD: Use this when developing, checkout the i18n_backend_database to ../
-# gem 'i18n_backend_database', :path => "../i18n_backend_database"
+#gem 'i18n_backend_database', :path => "../i18n_backend_database"
-gem "hoptoad_notifier"
+#gem "hoptoad_notifier"
+gem "airbrake"
gem "acts-as-taggable-on"
gem 'redis-store'
@@ -48,7 +50,7 @@ gem 'redis-store'
# Feedzirra related
gem 'nokogiri'
gem 'loofah'
-gem 'feedzirra', :git => 'https://github.com/pauldix/feedzirra.git'
+gem 'feedzirra', :git => 'https://github.com/pauldix/feedzirra.git', :ref => 'e877446a285f18530218a7891a731dce8d9683ab'
#gem 'curb', :git => 'git://github.com/taf2/curb.git'
#gem 'sax-machine', :git => 'git://github.com/pauldix/sax-machine.git'
View
60 Gemfile.lock
@@ -27,9 +27,9 @@ GIT
GIT
remote: git://github.com/defunkt/resque.git
- revision: 8aad2e1d78f913902ec75a91e3de4fba30eb2fb9
+ revision: 96bb1b2797132db4bf8464c8a1e85650c738092d
specs:
- resque (1.19.0)
+ resque (1.20.0)
multi_json (~> 1.0)
redis-namespace (~> 1.0.2)
sinatra (>= 0.9.2)
@@ -45,14 +45,14 @@ GIT
GIT
remote: git://github.com/mkdynamic/omniauth-facebook.git
- revision: 0a878f3520d21672772b6085442e13445e6e4784
+ revision: cf13590662ba0007719060deb4eecfe65c50b879
specs:
omniauth-facebook (1.2.0)
omniauth-oauth2 (~> 1.0.0)
GIT
remote: https://github.com/jnunemaker/twitter.git
- revision: 20bcc2aa717d86f8c17d969eb7c7d56b110c2f0d
+ revision: f50ff25cff3307090f602ff83d21519599d11559
specs:
twitter (2.1.0)
activesupport (>= 2.3.9, < 4)
@@ -62,7 +62,8 @@ GIT
GIT
remote: https://github.com/pauldix/feedzirra.git
- revision: dee1454980e7b93022776cd047ad419da3999332
+ revision: e877446a285f18530218a7891a731dce8d9683ab
+ ref: e877446a285f18530218a7891a731dce8d9683ab
specs:
feedzirra (0.1.1)
activesupport (>= 3.0.8)
@@ -80,7 +81,7 @@ GEM
specs:
SystemTimer (1.2.3)
ZenTest (4.5.0)
- aasm (3.0.2)
+ aasm (3.0.3)
activerecord
acl9 (0.12.0)
actionmailer (3.1.3)
@@ -114,17 +115,20 @@ GEM
acts-as-taggable-on (2.2.2)
rails (~> 3.0)
acts_as_tree (0.1.1)
- addressable (2.2.6)
+ addressable (2.2.7)
+ airbrake (3.0.9)
+ activesupport
+ builder
amazon-ecs (2.2.4)
nokogiri (~> 1.4)
ruby-hmac (~> 0.3)
- arel (2.2.1)
+ arel (2.2.3)
awesome_print (1.0.2)
aws-s3 (0.6.2)
builder
mime-types
xml-simple
- aws-sdk (1.3.4)
+ aws-sdk (1.3.5)
httparty (~> 0.7)
json (~> 1.4)
nokogiri (>= 1.4.4)
@@ -135,7 +139,7 @@ GEM
httparty (>= 0.7.6)
oauth2 (~> 0.5.0)
builder (3.0.0)
- capistrano (2.9.0)
+ capistrano (2.11.2)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
@@ -157,22 +161,22 @@ GEM
compass-960-plugin (0.10.4)
compass (>= 0.10.0)
crack (0.3.1)
- cucumber (1.1.4)
+ cucumber (1.1.9)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
- gherkin (~> 2.7.1)
+ gherkin (~> 2.9.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
- cucumber-rails (1.2.1)
+ cucumber-rails (1.3.0)
capybara (>= 1.1.2)
- cucumber (>= 1.1.3)
+ cucumber (>= 1.1.8)
nokogiri (>= 1.5.0)
curb (0.7.18)
daemon_controller (1.0.0)
database_cleaner (0.7.0)
diff-lcs (1.1.3)
erubis (2.7.0)
- factory_girl (2.5.2)
+ factory_girl (2.6.0)
activesupport (>= 2.3.9)
faraday (0.7.6)
addressable (~> 2.2)
@@ -183,15 +187,12 @@ GEM
friendly_id (3.3.1)
babosa (~> 0.3.0)
fssm (0.2.8.1)
- gherkin (2.7.7)
+ gherkin (2.9.0)
json (>= 1.4.6)
haml (3.1.4)
hashie (1.2.0)
highline (1.6.11)
hike (1.2.1)
- hoptoad_notifier (2.4.11)
- activesupport
- builder
httmultiparty (0.3.6)
httparty (>= 0.7.3)
multipart-post
@@ -212,7 +213,6 @@ GEM
multi_json (1.0.4)
multi_xml (0.4.1)
multipart-post (1.1.5)
- mysql2 (0.3.11)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
@@ -220,7 +220,7 @@ GEM
net-ssh (2.3.0)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
- newrelic_rpm (3.3.1)
+ newrelic_rpm (3.3.2)
nokogiri (1.5.0)
oauth (0.4.5)
oauth-plugin (0.4.0.rc2)
@@ -242,7 +242,7 @@ GEM
omniauth (~> 1.0)
omniauth-twitter (0.0.8)
omniauth-oauth (~> 1.0)
- paperclip (2.6.0)
+ paperclip (2.7.0)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
cocaine (>= 0.0.2)
@@ -252,6 +252,7 @@ GEM
fastthread (>= 1.0.1)
rack
rake (>= 0.8.1)
+ pg (0.13.2)
pickle (0.4.10)
cucumber (>= 0.8)
rake
@@ -294,8 +295,12 @@ GEM
redis (2.2.2)
redis-namespace (1.0.3)
redis (< 3.0.0)
- redis-store (1.0.0.1)
- redis (~> 2.2.1)
+ redis-store (1.1.0)
+ redis (~> 2.2.0)
+ resque-retry (0.2.2)
+ rake
+ resque (>= 1.8.0)
+ resque-scheduler (>= 1.8.0)
resque-scheduler (1.9.9)
redis (>= 2.0.1)
resque (>= 1.8.0)
@@ -346,7 +351,7 @@ GEM
tilt (~> 1.1, != 1.3.0)
term-ansicolor (1.0.7)
thor (0.14.6)
- thumbs_up (0.4.6)
+ thumbs_up (0.5.1)
activerecord
tilt (1.3.3)
treetop (1.4.10)
@@ -372,6 +377,7 @@ DEPENDENCIES
acl9
acts-as-taggable-on
acts_as_tree
+ airbrake
amazon-ecs
awesome_print
aws-s3
@@ -390,13 +396,11 @@ DEPENDENCIES
formtastic!
friendly_id (= 3.3.1)
haml
- hoptoad_notifier
i18n_backend_database!
json
launchy
loofah
mogli!
- mysql2
newrelic_rpm
nokogiri
oauth-plugin (>= 0.4.0.pre1)
@@ -405,6 +409,7 @@ DEPENDENCIES
omniauth-twitter
paperclip
passenger
+ pg
pickle
prototype-rails
rails (= 3.1.3)
@@ -414,6 +419,7 @@ DEPENDENCIES
redis-namespace
redis-store
resque!
+ resque-retry
resque-scheduler
routing-filter
rr
View
2  app/assets/stylesheets/default_v3.sass
@@ -770,7 +770,7 @@ p
border: 1px solid scale-color($tertiary-bg-color, $lightness: -10%)
border-top-width: 0
padding: $ninesixty_gutter_width / 2
- text-align: center
+ text-align: left
.email-widget
padding-top: $ninesixty_gutter_width / 2
padding-right: 2px
View
9 app/controllers/application_controller.rb
@@ -310,7 +310,7 @@ def update_last_active
last_active = current_user.last_active
current_user.touch(:last_active)
begin
- if current_facebook_user
+ if current_facebook_user and current_facebook_user.has_facebook_auth?
unless not Rails.env.development? and last_active and current_user.last_active < last_active + 1.hour
redis_friends = $redis.smembers "#{current_user.cache_id}:friends"
unless redis_friends.any? and last_active and current_user.last_active < last_active + 4.hours
@@ -325,6 +325,13 @@ def update_last_active
end
rescue Mogli::Client::HTTPException => e
# Just move on if facebook friends request fails
+ rescue Mogli::Client::OAuthException => e
+ #set_current_user(nil)
+ #reset_session
+ current_user.destroy_facebook_authentication!
+ flash[:error] = "Your facebook session has expired. Please login again with facebook."
+ store_location
+ redirect_to new_session_path
end
end
View
2  app/controllers/prediction_groups_controller.rb
@@ -48,7 +48,7 @@ def play
if params[:id].nil?
# to do - get first open
@prediction_group = PredictionGroup.approved.currently_open.first
- #:all, :order => "rand()"
+ #:all, :order => "random()"
else
@prediction_group = PredictionGroup.find(params[:id])
end
View
1  app/models/announcement.rb
@@ -1,4 +1,5 @@
class Announcement < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
validates_presence_of :title
View
3  app/models/answer.rb
@@ -1,4 +1,5 @@
class Answer < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
@@ -15,7 +16,7 @@ class Answer < ActiveRecord::Base
scope :top, lambda { |*args| { :order => ["votes_tally desc, created_at desc"], :limit => (args.first || 10)} }
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["created_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true "],:order => ["created_at desc"], :limit => (args.first || 3)} }
def voices
Answer.find(:all, :include => :user, :group => :user_id, :conditions => {:question_id => self.question_id}).map(&:user)
View
7 app/models/article.rb
@@ -1,4 +1,5 @@
class Article < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
@@ -13,10 +14,10 @@ class Article < ActiveRecord::Base
has_one :content
belongs_to :author, :class_name => "User"
- scope :published, { :conditions => ["is_draft = 0"] }
- scope :draft, { :conditions => ["is_draft = 1"] }
+ scope :published, { :conditions => ["is_draft = false"] }
+ scope :draft, { :conditions => ["is_draft = is true"] }
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["featured_at desc"], :limit => (args.first || 1)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["featured_at desc"], :limit => (args.first || 1)} }
scope :blog_roll, lambda { |*args| { :select => "count(author_id) as author_article_count, author_id", :group => "author_id", :order => "author_article_count desc", :limit => (args.first || 30)} }
accepts_nested_attributes_for :content
View
1  app/models/audio.rb
@@ -1,4 +1,5 @@
class Audio < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
acts_as_voteable
View
1  app/models/authentication.rb
@@ -1,4 +1,5 @@
class Authentication < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :user
#validates_presence_of :user, :provider, :uid
View
1  app/models/card.rb
@@ -1,4 +1,5 @@
class Card < ActiveRecord::Base
+ include N2::CurrentSite
if File.exist?(File.join(Rails.root, "config", "s3.yml"))
PAPERCLIP_STORAGE_OPTIONS = {
View
1  app/models/categorization.rb
@@ -1,4 +1,5 @@
class Categorization < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :category
belongs_to :categorizable, :polymorphic => true
View
1  app/models/category.rb
@@ -1,4 +1,5 @@
class Category < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :parent, :class_name => "Category"
has_many :subcategories, :class_name => "Category", :foreign_key => :parent_id
View
1  app/models/chirp.rb
@@ -1,4 +1,5 @@
class Chirp < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
belongs_to :chirper, :class_name => "User", :foreign_key => :user_id
View
1  app/models/classified.rb
@@ -1,4 +1,5 @@
class Classified < ActiveRecord::Base
+ include N2::CurrentSite
include AASM
acts_as_authorization_object
View
3  app/models/comment.rb
@@ -1,4 +1,5 @@
class Comment < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
acts_as_voteable
@@ -10,7 +11,7 @@ class Comment < ActiveRecord::Base
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 5)} }
scope :top, lambda { |*args| { :order => ["likes_count desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["featured_at desc"], :limit => (args.first || 1)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["featured_at desc"], :limit => (args.first || 1)} }
# scope :controversial, lambda { |*args| { :order => ["??? desc"], :limit => (args.first || 10)} }
validates_presence_of :comments
View
2  app/models/consumer_token.rb
@@ -1,5 +1,5 @@
require 'oauth/models/consumers/token'
class ConsumerToken < ActiveRecord::Base
+ include N2::CurrentSite
include Oauth::Models::Consumers::Token
-
end
View
7 app/models/content.rb
@@ -1,4 +1,5 @@
class Content < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_featured_item
acts_as_media_item
@@ -25,15 +26,15 @@ class Content < ActiveRecord::Base
has_friendly_id :title, :use_slug => true
- scope :published, { :joins => "LEFT JOIN articles on contents.article_id = articles.id", :conditions => ["contents.is_blocked =0 and (article_id is NULL OR (article_id IS NOT NULL and articles.is_draft = 0))"] }
- scope :unpublished, { :joins => "LEFT JOIN articles on contents.article_id = articles.id", :conditions => ["contents.is_blocked =0 and (article_id is NULL OR (article_id IS NOT NULL and articles.is_draft = 1))"] }
+ scope :published, { :joins => "LEFT JOIN articles on contents.article_id = articles.id", :conditions => ["contents.is_blocked is false and (article_id is NULL OR (article_id IS NOT NULL and articles.is_draft is false))"] }
+ scope :unpublished, { :joins => "LEFT JOIN articles on contents.article_id = articles.id", :conditions => ["contents.is_blocked is false and (article_id is NULL OR (article_id IS NOT NULL and articles.is_draft is true))"] }
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
scope :commented, :conditions => ["comments_count > 0"]
scope :top, lambda { |*args| { :order => ["votes_tally desc, created_at desc"], :limit => (args.first || 10)} }
scope :newest_stories, lambda { |*args| { :conditions => ["article_id IS NULL"], :order => ["created_at desc"], :limit => (args.first || 5)} }
scope :articles, { :conditions => ["article_id is not null"] }
scope :stories, { :conditions => ["article_id IS NULL"], :order => ["created_at desc"]}
- scope :featured, lambda { |*args| { :conditions => ["contents.is_featured = 1"], :limit => (args.first || 5) } }
+ scope :featured, lambda { |*args| { :conditions => ["contents.is_featured is true"], :limit => (args.first || 5) } }
attr_accessor :image_url, :tags_string, :is_draft
View
2  app/models/content_image.rb
@@ -1,8 +1,8 @@
class ContentImage < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :content
def to_s
self.url
end
-
end
View
3  app/models/dashboard_message.rb
@@ -1,7 +1,7 @@
class DashboardMessage < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
-
belongs_to :user
scope :sent, {:conditions => ["status = ?", 'sent'] }
@@ -44,5 +44,4 @@ def set_success! news_id
def recipient_voices
User.all
end
-
end
View
3  app/models/event.rb
@@ -1,4 +1,5 @@
class Event < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
acts_as_featured_item
@@ -10,7 +11,7 @@ class Event < ActiveRecord::Base
acts_as_tweetable
scope :newest, lambda { |*args| { :conditions => ["start_time > now()"], :order => ["created_at desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1 AND start_time > now()"],:order => ["created_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true AND start_time > now()"],:order => ["created_at desc"], :limit => (args.first || 3)} }
scope :upcoming, lambda { |*args| { :conditions => ["start_time > now()"], :order => ["start_time asc"], :limit => (args.first || 10)} }
belongs_to :user
View
8 app/models/external_auth_key.rb
@@ -0,0 +1,8 @@
+class ExternalAuthKey < ActiveRecord::Base
+ include N2::CurrentSite
+
+ # Given type of 'facebook', loads the keys/secrets for that site's fb
+ def self.load type
+ where(:external_site_type => type).first
+ end
+end
View
9 app/models/external_auth_keys.rb
@@ -0,0 +1,9 @@
+# Omniauth uses the information in this table.
+class ExternalAuthKeys < ActiveRecord::Base
+ include N2::CurrentSite
+
+ # Given type of 'facebook', loads the keys/secrets for that site's fb
+ def self.load type
+ where(:external_site_type => type).first
+ end
+end
View
1  app/models/featured_item.rb
@@ -1,4 +1,5 @@
class FeaturedItem < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_tree
belongs_to :featurable, :polymorphic => true
View
1  app/models/feed.rb
@@ -1,4 +1,5 @@
class Feed < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
acts_as_taggable_on :tags, :topics
View
1  app/models/flag.rb
@@ -1,4 +1,5 @@
class Flag < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :user
belongs_to :flaggable, :polymorphic => true, :counter_cache => true, :touch => true
View
3  app/models/forum.rb
@@ -1,4 +1,5 @@
class Forum < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
@@ -16,7 +17,7 @@ class Forum < ActiveRecord::Base
scope :positioned, :order => ["position desc, name asc"]
scope :alpha, :order => ["name asc"]
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["featured_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["featured_at desc"], :limit => (args.first || 3)} }
validates_presence_of :name, :description
View
3  app/models/gallery.rb
@@ -1,4 +1,5 @@
class Gallery < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_media_item
acts_as_voteable
@@ -17,7 +18,7 @@ class Gallery < ActiveRecord::Base
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
scope :top, lambda { |*args| { :order => ["votes_tally desc, created_at desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["featured_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["featured_at desc"], :limit => (args.first || 3)} }
validates_presence_of :user
validates_presence_of :title, :description
View
1  app/models/gallery_item.rb
@@ -1,4 +1,5 @@
class GalleryItem < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :gallery
belongs_to :user
View
2  app/models/go.rb
@@ -1,4 +1,6 @@
class Go < ActiveRecord::Base
+ include N2::CurrentSite
+
acts_as_featured_item
acts_as_moderatable
View
3  app/models/idea.rb
@@ -1,4 +1,5 @@
class Idea < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
acts_as_featured_item
@@ -10,7 +11,7 @@ class Idea < ActiveRecord::Base
acts_as_tweetable
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["created_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["created_at desc"], :limit => (args.first || 3)} }
belongs_to :user
belongs_to :idea_board
View
1  app/models/idea_board.rb
@@ -1,4 +1,5 @@
class IdeaBoard < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_taggable_on :tags
acts_as_moderatable
acts_as_featured_item
View
3  app/models/image.rb
@@ -2,6 +2,7 @@
require 'timeout'
class Image < ActiveRecord::Base
+ include N2::CurrentSite
if File.exist?(File.join(Rails.root, "config", "s3.yml"))
PAPERCLIP_STORAGE_OPTIONS = {
@@ -25,7 +26,7 @@ class Image < ActiveRecord::Base
belongs_to :source
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 8)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["created_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["created_at desc"], :limit => (args.first || 3)} }
=begin
has_attached_file :image,
View
3  app/models/item_action.rb
@@ -1,4 +1,5 @@
class ItemAction < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :user
belongs_to :actionable, :polymorphic => true
@@ -25,7 +26,7 @@ def self.newest_for_user user, limit = 5
end
def self.newest_items limit = 5
- active.newest(limit).find(:all, :conditions => ["action_type = ? or action_type = ?", :posted_item.to_s, :tweeted_item.to_s]).map(&:actionable)
+ active.newest(limit).find(:all, :conditions => ["action_type LIKE ? or action_type = ?", "posted_%", :tweeted_item.to_s]).map(&:actionable)
end
def self.top_items opts = {}
View
1  app/models/item_score.rb
@@ -3,6 +3,7 @@
# Algorithm: http://amix.dk/uploads/reddit_cf_algorithm.png
class ItemScore < ActiveRecord::Base
+ include N2::CurrentSite
IMAGE_SCALING_FACTOR = 1.1
View
1  app/models/item_tweet.rb
@@ -1,4 +1,5 @@
class ItemTweet < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :item, :polymorphic => true
belongs_to :tweet
View
1  app/models/menu_item.rb
@@ -1,4 +1,5 @@
class MenuItem < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_tree
scope :root_items, :conditions => { :parent_id => nil }
View
1  app/models/message.rb
@@ -1,4 +1,5 @@
class Message < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :user
validates_presence_of :subject, :body, :email
View
1  app/models/metadata.rb
@@ -1,4 +1,5 @@
class Metadata < ActiveRecord::Base
+ include N2::CurrentSite
set_table_name :metadatas
serialize :data, Hash
View
1  app/models/newswire.rb
@@ -1,4 +1,5 @@
class Newswire < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
View
1  app/models/prediction_group.rb
@@ -1,4 +1,5 @@
class PredictionGroup < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
acts_as_featured_item
View
2  app/models/prediction_guess.rb
@@ -1,4 +1,6 @@
class PredictionGuess < ActiveRecord::Base
+ include N2::CurrentSite
+
belongs_to :user
belongs_to :prediction_question, :counter_cache => true, :touch => true
acts_as_moderatable
View
3  app/models/prediction_question.rb
@@ -1,4 +1,5 @@
class PredictionQuestion < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags
acts_as_featured_item
@@ -145,7 +146,7 @@ def get_guess_percentages
{
:guess => g.guess,
:percent => (100.0 * g.count.to_f / get_guess_totals),
- :users => self.prediction_guesses.find(:all, :conditions => [ "guess = ?",g.guess], :include => :user,:order => 'rand()', :limit => 10 )
+ :users => self.prediction_guesses.find(:all, :conditions => [ "guess = ?",g.guess], :include => :user,:order => 'random()', :limit => 10 )
}
end
end
View
1  app/models/prediction_result.rb
@@ -1,4 +1,5 @@
class PredictionResult < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :user
belongs_to :accepted_by, :class_name => 'User', :foreign_key => :accepted_by_user_id
belongs_to :prediction_question
View
1  app/models/prediction_score.rb
@@ -1,4 +1,5 @@
class PredictionScore < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
belongs_to :user
View
3  app/models/question.rb
@@ -1,4 +1,5 @@
class Question < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
@@ -21,7 +22,7 @@ class Question < ActiveRecord::Base
scope :top, lambda { |*args| { :order => ["(2*answers_count+votes_tally) desc, created_at desc"], :limit => (args.first || 10)} }
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
scope :unanswered, lambda { |*args| { :conditions => ["answers_count = 0"], :order => ["created_at asc"], :limit => (args.first || 10) } }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["created_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["created_at desc"], :limit => (args.first || 3)} }
def self.per_page; 20; end
View
1  app/models/related_item.rb
@@ -1,4 +1,5 @@
class RelatedItem < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
belongs_to :user
View
3  app/models/resource.rb
@@ -1,4 +1,5 @@
class Resource < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
acts_as_featured_item
@@ -10,7 +11,7 @@ class Resource < ActiveRecord::Base
acts_as_relatable
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["created_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["created_at desc"], :limit => (args.first || 3)} }
scope :top, lambda { |*args| { :order => ["votes_tally desc, created_at desc"], :limit => (args.first || 10)} }
belongs_to :user
View
1  app/models/resource_section.rb
@@ -1,4 +1,5 @@
class ResourceSection < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_featured_item
acts_as_moderatable
acts_as_taggable_on :tags
View
1  app/models/role.rb
@@ -1,3 +1,4 @@
class Role < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_authorization_role :join_table_name => 'a table here'
end
View
4 app/models/score.rb
@@ -1,4 +1,5 @@
class Score < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :user
belongs_to :scorable, :polymorphic => true
@@ -40,6 +41,9 @@ def self.alltime_scores limit = nil
def self.calc_scores time = nil, limit = 10
limit ||= 10
+ # TODO RAILS3
+ return self.limit(10).select('0 as karma_score, 0 as activity_score, 0 as total_score, user_id')
+
if time.nil?
self.find(:all, :select => "SUM(IF(score_type = 'karma', value, 0)) AS karma_score, SUM(IF(score_type = 'participation', value, 0)) AS activity_score, SUM(value) AS total_score, user_id", :conditions => ["user_id NOT IN (SELECT id FROM users WHERE is_admin is true or is_moderator is true or is_blocked is true)"], :group => "user_id", :having => "total_score > 0", :limit => limit, :include => :user, :order => "total_score desc")
else
View
1  app/models/sent_card.rb
@@ -1,4 +1,5 @@
class SentCard < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
View
18 app/models/site.rb
@@ -0,0 +1,18 @@
+class Site < ActiveRecord::Base
+ validates :domain, :name, :presence => true
+
+ belongs_to :site_group
+
+ def self.current
+ @current_site || default
+ end
+
+ def self.current_domain= domain
+ @current_site = Site.where('lower(domain) = ?', domain.downcase).first || default
+ end
+
+ # There should always be a default site (right?)
+ def self.default
+ Site.order('id').first
+ end
+end
View
6 app/models/site_group.rb
@@ -0,0 +1,6 @@
+class SiteGroup < ActiveRecord::Base
+ has_and_belongs_to_many :sites
+ belongs_to :primary_site, :class_name => 'Site'
+
+ validates :name, :primary_site, :presence => true
+end
View
5 app/models/smtp_setting.rb
@@ -0,0 +1,5 @@
+class SmtpSetting < ActiveRecord::Base
+ include N2::CurrentSite
+ validates :address, :port, :domain, :authentication, :username, :password, :presence => true
+ self.primary_key = :site_id
+end
View
1  app/models/source.rb
@@ -1,4 +1,5 @@
class Source < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
View
1  app/models/topic.rb
@@ -1,4 +1,5 @@
class Topic < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_voteable
acts_as_taggable_on :tags, :sections
View
1  app/models/tweet.rb
@@ -1,4 +1,5 @@
class Tweet < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
acts_as_taggable_on :tags, :topics
View
1  app/models/tweet_account.rb
@@ -1,4 +1,5 @@
class TweetAccount < ActiveRecord::Base
+ include N2::CurrentSite
has_many :tweets
belongs_to :user
acts_as_taggable_on :tags, :sections
View
1  app/models/tweet_stream.rb
@@ -1,4 +1,5 @@
class TweetStream < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
acts_as_taggable_on :tags, :topics
View
1  app/models/tweet_url.rb
@@ -1,4 +1,5 @@
class TweetUrl < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :tweet
belongs_to :url
end
View
2  app/models/tweeted_item.rb
@@ -1,4 +1,4 @@
class TweetedItem < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :item, :polymorphic => true
-
end
View
8 app/models/url.rb
@@ -1,4 +1,5 @@
class Url < ActiveRecord::Base
+ include N2::CurrentSite
has_many :tweet_urls
has_many :urls, :through => :tweet_urls
belongs_to :source
@@ -10,8 +11,7 @@ class Url < ActiveRecord::Base
private
- def set_source
- self.source = Source.find_or_create_from_url url
- end
-
+ def set_source
+ self.source = Source.find_or_create_from_url url
+ end
end
View
10 app/models/user.rb
@@ -1,4 +1,5 @@
class User < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_authorization_subject :join_table_name => 'roles_users'
has_and_belongs_to_many :roles
@@ -6,7 +7,6 @@ class User < ActiveRecord::Base
acts_as_voter
acts_as_moderatable
- #scope :top, lambda { |*args| { :order => ["karma_score desc"], :limit => (args.first || 5), :conditions => ["karma_score > 0 and is_admin = 0 and is_editor=0"]} }
scope :top, lambda { |*args| { :order => ["karma_score desc"], :limit => (args.first || 5), :conditions => ["karma_score > 0"]} }
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 5), :conditions => ["created_at > ?", 2.months.ago]} }
scope :last_active, lambda { { :conditions => ["last_active > ?", 60.minutes.ago], :order => ["last_active desc"] } }
@@ -213,6 +213,10 @@ def facebook_user?
return !fb_user_id.nil? && fb_user_id > 0
end
+ def has_facebook_auth?
+ authentications.for_facebook.any?
+ end
+
def accepts_email_notifications?
self.email.present? and self.user_profile.receive_email_notifications == true and !self.system_user?
end
@@ -503,6 +507,10 @@ def is_identity_user? user
self == user
end
+ def destroy_facebook_authentication!
+ authentications.for_facebook.map(&:destroy)
+ end
+
private
def mogli_client
View
2  app/models/user_profile.rb
@@ -1,4 +1,5 @@
class UserProfile < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
belongs_to :user
@@ -14,5 +15,4 @@ def self.expire_all
def self.sweeper
UserSweeper
end
-
end
View
3  app/models/video.rb
@@ -1,4 +1,5 @@
class Video < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_moderatable
acts_as_voteable
@@ -10,7 +11,7 @@ class Video < ActiveRecord::Base
belongs_to :source
scope :newest, lambda { |*args| { :order => ["created_at desc"], :limit => (args.first || 10)} }
- scope :featured, lambda { |*args| { :conditions => ["is_featured=1"],:order => ["created_at desc"], :limit => (args.first || 3)} }
+ scope :featured, lambda { |*args| { :conditions => ["is_featured is true"],:order => ["created_at desc"], :limit => (args.first || 3)} }
validates_format_of :remote_video_url, :with => /\Ahttp(s?):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/i, :message => "should look like a URL", :allow_blank => true
validates_format_of :remote_video_url, :with => /(youtube|vimeo|boston).com/i, :message => "should be a youtube or vimeo url", :allow_blank => true
View
1  app/models/view_object.rb
@@ -1,4 +1,5 @@
class ViewObject < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :view_object_template
belongs_to :parent, :class_name => "ViewObject", :foreign_key => :parent_id
View
1  app/models/view_object_template.rb
@@ -1,3 +1,4 @@
class ViewObjectTemplate < ActiveRecord::Base
+ include N2::CurrentSite
has_many :view_objects
end
View
1  app/models/view_tree_edge.rb
@@ -1,4 +1,5 @@
class ViewTreeEdge < ActiveRecord::Base
+ include N2::CurrentSite
belongs_to :parent, :class_name => "ViewObject"
belongs_to :child, :class_name => "ViewObject"
end
View
5 app/models/vote.rb
@@ -1,4 +1,5 @@
class Vote < ActiveRecord::Base
+ include N2::CurrentSite
scope :for_voter, lambda { |*args| {:conditions => ["voter_id = ? AND voter_type = ?", args.first.id, args.first.type.name]} }
scope :for_voteable, lambda { |*args| {:conditions => ["voteable_id = ? AND voteable_type = ?", args.first.id, args.first.type.name]} }
@@ -48,6 +49,10 @@ def self.top_items limit = 5, range = nil, min_items = nil
end
end
+ def self.item_voices item
+ for_voteable(item).select('distinct voter_id').map {|vid| User.active.find(vid.voter_id) }
+ end
+
private
def update_voteable_count
View
1  app/models/widget.rb
@@ -1,4 +1,5 @@
class Widget < ActiveRecord::Base
+ include N2::CurrentSite
has_many :metadatas, :as => :metadatable
View
1  app/models/widget_page.rb
@@ -1,4 +1,5 @@
class WidgetPage < ActiveRecord::Base
+ include N2::CurrentSite
acts_as_tree
belongs_to :widget
View
20 app/views/articles/edit.html.haml
@@ -71,8 +71,8 @@
= content_form.input :title
%p= form.input :body
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
.panel2
= form.semantic_fields_for :content do |content_form|
= content_form.inputs do
@@ -81,9 +81,9 @@
#article_status= label_tag :status, t('articles.status')
= select_tag :is_draft, options_for_select( { t('articles.draft') => 1, t('articles.publish') => 0 }, (@article.is_draft ? 1 : 0) )
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel3
= form.semantic_fields_for :content do |content_form|
@@ -94,16 +94,16 @@
.items
%a.next.browse.right_scroll
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel4
= form.semantic_fields_for :content do |content_form|
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => content_form, :item => @article.content }
= form.buttons do
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
= stylesheet_link_tag 'jquery.wysiwyg.css'
= javascript_include_tag 'jquery.wysiwyg.js'
View
18 app/views/articles/new.html.haml
@@ -71,7 +71,7 @@
= content_form.input :title
= form.input :body
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
.panel2
= form.semantic_fields_for :content do |content_form|
= content_form.inputs do
@@ -80,9 +80,9 @@
#article_status= label_tag :status, t('articles.status')
= select_tag :is_draft, options_for_select( { t('articles.draft') => 1, t('articles.publish') => 0 }, (@article.is_draft ? 1 : 0) )
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel3
= form.semantic_fields_for :content do |content_form|
@@ -93,16 +93,16 @@
.items
%a.next.browse.right_scroll
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel4
= form.semantic_fields_for :content do |content_form|
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => content_form, :item => @article.content }
= form.buttons do
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
= stylesheet_link_tag 'jquery.wysiwyg.css'
= javascript_include_tag 'jquery.wysiwyg.js'
View
2  app/views/articles/old_new.html.haml
@@ -12,7 +12,7 @@
= semantic_form_for @article, :html => { :multipart => true } do |form|
= render :partial => 'article_form', :locals => { :form => form }
= form.buttons do
- = form.commit_button :class => 'float-right', :button_html => { :class => 'btn' }
+ = form.commit_button :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'btn' }
:javascript
(function($)
View
14 app/views/classifieds/edit.html.haml
@@ -78,8 +78,8 @@
= category_form.inputs do
= category_form.input :category, :as => :select, :collection => @classified.class.sorted_categories.map {|c| [c.name, c.id]}, :include_blank => false
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.save_changes'), :class => 'float-right', :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.save_changes'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
.panel2
= render :partial => 'shared/forms/images_simple', :locals => { :form => form, :item => @classified }
#scrollbox
@@ -88,11 +88,11 @@
.items
%a.next.browse.right_scroll
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.save_changes'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.save_changes'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel3
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => form, :item => @classified }
= form.buttons do
- = form.commit_button t('wizard.save_changes'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.save_changes'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
View
18 app/views/classifieds/new.html.haml
@@ -86,7 +86,7 @@
= form.input :details, :hint => t('.hint_classified_details')
= form.input :location_text, :label => 'Location', :hint => t('.hint_classified_location'), :required => false
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
.panel2
%h1.title= t('classifieds.new.item_setting')
%fieldset
@@ -114,9 +114,9 @@
.items
%a.next.browse.right_scroll
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel3
= render :partial => 'shared/forms/images_simple', :locals => { :form => form, :item => @classified }
#scrollbox
@@ -125,11 +125,11 @@
.items
%a.next.browse.right_scroll
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel4
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => form, :item => @classified }
= form.buttons do
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
View
2  app/views/galleries/add_gallery_item.html.haml
@@ -18,7 +18,7 @@
= form.input :title, :required => false
= form.input :caption, :input_html => { :rows => 5 }, :required => false
= form.buttons do
- = form.commit_button "Add to Gallery", :class => 'float-right', :button_html => { :class => "btn" }
+ = form.commit_button "Add to Gallery", :wrapper_html => { :class => 'float-right' }, :button_html => { :class => "btn" }
#right-col
= render :partial => 'shared/sidebar/newest_galleries'
View
2  app/views/galleries/edit.html.haml
@@ -21,7 +21,7 @@
= form.inputs do
= add_gallery_item_simple(form, true)
= form.buttons do
- = form.commit_button :class => 'float-right', :button_html => { :class => "btn" }
+ = form.commit_button :wrapper_html => { :class => 'float-right' }, :button_html => { :class => "btn" }
#right-col
= render :partial => 'shared/sidebar/newest_galleries'
View
2  app/views/galleries/new.html.haml
@@ -23,7 +23,7 @@
= image_form.input :image, :required => false, :as => :file, :label => false, :class => "browse-media-item"
= add_gallery_item_simple(form)
= form.buttons do
- = form.commit_button :class => 'float-right', :button_html => { :class => "btn" }
+ = form.commit_button :wrapper_html => { :class => 'float-right' }, :button_html => { :class => "btn" }
#right-col
= render :partial => 'shared/sidebar/newest_galleries'
View
14 app/views/ideas/new.html.haml
@@ -66,8 +66,8 @@
= form.input :idea_board, :label => t('.idea_board'), :required => true, :include_blank => false, :hint => t('.hint_idea_boards')
= form.input :tags_string, :label => t('tags'), :required => false, :hint => t('tags_hint')
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
.panel2
= render :partial => 'shared/forms/images_simple', :locals => { :form => form, :item => @idea }
#scrollbox
@@ -76,11 +76,11 @@
.items
%a.next.browse.right_scroll
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel3
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => form, :item => @idea }
= form.buttons do
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
View
2  app/views/prediction_groups/new.html.haml
@@ -40,4 +40,4 @@
= form.input :description, :hint => t('wizard.details'), :required => false
= form.input :tags_string, :label => t('tags'), :required => false, :hint => t('tags_hint')
= form.buttons do
- = form.commit_button t('wizard.submit'), :class => 'float-right', :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.submit'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
View
2  app/views/prediction_questions/new.html.haml
@@ -67,4 +67,4 @@
= form.input :end_range, :wrapper_html => { :class => 'question-values range hidden' }
= form.input :tags_string, :label => t('tags'), :required => false, :hint => t('tags_hint')
= form.buttons do
- = form.commit_button t('wizard.submit'), :class => 'float-right', :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.submit'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
View
2  app/views/prediction_results/new.html.haml
@@ -28,4 +28,4 @@
= form.input :url, :required => false, :hint => t('predictions.new.hint.url')
= form.input :details, :required => false, :input_html => { :rows => 5 }
= form.buttons do
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
View
2  app/views/questions/index.html.haml
@@ -18,7 +18,7 @@
= form.input :details, :required => false, :label => t('please_elaborate')
= form.input :tags_string, :label => t('tags'), :required => false, :hint => t('tags_hint')
= form.buttons do
- = form.commit_button :class => 'float-right', :button_html => { :class => "button-input create" }
+ = form.commit_button :wrapper_html => { :class => 'float-right' }, :button_html => { :class => "button-input create" }
= render_ad(:banner, @ad_layout, @ad_banner)
- cache "questions_list_#{@page}html" do
View
2  app/views/questions/new.html.haml
@@ -15,7 +15,7 @@
= form.input :details, :required => false, :label => t('please_elaborate')
= form.input :tags_string, :label => t('tags'), :required => false, :hint => t('tags_hint')
= form.buttons do
- = form.commit_button :class => 'float-right', :button_html => { :class => "button-input create" }
+ = form.commit_button :wrapper_html => { :class => 'float-right' }, :button_html => { :class => "button-input create" }
#right-col
= render :partial => 'shared/sidebar/newest_questions'
View
2  app/views/questions/show.html.haml
@@ -51,7 +51,7 @@
= form.inputs do
= form.input :answer, :label => false
= form.buttons do
- = form.commit_button :class => 'float-right', :button_html => { :class => "btn" }
+ = form.commit_button :wrapper_html => { :class => 'float-right' }, :button_html => { :class => "btn" }
- if @outbrain_item
= render :partial => 'shared/external/outbrain_wrapper'
View
20 app/views/resources/new.html.haml
@@ -66,8 +66,8 @@
= form.input :title, :label => t('.label_title'),:hint =>t('.hint_title')
= form.input :resource_section, :required => true, :include_blank => false,:label => t('.label_section'),:hint => t('.hint_section')
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
.panel2
= form.inputs do
= form.input :details, :input_html => { :rows => 5 },:required => false, :label => t('.label_details'),:hint =>t('.hint_details')
@@ -75,9 +75,9 @@
= form.input :mapUrl, :label => t('.label_map'), :hint =>t('.hint_map'),:required => false
= form.input :twitterName, :label => t('.label_twitter'), :hint=>t('.hint_twitter'), :required => false
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel3
= render :partial => 'shared/forms/images_simple', :locals => { :form => form, :item => @resource }
@@ -87,12 +87,12 @@
.items
%a.next.browse.right_scroll
= form.buttons do
- = form.commit_button t('wizard.continue'), :class => 'float-right', :button_html => { :class => 'button-input next' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input' }
- = form.commit_button t('wizard.back'), :class => 'float-left', :button_html => { :class => 'button-input prev' }
+ = form.commit_button t('wizard.continue'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'button-input prev' }
.panel4
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => form, :item => @resource }
= form.buttons do
- = form.commit_button t('wizard.post_now'), :class => 'float_right', :button_html => { :class => 'form-btn' }
- = form.commit_button t('wizard.back'), :class => 'float_left', :button_html => { :class => 'form-btn prev' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'form-btn' }
+ = form.commit_button t('wizard.back'), :wrapper_html => { :class => 'float-left' }, :button_html => { :class => 'form-btn prev' }
View
2  app/views/shared/_prediction_question.html.haml
@@ -16,6 +16,6 @@
- when 'text'
= form.input :guess
= form.buttons do
- = form.commit_button t('predictions.submit_guess'), :button_html => { :class => 'btn float_right' }
+ = form.commit_button t('predictions.submit_guess'), :button_html => { :class => 'btn float-right' }
%p.vote-meta
= link_to "Is this question out of date?", new_prediction_question_prediction_result_path(prediction_question)
View
10 app/views/shared/forms/_simple_story_post.html.haml
@@ -123,16 +123,16 @@
.simple-post
= semantic_form_for story, :url => stories_path, :html => { :multipart => true, :class => "post_story" } do |form|
.panel-bar
- %h2 Simple Posting Widget
+ %h2= t('generic.post.content')
%form.formtastic
%fieldset.form-desc
- %p Share a Story
+ %p= t('post_popup_detail')
#sharing_box
=form.inputs do
=form.input :url
.loader
=form.buttons do
- = form.commit_button 'Look up!', :class => "float-right", :button_html => {:class => 'parse_url_button button-input next create' }
+ = form.commit_button t('post_popup_lookup'), :wrapper_html => { :class => 'float-right' }, :button_html => {:class => 'parse_url_button button-input next create' }
#media{:style => "display:none"}
= form.inputs :class => "inputs titles" do
= form.input :title
@@ -159,5 +159,5 @@
%a.media-link.toggle-audio Add Audio
= render :partial => 'shared/forms/media_items_simple', :locals => { :form => form, :item => story }
= form.buttons do
- =form.commit_button 'Reset', :class => "float-left", :button_html => {:class => 'reset_form_button button-input prev create' }
- = form.commit_button t('wizard.post_now'), :class => 'float-right', :button_html => { :class => 'button-input next' }
+ =form.commit_button 'Reset', :wrapper_html => { :class => 'float-left' }, :button_html => {:class => 'reset_form_button button-input prev create' }
+ = form.commit_button t('wizard.post_now'), :wrapper_html => { :class => 'float-right' }, :button_html => { :class => 'button-input next' }
View
2  app/views/shared/sidebar/_who_liked.html.haml
@@ -1,7 +1,7 @@
-# @expects: local 'item'
- cache "#{item.cache_key}_who_liked", :expires_in => 60.minute do
-# user_list ||= item.voters_who_voted.uniq[0,40]
- - user_list ||= Vote.find(:all, :group => :voter_id, :conditions => ["voteable_type = ? AND voteable_id = ?", item.class.name, item.id], :order => "rand()", :limit => 40)
+ - user_list ||= Vote.