tb_media 1.2.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +2 -2
- data/Readme.markdown +3 -19
- data/app/assets/javascripts/admin/media/application.js +2 -2
- data/app/assets/javascripts/admin/media/picker.js +8 -5
- data/app/assets/javascripts/admin/media/plugin.js.erb +86 -81
- data/app/assets/stylesheets/admin/media/application.css.scss +1 -12
- data/app/controllers/admin/media_controller.rb +54 -61
- data/app/controllers/admin/media_picker_controller.rb +8 -16
- data/app/models/spud_media.rb +63 -110
- data/app/views/admin/media/index.html.erb +4 -12
- data/app/views/admin/media/new.html.erb +0 -1
- data/app/views/admin/media_picker/_media.html.erb +2 -7
- data/app/views/admin/media_picker/index.html.erb +1 -2
- data/config/locales/en.yml +0 -1
- data/config/routes.rb +5 -8
- data/db/migrate/20120101194256_create_spud_media.rb +2 -2
- data/db/migrate/20120501203325_add_protected_to_spud_media.rb +1 -2
- data/db/migrate/20120508132153_add_cropping_to_spud_media.rb +1 -1
- data/lib/spud_media/configuration.rb +3 -4
- data/lib/spud_media/content_types.rb +2 -2
- data/lib/spud_media/engine.rb +21 -13
- data/lib/spud_media/version.rb +3 -3
- data/lib/tasks/spud_media_tasks.rake +4 -6
- data/spec/controllers/admin/media_controller_spec.rb +23 -24
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/application.rb +2 -3
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/config/environments/development.rb +0 -7
- data/spec/dummy/config/environments/test.rb +3 -5
- data/spec/dummy/config/routes.rb +2 -2
- data/spec/dummy/db/migrate/20130904141442_create_spud_users.tb_core.rb +12 -12
- data/spec/dummy/db/migrate/20130904141443_add_time_zone_to_spud_user.tb_core.rb +0 -1
- data/spec/dummy/db/migrate/20130904141444_add_scope_to_spud_admin_permissions.tb_core.rb +0 -1
- data/spec/dummy/db/migrate/20130904141446_create_spud_media.tb_media.rb +1 -1
- data/spec/dummy/db/migrate/20130904141447_add_protected_to_spud_media.tb_media.rb +1 -1
- data/spec/dummy/db/migrate/20130904141448_add_cropping_to_spud_media.tb_media.rb +3 -3
- data/spec/dummy/db/migrate/20151012194531_create_spud_permissions.tb_core.rb +3 -3
- data/spec/dummy/db/migrate/20151012194532_create_spud_role_permissions.tb_core.rb +2 -2
- data/spec/dummy/db/migrate/20151012194534_add_requires_password_change_to_spud_users.tb_core.rb +1 -1
- data/spec/dummy/db/schema.rb +63 -67
- data/spec/dummy/public/system/spud_media/1/cropped/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/1/small/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/2/cropped/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/2/small/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/3/cropped/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/3/small/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/4/cropped/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/4/small/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/5/cropped/test_img1.png +0 -0
- data/spec/dummy/public/system/spud_media/5/small/test_img1.png +0 -0
- data/spec/dummy/script/rails +2 -2
- data/spec/javascripts/support/jasmine_helper.rb +6 -7
- data/spec/models/spud_media_spec.rb +2 -2
- data/spec/rails_helper.rb +14 -7
- data/spec/spec_helper.rb +42 -44
- metadata +103 -104
- data/app/controllers/protected_media_controller.rb +0 -24
- data/app/helpers/protected_media_helper.rb +0 -3
- data/spec/dummy/public/system/spud_media/1/cropped/test_img1.jpg +0 -0
- data/spec/dummy/public/system/spud_media/2/cropped/test_img1.jpg +0 -0
- data/spec/dummy/public/system/spud_media/3/cropped/test_img1.jpg +0 -0
- data/spec/dummy/public/system/spud_media/4/cropped/test_img1.jpg +0 -0
- data/spec/dummy/public/system/spud_media/5/cropped/test_img1.jpg +0 -0
- data/spec/support/authlogic_helper.rb +0 -2
@@ -1,24 +0,0 @@
|
|
1
|
-
class ProtectedMediaController < Spud::ApplicationController
|
2
|
-
|
3
|
-
before_filter :require_user
|
4
|
-
|
5
|
-
def show
|
6
|
-
@media = SpudMedia.where(:id => params[:id]).first
|
7
|
-
if @media.blank?
|
8
|
-
raise Spud::NotFoundError.new(:item => 'media')
|
9
|
-
else
|
10
|
-
if Spud::Media.config.paperclip_storage == :s3
|
11
|
-
secure_url = @media.attachment.s3_object(params[:style]).url_for(:read, :secure => true, :expires => 10.minutes)
|
12
|
-
redirect_to(secure_url.to_s)
|
13
|
-
else
|
14
|
-
filepath = @media.attachment.path(params[:style])
|
15
|
-
if !File.exists?(filepath)
|
16
|
-
raise Spud::NotFoundError.new(:item => 'media')
|
17
|
-
else
|
18
|
-
send_file(filepath, :disposition => 'inline')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|