diff --git a/Gemfile b/Gemfile index 831a443..c40b464 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,8 @@ group :assets do gem 'coffee-rails', "~> 4.0.0" gem 'uglifier' + gem 'sprockets_better_errors' + gem 'bourbon' end @@ -75,6 +77,8 @@ gem 'squeel' gem 'will_paginate' gem 'redcarpet' gem 'paperclip' +gem 'dragonfly' +gem 'dragonfly-s3_data_store' gem 'haml' gem 'slugtastic' diff --git a/Gemfile.lock b/Gemfile.lock index 250f54d..fb36916 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,8 +88,15 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.2.5) + dragonfly (1.0.3) + multi_json (~> 1.0) + rack + dragonfly-s3_data_store (1.0.3) + dragonfly (~> 1.0) + fog erubis (2.7.0) eventmachine (1.0.3) + excon (0.31.0) execjs (2.0.2) factory_girl (4.4.0) activesupport (>= 3.0.0) @@ -97,6 +104,16 @@ GEM factory_girl (~> 4.4.0) railties (>= 3.0.0) fivemat (1.2.1) + fog (1.20.0) + builder + 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.11) + formatador (0.2.4) haml (4.0.5) tilt hike (1.2.3) @@ -118,6 +135,9 @@ GEM mini_portile (0.5.2) minitest (4.7.5) multi_json (1.9.0) + net-scp (1.1.2) + net-ssh (>= 2.6.5) + net-ssh (2.8.0) newrelic_rpm (3.7.2.195) nokogiri (1.6.1) mini_portile (~> 0.5.0) @@ -196,6 +216,8 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) + sprockets_better_errors (0.0.4) + sprockets-rails (>= 1.0.0) sqlite3 (1.3.9) squeel (1.1.1) activerecord (>= 3.0) @@ -235,6 +257,8 @@ DEPENDENCIES capybara-screenshot coffee-rails (~> 4.0.0) devise + dragonfly + dragonfly-s3_data_store exception_notification! factory_girl_rails fivemat @@ -256,6 +280,7 @@ DEPENDENCIES shoulda-matchers simple_form slugtastic + sprockets_better_errors sqlite3 squeel thin diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index 868ab09..f4cdbee 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -1,5 +1,5 @@ module PhotosHelper def link_to_photo(photo) - link_to '', photo.photo.url, rel: 'photos', class: 'fancy', id: photo.id + link_to '', photo.image.url, rel: 'photos', class: 'fancy', id: photo.id end end diff --git a/app/models/photo.rb b/app/models/photo.rb index 54a9481..a422998 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -22,6 +22,8 @@ class Photo < ActiveRecord::Base bucket: ENV['AWS_BUCKET_NAME'], url: ':s3_domain_url' + dragonfly_accessor :image + @@per_page = 11 scope :enabled, lambda { diff --git a/app/views/admin/photos/_photo.html.haml b/app/views/admin/photos/_photo.html.haml index 76087c1..2f9e70f 100644 --- a/app/views/admin/photos/_photo.html.haml +++ b/app/views/admin/photos/_photo.html.haml @@ -1,5 +1,5 @@ .photo - = link_to image_tag(photo.photo.url(:size5), :title => photo.title), photo.photo.url + = link_to image_tag(photo.image.admin.url, :title => photo.title), photo.image.url .actions = link_to 'Edit', edit_admin_photo_path(photo) = link_to 'Destroy', [:admin, photo], confirm: 'Are you sure?', method: :delete diff --git a/app/views/admin/photos/index.html.haml b/app/views/admin/photos/index.html.haml index bab4e1f..746a366 100644 --- a/app/views/admin/photos/index.html.haml +++ b/app/views/admin/photos/index.html.haml @@ -6,6 +6,6 @@ = render :partial => "photo", :collection => @photos = will_paginate @products, :remote => true - + %br/ = link_to 'New Photo', new_admin_photo_path, :class => [:button, :new] diff --git a/app/views/shared/_photo_styles.html.erb b/app/views/shared/_photo_styles.html.erb index ecfdd9b..59f6b84 100644 --- a/app/views/shared/_photo_styles.html.erb +++ b/app/views/shared/_photo_styles.html.erb @@ -1,7 +1,7 @@