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.
Files changed (65) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +2 -2
  3. data/Readme.markdown +3 -19
  4. data/app/assets/javascripts/admin/media/application.js +2 -2
  5. data/app/assets/javascripts/admin/media/picker.js +8 -5
  6. data/app/assets/javascripts/admin/media/plugin.js.erb +86 -81
  7. data/app/assets/stylesheets/admin/media/application.css.scss +1 -12
  8. data/app/controllers/admin/media_controller.rb +54 -61
  9. data/app/controllers/admin/media_picker_controller.rb +8 -16
  10. data/app/models/spud_media.rb +63 -110
  11. data/app/views/admin/media/index.html.erb +4 -12
  12. data/app/views/admin/media/new.html.erb +0 -1
  13. data/app/views/admin/media_picker/_media.html.erb +2 -7
  14. data/app/views/admin/media_picker/index.html.erb +1 -2
  15. data/config/locales/en.yml +0 -1
  16. data/config/routes.rb +5 -8
  17. data/db/migrate/20120101194256_create_spud_media.rb +2 -2
  18. data/db/migrate/20120501203325_add_protected_to_spud_media.rb +1 -2
  19. data/db/migrate/20120508132153_add_cropping_to_spud_media.rb +1 -1
  20. data/lib/spud_media/configuration.rb +3 -4
  21. data/lib/spud_media/content_types.rb +2 -2
  22. data/lib/spud_media/engine.rb +21 -13
  23. data/lib/spud_media/version.rb +3 -3
  24. data/lib/tasks/spud_media_tasks.rake +4 -6
  25. data/spec/controllers/admin/media_controller_spec.rb +23 -24
  26. data/spec/dummy/config.ru +1 -1
  27. data/spec/dummy/config/application.rb +2 -3
  28. data/spec/dummy/config/boot.rb +1 -1
  29. data/spec/dummy/config/environments/development.rb +0 -7
  30. data/spec/dummy/config/environments/test.rb +3 -5
  31. data/spec/dummy/config/routes.rb +2 -2
  32. data/spec/dummy/db/migrate/20130904141442_create_spud_users.tb_core.rb +12 -12
  33. data/spec/dummy/db/migrate/20130904141443_add_time_zone_to_spud_user.tb_core.rb +0 -1
  34. data/spec/dummy/db/migrate/20130904141444_add_scope_to_spud_admin_permissions.tb_core.rb +0 -1
  35. data/spec/dummy/db/migrate/20130904141446_create_spud_media.tb_media.rb +1 -1
  36. data/spec/dummy/db/migrate/20130904141447_add_protected_to_spud_media.tb_media.rb +1 -1
  37. data/spec/dummy/db/migrate/20130904141448_add_cropping_to_spud_media.tb_media.rb +3 -3
  38. data/spec/dummy/db/migrate/20151012194531_create_spud_permissions.tb_core.rb +3 -3
  39. data/spec/dummy/db/migrate/20151012194532_create_spud_role_permissions.tb_core.rb +2 -2
  40. data/spec/dummy/db/migrate/20151012194534_add_requires_password_change_to_spud_users.tb_core.rb +1 -1
  41. data/spec/dummy/db/schema.rb +63 -67
  42. data/spec/dummy/public/system/spud_media/1/cropped/test_img1.png +0 -0
  43. data/spec/dummy/public/system/spud_media/1/small/test_img1.png +0 -0
  44. data/spec/dummy/public/system/spud_media/2/cropped/test_img1.png +0 -0
  45. data/spec/dummy/public/system/spud_media/2/small/test_img1.png +0 -0
  46. data/spec/dummy/public/system/spud_media/3/cropped/test_img1.png +0 -0
  47. data/spec/dummy/public/system/spud_media/3/small/test_img1.png +0 -0
  48. data/spec/dummy/public/system/spud_media/4/cropped/test_img1.png +0 -0
  49. data/spec/dummy/public/system/spud_media/4/small/test_img1.png +0 -0
  50. data/spec/dummy/public/system/spud_media/5/cropped/test_img1.png +0 -0
  51. data/spec/dummy/public/system/spud_media/5/small/test_img1.png +0 -0
  52. data/spec/dummy/script/rails +2 -2
  53. data/spec/javascripts/support/jasmine_helper.rb +6 -7
  54. data/spec/models/spud_media_spec.rb +2 -2
  55. data/spec/rails_helper.rb +14 -7
  56. data/spec/spec_helper.rb +42 -44
  57. metadata +103 -104
  58. data/app/controllers/protected_media_controller.rb +0 -24
  59. data/app/helpers/protected_media_helper.rb +0 -3
  60. data/spec/dummy/public/system/spud_media/1/cropped/test_img1.jpg +0 -0
  61. data/spec/dummy/public/system/spud_media/2/cropped/test_img1.jpg +0 -0
  62. data/spec/dummy/public/system/spud_media/3/cropped/test_img1.jpg +0 -0
  63. data/spec/dummy/public/system/spud_media/4/cropped/test_img1.jpg +0 -0
  64. data/spec/dummy/public/system/spud_media/5/cropped/test_img1.jpg +0 -0
  65. 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
@@ -1,3 +0,0 @@
1
- module ProtectedMediaHelper
2
-
3
- end
@@ -1,2 +0,0 @@
1
- require 'authlogic/test_case'
2
- include Authlogic::TestCase