diff --git a/Gemfile b/Gemfile index e2ca8c3d..eb9cc861 100644 --- a/Gemfile +++ b/Gemfile @@ -9,9 +9,9 @@ def linux_only(require_as) RbConfig::CONFIG['host_os'] =~ /linux/ && require_as end -ruby "2.0.0" +ruby '2.0.0' -gem 'rails', '4.0.2' +gem 'rails', '4.0.3' gem 'sinatra', '>= 1.3.0', require: nil # deployment @@ -36,10 +36,6 @@ gem 'pg' # search gem 'pg_search' gem 'pg_array_parser' -gem 'sunspot_rails' -gem 'sunspot_solr' -gem 'sunspot-queue', github: 'robotmay/sunspot-queue' -gem 'sunspot_with_kaminari' # redis gem 'redis-objects' @@ -65,9 +61,9 @@ gem 'keen' gem 'coveralls', require: false # auth -gem 'devise', '3.0.0.rc' -gem 'devise_invitable', git: 'git://github.com/robotmay/devise_invitable.git', branch: 'rails4' -gem 'devise-async' +gem 'devise', '~> 3.0.0' +gem 'devise_invitable', '~> 1.2.1' +gem 'devise-async', '~> 0.8.0' gem 'cancan' # omniauth @@ -75,20 +71,20 @@ gem 'omniauth-google-oauth2', github: 'murryivanoff/omniauth-google-oauth2' # images gem 'fog' -gem 'dragonfly' +gem 'dragonfly', '~> 0.9.15' gem 'mini_exiftool_vendored' gem 's3_direct_upload' # views gem 'slim', '>= 1.3.0' -gem 'simple_form', '~> 3.0.0.beta1' +gem 'simple_form', '~> 3.0.1' gem 'link_to_active_state' gem 'kaminari' gem 'redcarpet' # models gem 'friendly_id', '5.0.0.rc1' -gem 'closure_tree', github: 'mceachen/closure_tree', branch: 'wip_rails4' +gem 'closure_tree' # assets group :assets do diff --git a/Gemfile.lock b/Gemfile.lock index 0723d36b..515c9615 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,3 @@ -GIT - remote: git://github.com/mceachen/closure_tree.git - revision: a1613cc4741150efa1f24a5c8839d63671263e73 - branch: wip_rails4 - specs: - closure_tree (4.1.0.wip) - activerecord (>= 3.0.0) - with_advisory_lock (>= 0.0.6) - GIT remote: git://github.com/murryivanoff/omniauth-google-oauth2.git revision: 84acd204bf235fae848a57a822a97596bb545afa @@ -15,33 +6,17 @@ GIT omniauth (~> 1.0) omniauth-oauth2 -GIT - remote: git://github.com/robotmay/devise_invitable.git - revision: fa90d318d839b7452c596bf3b2ba098db7dcd075 - branch: rails4 - specs: - devise_invitable (1.1.7) - actionmailer (>= 4.0.0.beta) - railties (>= 4.0.0.beta) - GIT remote: git://github.com/robotmay/multi_fetch_fragments.git revision: 284227cf2e34a95996576faf929328b8c44f3dca specs: multi_fetch_fragments (0.0.16) -GIT - remote: git://github.com/robotmay/sunspot-queue.git - revision: 32e922edb103a867507e7935065d90ebec2278de - specs: - sunspot-queue (0.10.0) - sunspot_rails (>= 1.3.0) - GIT remote: git://github.com/sporkrb/spork-rails.git - revision: 3224f84d8c31fcb0894e9a43f6c3ac67e3aa0d71 + revision: 0dd45e59d3237b4c8f9efc215b46d9c07072a95e specs: - spork-rails (3.2.1) + spork-rails (4.0.0) rails (>= 3.0.0, < 5) spork (>= 1.0rc0) @@ -49,50 +24,47 @@ GEM remote: https://code.stripe.com/ remote: https://rubygems.org/ specs: - actionmailer (4.0.2) - actionpack (= 4.0.2) + actionmailer (4.0.3) + actionpack (= 4.0.3) mail (~> 2.5.4) - actionpack (4.0.2) - activesupport (= 4.0.2) + actionpack (4.0.3) + activesupport (= 4.0.3) builder (~> 3.1.0) erubis (~> 2.7.0) rack (~> 1.5.2) rack-test (~> 0.6.2) - activemodel (4.0.2) - activesupport (= 4.0.2) + activemodel (4.0.3) + activesupport (= 4.0.3) builder (~> 3.1.0) - activerecord (4.0.2) - activemodel (= 4.0.2) + activerecord (4.0.3) + activemodel (= 4.0.3) activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.2) + activesupport (= 4.0.3) arel (~> 4.0.0) activerecord-deprecated_finders (1.0.3) - activesupport (4.0.2) + activesupport (4.0.3) i18n (~> 0.6, >= 0.6.4) minitest (~> 4.2) multi_json (~> 1.3) thread_safe (~> 0.1) tzinfo (~> 0.3.37) addressable (2.3.5) - airbrake (3.1.12) - activesupport + airbrake (3.1.15) builder - json - arel (4.0.1) - atomic (1.1.14) - bcrypt-ruby (3.1.0) - bourne (1.4.0) - mocha (~> 0.13.2) + multi_json + arel (4.0.2) + atomic (1.1.15) + bcrypt (3.1.7) + bcrypt-ruby (3.1.5) + bcrypt (>= 3.1.3) builder (3.1.4) - cancan (1.6.9) - capistrano (2.15.4) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) - capistrano-foreman (0.0.3) - capybara (2.1.0) + cancan (1.6.10) + capistrano (3.1.0) + i18n + rake (>= 10.0.0) + sshkit (~> 1.3) + capistrano-foreman (1.0.0) + capybara (2.2.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -100,68 +72,76 @@ GEM xpath (~> 2.0) celluloid (0.15.2) timers (~> 1.1.0) - childprocess (0.3.9) + celluloid-io (0.15.0) + celluloid (>= 0.15.0) + nio4r (>= 0.5.0) + childprocess (0.5.1) ffi (~> 1.0, >= 1.0.11) - chronic (0.9.1) - coderay (1.0.9) + chronic (0.10.2) + closure_tree (4.4.0) + activerecord (>= 3.0.0) + with_advisory_lock (>= 0.0.9) + coderay (1.1.0) coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.6.3) - colorize (0.5.8) - connection_pool (1.1.0) - cookiejar (0.3.0) - coveralls (0.6.7) - colorize + coffee-script-source (1.7.0) + connection_pool (1.2.0) + cookiejar (0.3.1) + coveralls (0.7.0) multi_json (~> 1.3) rest-client simplecov (>= 0.7) + term-ansicolor thor - dalli (2.6.4) - database_cleaner (1.0.1) - devise (3.0.0.rc) + dalli (2.7.0) + database_cleaner (1.2.0) + devise (3.0.4) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) - warden (~> 1.2.1) - devise-async (0.7.0) - devise (>= 2.2) - diff-lcs (1.2.4) - dotenv (0.8.0) - dotenv-rails (0.8.0) - dotenv (= 0.8.0) - dragonfly (0.9.14) + warden (~> 1.2.3) + devise-async (0.8.0) + devise (>= 2.2, < 3.2) + devise_invitable (1.2.1) + actionmailer (>= 3.2.6, < 5) + devise (~> 3.0.0) + diff-lcs (1.2.5) + docile (1.1.3) + dotenv (0.10.0) + dotenv-rails (0.10.0) + dotenv (= 0.10.0) + dragonfly (0.9.15) multi_json (~> 1.0) rack - em-http-request (1.1.0) + em-http-request (1.1.2) addressable (>= 2.3.4) cookiejar em-socksify (>= 0.3) eventmachine (>= 1.0.3) - http_parser.rb (>= 0.6.0.beta.2) + http_parser.rb (>= 0.6.0) em-socksify (0.3.0) eventmachine (>= 1.0.0.beta.4) erubis (2.7.0) eventmachine (1.0.3) - excon (0.20.1) + excon (0.31.0) execjs (2.0.2) - faraday (0.8.7) - multipart-post (~> 1.1) - ffaker (1.16.0) - ffi (1.9.0) - fog (1.10.1) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + ffaker (1.23.0) + ffi (1.9.3) + fog (1.20.0) builder - excon (~> 0.20) + excon (~> 0.31.0) formatador (~> 0.2.0) mime-types multi_json (~> 1.0) net-scp (~> 1.1) net-ssh (>= 2.1.3) - nokogiri (~> 1.5.0) - ruby-hmac + nokogiri (>= 1.5.11) foreman (0.63.0) dotenv (>= 0.7) thor (>= 0.13.6) @@ -169,15 +149,16 @@ GEM friendly_id (5.0.0.rc1) activerecord (~> 4.0.0) gabba (1.0.1) - guard (1.7.0) + gene_pool (1.3.2) + guard (2.5.1) formatador (>= 0.2.4) - listen (>= 0.6.0) - lumberjack (>= 1.0.2) - pry (>= 0.9.10) - thor (>= 0.14.6) - guard-rspec (2.5.4) - guard (>= 1.1) - rspec (~> 2.11) + listen (~> 2.6) + lumberjack (~> 1.0) + pry (>= 0.9.12) + thor (>= 0.18.1) + guard-rspec (4.2.7) + guard (~> 2.1) + rspec (>= 2.14, < 4.0) guard-sidekiq (0.0.11) guard (>= 1.1) sidekiq @@ -186,13 +167,11 @@ GEM guard (>= 1.1) spork (>= 0.8.4) hashie (2.0.5) - highline (1.6.19) hike (1.2.3) - http_parser.rb (0.6.0.beta.2) - httparty (0.11.0) - multi_json (~> 1.0) + http_parser.rb (0.6.0) + httparty (0.13.0) + json (~> 1.8) multi_xml (>= 0.5.2) - httpauth (0.2.0) i18n (0.6.9) i18n-js (3.0.0.rc5) i18n @@ -201,98 +180,101 @@ GEM jquery-fileupload-rails (0.4.1) actionpack (>= 3.1) railties (>= 3.1) - jquery-rails (2.2.1) + jquery-rails (3.1.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - jquery-turbolinks (1.0.0) + jquery-turbolinks (2.0.2) railties (>= 3.1.0) turbolinks json (1.8.1) - jwt (0.1.8) + jwt (0.1.11) multi_json (>= 1.5) - kaminari (0.14.1) + kaminari (0.15.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - keen (0.7.5) + keen (0.8.0) + addressable (~> 2.3.5) multi_json (~> 1.0) - kgio (2.8.0) - launchy (2.3.0) + kgio (2.9.2) + launchy (2.4.2) addressable (~> 2.3) - letter_opener (1.1.1) + letter_opener (1.2.0) launchy (~> 2.2) link_to_active_state (1.0.7) - listen (0.7.3) + listen (2.6.1) + celluloid (>= 0.15.2) + celluloid-io (>= 0.15.0) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) lumberjack (1.0.4) - macaddr (1.6.1) - systemu (~> 2.5.0) machinist (2.0) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - metaclass (0.0.1) - method_source (0.8.1) + method_source (0.8.2) mime-types (1.25.1) - mini_exiftool (2.3.0) - mini_exiftool_vendored (8.9.7.v2) + mini_exiftool (2.4.1) + mini_exiftool_vendored (9.2.7.v1) mini_exiftool (>= 1.6.0) + mini_portile (0.5.2) minitest (4.7.5) - mocha (0.13.3) - metaclass (~> 0.0.1) - multi_json (1.8.2) - multi_xml (0.5.3) - multipart-post (1.2.0) - net-scp (1.1.0) - net-ssh (>= 2.6.5) - net-sftp (2.1.2) + multi_json (1.8.4) + multi_xml (0.5.5) + multipart-post (2.0.0) + net-scp (1.1.2) net-ssh (>= 2.6.5) - net-ssh (2.6.7) - net-ssh-gateway (1.2.0) - net-ssh (>= 2.6.5) - newrelic_rpm (3.6.1.88) - nokogiri (1.5.9) - oauth2 (0.8.1) - faraday (~> 0.8) - httpauth (~> 0.1) - jwt (~> 0.1.4) - multi_json (~> 1.0) + net-ssh (2.8.0) + newrelic_rpm (3.7.2.195) + nio4r (1.0.0) + nokogiri (1.6.1) + mini_portile (~> 0.5.0) + oauth2 (0.9.3) + faraday (>= 0.8, < 0.10) + jwt (~> 0.1.8) + multi_json (~> 1.3) + multi_xml (~> 0.5) rack (~> 1.2) - oj (2.1.4) - omniauth (1.1.4) + oj (2.5.5) + omniauth (1.2.1) hashie (>= 1.2, < 3) - rack - omniauth-oauth2 (1.1.1) - oauth2 (~> 0.8.0) - omniauth (~> 1.0) - orm_adapter (0.4.0) - pg (0.15.1) - pg_array_parser (0.0.8) - pg_search (0.7.0) + rack (~> 1.0) + omniauth-oauth2 (1.1.2) + faraday (>= 0.8, < 0.10) + multi_json (~> 1.3) + oauth2 (~> 0.9.3) + omniauth (~> 1.2) + orm_adapter (0.5.0) + persistent_http (1.0.6) + gene_pool (>= 1.3) + persistent_httparty (0.1.1) + httparty (~> 0.9) + persistent_http + pg (0.17.1) + pg_array_parser (0.0.9) + pg_search (0.7.3) activerecord (>= 3.1) activesupport (>= 3.1) arel - polyglot (0.3.3) - postmark (0.9.19) + polyglot (0.3.4) + postmark (1.1.0) json rake - postmark-rails (0.4.1) - actionmailer - postmark (>= 0.9.0) - rake - pr_geohash (1.0.0) + postmark-rails (0.6.0) + actionmailer (>= 3.0.0) + postmark (~> 1.1.0) proxies (0.2.1) - pry (0.9.12.2) - coderay (~> 1.0.5) + pry (0.9.12.6) + coderay (~> 1.0) method_source (~> 0.8) slop (~> 3.4) - pry-rails (0.2.2) + pry-rails (0.3.2) pry (>= 0.9.10) - pubnub (3.3.0.7) - activesupport + pubnub (3.4.1) em-http-request eventmachine + httparty json - uuid (~> 2.3.5) - yajl-ruby + persistent_httparty puma (2.6.0) rack (>= 1.1, < 2.0) quiet_assets (1.0.2) @@ -300,96 +282,94 @@ GEM rack (1.5.2) rack-cache (1.2) rack (>= 0.4) - rack-protection (1.5.0) + rack-protection (1.5.2) rack rack-test (0.6.2) rack (>= 1.0) - rails (4.0.2) - actionmailer (= 4.0.2) - actionpack (= 4.0.2) - activerecord (= 4.0.2) - activesupport (= 4.0.2) + rails (4.0.3) + actionmailer (= 4.0.3) + actionpack (= 4.0.3) + activerecord (= 4.0.3) + activesupport (= 4.0.3) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.2) + railties (= 4.0.3) sprockets-rails (~> 2.0.0) - railties (4.0.2) - actionpack (= 4.0.2) - activesupport (= 4.0.2) + railties (4.0.3) + actionpack (= 4.0.3) + activesupport (= 4.0.3) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.1.1) - rb-fsevent (0.9.3) - rb-inotify (0.9.0) + rb-fsevent (0.9.4) + rb-inotify (0.9.3) ffi (>= 0.5.0) - redcarpet (2.2.2) - redis (3.0.6) - redis-namespace (1.3.2) + redcarpet (3.1.1) + redis (3.0.7) + redis-namespace (1.4.1) redis (~> 3.0.4) - redis-objects (0.7.0) + redis-objects (0.9.0) redis (>= 3.0.2) rest-client (1.6.7) mime-types (>= 1.16) - rsolr (1.0.9) - builder (>= 2.1.2) - rspec (2.13.0) - rspec-core (~> 2.13.0) - rspec-expectations (~> 2.13.0) - rspec-mocks (~> 2.13.0) - rspec-core (2.13.1) - rspec-expectations (2.13.0) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.7) + rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.1) - rspec-rails (2.13.1) + rspec-mocks (2.14.6) + rspec-rails (2.14.1) actionpack (>= 3.0) + activemodel (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 2.13.0) - rspec-expectations (~> 2.13.0) - rspec-mocks (~> 2.13.0) - ruby-hmac (0.4.0) - s3 (0.3.11) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + s3 (0.3.21) proxies (~> 0.2.0) s3_direct_upload (0.1.6) coffee-rails (>= 3.2.1) jquery-fileupload-rails (~> 0.4.1) rails (>= 3.2) sass-rails (>= 3.2.5) - sass (3.2.12) + sass (3.2.14) sass-rails (4.0.1) railties (>= 4.0.0, < 5.0) sass (>= 3.1.10) sprockets-rails (~> 2.0.0) - shoulda (3.4.0) + shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) - shoulda-matchers (~> 1.0, >= 1.4.1) - shoulda-context (1.1.1) - shoulda-matchers (1.5.6) + shoulda-matchers (>= 1.4.1, < 3.0) + shoulda-context (1.1.6) + shoulda-matchers (2.5.0) activesupport (>= 3.0.0) - bourne (~> 1.3) sidekiq (2.15.2) celluloid (>= 0.15.2) connection_pool (>= 1.0.0) json redis (>= 3.0.4) redis-namespace (>= 1.3.1) - sidekiq-limit_fetch (2.1.2) + sidekiq-limit_fetch (2.1.3) sidekiq (>= 2.6.5, < 3) - simple_form (3.0.0.beta1) - actionpack (>= 4.0.0.beta, < 4.1) - activemodel (>= 4.0.0.beta, < 4.1) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) - sinatra (1.4.2) - rack (~> 1.5, >= 1.5.2) + simple_form (3.0.1) + actionpack (>= 4.0.0, < 4.1) + activemodel (>= 4.0.0, < 4.1) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + sinatra (1.4.4) + rack (~> 1.4) rack-protection (~> 1.4) tilt (~> 1.3, >= 1.3.4) - slim (1.3.8) - temple (~> 0.6.3) - tilt (~> 1.3.3) - slop (3.4.5) - spork (1.0.0rc3) + slim (2.0.2) + temple (~> 0.6.6) + tilt (>= 1.3.3, < 2.1) + slop (3.4.7) + spork (1.0.0rc4) sprockets (2.10.1) hike (~> 1.2) multi_json (~> 1.0) @@ -399,50 +379,43 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) - stripe (1.8.3) - multi_json (>= 1.0.4, < 2) + sshkit (1.3.0) + net-scp (>= 1.1.2) + net-ssh + term-ansicolor + stripe (1.10.1) + json (~> 1.8.1) + mime-types (~> 1.25) rest-client (~> 1.4) - sunspot (2.0.0) - pr_geohash (~> 1.0) - rsolr (~> 1.0.7) - sunspot_rails (2.0.0) - nokogiri - sunspot (= 2.0.0) - sunspot_solr (2.0.0) - sunspot_with_kaminari (0.2.0) - kaminari (>= 0.14.0) - sunspot - sunspot_rails - systemu (2.5.2) - temple (0.6.4) + temple (0.6.7) + term-ansicolor (1.3.0) + tins (~> 1.0) thor (0.18.1) - thread (0.0.8.1) - thread_safe (0.1.3) - atomic - tilt (1.3.7) - timecop (0.6.3) + thread (0.1.3) + thread_safe (0.2.0) + atomic (>= 1.1.7, < 2) + tilt (1.4.1) + timecop (0.7.1) timers (1.1.0) + tins (1.0.0) treetop (1.4.15) polyglot polyglot (>= 0.3.1) - turbolinks (1.1.1) + turbolinks (2.2.1) coffee-rails tzinfo (0.3.38) - uglifier (2.0.1) + uglifier (2.4.0) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - uuid (2.3.7) - macaddr (~> 1.0) - warden (1.2.1) + json (>= 1.8.0) + warden (1.2.3) rack (>= 1.0) - whenever (0.8.2) + whenever (0.9.0) activesupport (>= 2.3.4) chronic (>= 0.6.3) - with_advisory_lock (0.0.6) + with_advisory_lock (1.0.0) activerecord (>= 3.0.0) xpath (2.0.0) nokogiri (~> 1.3) - yajl-ruby (1.1.0) zurb-foundation (4.1.6) sass (>= 3.2.0) @@ -455,16 +428,16 @@ DEPENDENCIES capistrano capistrano-foreman capybara - closure_tree! + closure_tree coffee-rails (~> 4.0.0.beta1) coveralls dalli database_cleaner - devise (= 3.0.0.rc) - devise-async - devise_invitable! + devise (~> 3.0.0) + devise-async (~> 0.8.0) + devise_invitable (~> 1.2.1) dotenv-rails - dragonfly + dragonfly (~> 0.9.15) ffaker fog foreman @@ -501,7 +474,7 @@ DEPENDENCIES puma (= 2.6.0) quiet_assets rack-cache - rails (= 4.0.2) + rails (= 4.0.3) rb-fsevent rb-inotify (~> 0.9) redcarpet @@ -513,15 +486,11 @@ DEPENDENCIES shoulda sidekiq (= 2.15.2) sidekiq-limit_fetch - simple_form (~> 3.0.0.beta1) + simple_form (~> 3.0.1) sinatra (>= 1.3.0) slim (>= 1.3.0) spork-rails! stripe - sunspot-queue! - sunspot_rails - sunspot_solr - sunspot_with_kaminari thread timecop turbolinks diff --git a/app/assets/stylesheets/base.css.sass b/app/assets/stylesheets/base.css.sass index cd36607d..3a9ed3f4 100644 --- a/app/assets/stylesheets/base.css.sass +++ b/app/assets/stylesheets/base.css.sass @@ -39,3 +39,8 @@ form .hidden display: none + +#closing-modal + p + color: #000 + font-size: 0.9em diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 79023c62..53776e52 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -62,6 +62,8 @@ def enable_sharing_mode def set_locale I18n.locale = params[:locale] || (user_signed_in? ? current_user.locale : I18n.default_locale) + rescue I18n::InvalidLocale => ex + redirect_to url_for(locale: I18n.default_locale), alert: ex.message end def fetch_categories diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 59504733..54dcb36f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -21,6 +21,9 @@ def once(key, &block) current_user.seen[key] = true block.call end + elsif session[key].nil? + session[key] = true + block.call end end diff --git a/app/models/photograph.rb b/app/models/photograph.rb index 1c28c88b..a13c3598 100644 --- a/app/models/photograph.rb +++ b/app/models/photograph.rb @@ -106,36 +106,6 @@ class Photograph < ActiveRecord::Base scope :for_month, -> (date_range) { where(created_at: date_range) } - - searchable do - text :title do |photo| - photo.metadata.title - end - - text :description do |photo| - photo.metadata.description - end - - string :keywords, multiple: true do |photo| - photo.metadata.keywords - end - - text :creator_name do |photo| - photo.user.name - end - - integer :user_id, references: User - integer :license_id, references: License - integer :category_id, references: Category - integer :collection_ids, references: Collection, multiple: true do |photo| - photo.collections.pluck(:id) - end - float :score - time :created_at - boolean :public, using: :public? - boolean :safe_for_work - boolean :ghost - end def favourites_count super || 0 diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index e57e76f9..f801809a 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -75,6 +75,7 @@ head li= link_to t("social.github"), "https://github.com/afternoonrobot/photographer-io" li= link_to t("social.google_plus"), "https://plus.google.com/100673063979311454242" li= link_to t("social.twitter"), "https://twitter.com/photographer_io" + li= link_to t("closing.link"), "#", "data-reveal-id" => "closing-modal" ul class="inline-list" - t("locales").each do |key, name| @@ -89,5 +90,20 @@ head = render partial: "shared/pubnub" = javascript_include_tag "application" == yield(:javascript) + + div id="closing-modal" class="reveal-modal expand" + header + a class="close-reveal-modal" + | × + h3= t("closing.title") + + section class="content" + = md t("closing.content") + + - once :closing_modal do + javascript: + $(document).ready(function() { + $("#closing-modal").foundation('reveal', 'open'); + }); diff --git a/app/views/shared/_anon_nav.html.slim b/app/views/shared/_anon_nav.html.slim index 93665c65..72542015 100644 --- a/app/views/shared/_anon_nav.html.slim +++ b/app/views/shared/_anon_nav.html.slim @@ -30,18 +30,6 @@ nav id="layout-nav" class="top-bar" = link_to t("nav.seeking_feedback"), seeking_feedback_photographs_path, active_on: true, active_wrapper: :li - div class="row" - div class="large-12 columns" - label= t("nav.search") - = form_tag search_photographs_path, method: :get do - div class="row collapse" - div class="small-8 columns" - = text_field_tag :q, params[:q] - - div class="small-4 columns" - = submit_tag t("nav.search"), class: "button secondary" - .clear - div class="row" div class="large-12 columns" label= t("nav.categories") diff --git a/app/views/shared/_nav.html.slim b/app/views/shared/_nav.html.slim index 09a1436e..b465b67e 100644 --- a/app/views/shared/_nav.html.slim +++ b/app/views/shared/_nav.html.slim @@ -30,18 +30,6 @@ nav id="layout-nav" class="top-bar" = link_to t("nav.seeking_feedback"), seeking_feedback_photographs_path, active_on: true, active_wrapper: :li - div class="row" - div class="large-12 columns" - label= t("nav.search") - = form_tag search_photographs_path, method: :get do - div class="row collapse" - div class="small-8 columns" - = text_field_tag :q, params[:q] - - div class="small-4 columns" - = submit_tag t("nav.search"), class: "button secondary" - .clear - div class="row" div class="large-12 columns" label= t("nav.categories") diff --git a/config/application.rb b/config/application.rb index 2cf471be..bf0412dc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -45,6 +45,7 @@ class Application < Rails::Application config.assets.precompile += %w( custom.modernizr.js ) config.i18n.fallbacks = [:en] config.middleware.use I18n::JS::Middleware + config.i18n.enforce_available_locales = true if Puma.respond_to?(:cli_config) ::Iso.set_db_connection_pool_size! Puma.cli_config.options.fetch(:max_threads) diff --git a/config/initializers/sunspot.rb b/config/initializers/sunspot.rb deleted file mode 100644 index 916f01c9..00000000 --- a/config/initializers/sunspot.rb +++ /dev/null @@ -1,3 +0,0 @@ -require "sunspot/queue/sidekiq" -backend = Sunspot::Queue::Sidekiq::Backend.new -Sunspot.session = Sunspot::Queue::SessionProxy.new(Sunspot.session, backend) diff --git a/config/locales/en.yml b/config/locales/en.yml index e1925cdd..1224ba90 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -659,3 +659,39 @@ en: stories: notification: "%{text}" + + closing: + link: "Photographer.io is shutting down" + title: "Photographer.io is shutting down on the 30th of April 2014" + content: > + It is with great regret that I must announce that Photographer.io is + closing down on the 30th of April 2014. Unfortunately I no longer + have the time or finances to maintain the site, which may have become + apparent by the lack of improvements over the past 6 months. This is + mostly due to a shift in my plans for the future and what I want to do + with my spare time. + + + There was a time when I spent every evening working on the site, and it + has taken me a long time to decide on what to do with it. I have tried + to get back into the swing of developing it, but alas I haven't been able + to do so. Over the past few months it has proven increasingly difficult + to justify the cost of running the site, as I have other interests for + which I need the money and I have been reluctant to run the site as a business. + + + On account of data privacy and photo ownership, I will not be handing + control of the site over to anyone else and all data will be deleted + shortly after the shutdown date. However I will continue to keep the + repository on GitHub and accept pull-requests and other bugfixes, as + I know that the software is used elsewhere and I will try to support + those of you using it. + + + Thank you to everyone who has used this site and uploaded so many + wonderful photographs. I'm truly sorry for having to shut the site + down, and I wish I had been able to do more for all of you. + + + Best wishes,
+ Robert May diff --git a/config/routes.rb b/config/routes.rb index 1c6e39de..54785238 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,7 +12,7 @@ collection do get :explore get :recommended - get :search + get :search, to: redirect("/%{locale}/photographs") get :random get :favourites get :following