media_magick 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/.gitignore +2 -1
  2. data/CHANGELOG.md +53 -1
  3. data/Gemfile +0 -2
  4. data/Guardfile +5 -0
  5. data/LICENSE +1 -1
  6. data/README.md +32 -22
  7. data/Rakefile +1 -13
  8. data/app/assets/javascripts/media_magick/plupload_it.js +54 -45
  9. data/app/controllers/media_magick/attach_controller.rb +6 -6
  10. data/app/helpers/media_magick/application_helper.rb +58 -48
  11. data/app/views/_loader.html.erb +14 -0
  12. data/app/views/_uploader.html.erb +13 -0
  13. data/app/views/_video_uploader.html.erb +2 -0
  14. data/config/locales/en.yml +1 -0
  15. data/gemfiles/mongoid-3.0.gemfile +1 -2
  16. data/lib/media_magick.rb +1 -1
  17. data/lib/media_magick/controller/helpers.rb +25 -5
  18. data/lib/media_magick/engine.rb +1 -1
  19. data/lib/media_magick/image/dimensions.rb +23 -0
  20. data/lib/media_magick/model.rb +22 -5
  21. data/lib/media_magick/version.rb +2 -2
  22. data/media_magick.gemspec +10 -13
  23. data/spec/controllers/media_magick/attach_controller_spec.rb +35 -21
  24. data/spec/dummy/app/assets/javascripts/store/products.js +2 -0
  25. data/spec/dummy/app/assets/stylesheets/store/products.css +4 -0
  26. data/spec/dummy/app/controllers/store/products_controller.rb +83 -0
  27. data/spec/dummy/app/helpers/store/products_helper.rb +2 -0
  28. data/spec/dummy/app/models/post.rb +1 -0
  29. data/spec/dummy/app/models/store/product.rb +10 -0
  30. data/spec/dummy/app/models/user.rb +3 -2
  31. data/spec/dummy/app/uploaders/post_uploader.rb +11 -3
  32. data/spec/dummy/app/views/posts/_form.html.erb +16 -5
  33. data/spec/dummy/app/views/posts/index.html.erb +1 -1
  34. data/spec/dummy/app/views/store/products/_form.html.erb +34 -0
  35. data/spec/dummy/app/views/store/products/edit.html.erb +6 -0
  36. data/spec/dummy/app/views/store/products/index.html.erb +21 -0
  37. data/spec/dummy/app/views/store/products/new.html.erb +5 -0
  38. data/spec/dummy/app/views/store/products/show.html.erb +5 -0
  39. data/spec/dummy/config/boot.rb +1 -1
  40. data/spec/dummy/config/environments/development.rb +2 -1
  41. data/spec/dummy/config/routes.rb +5 -0
  42. data/spec/fixtures/example.jpg +0 -0
  43. data/spec/helpers/media_magick/application_helper_spec.rb +86 -33
  44. data/spec/lib/media_magick/controller/helper_spec.rb +40 -15
  45. data/spec/lib/media_magick/image/dimensions_spec.rb +62 -0
  46. data/spec/lib/media_magick/model_spec.rb +9 -3
  47. data/spec/views/_upload.html.erb_spec.rb +3 -3
  48. data/tmp/rspec_guard_result +1 -0
  49. metadata +52 -48
  50. data/app/views/_file.html.erb +0 -6
  51. data/app/views/_image.html.erb +0 -6
  52. data/app/views/_upload.html.erb +0 -12
  53. data/app/views/_video.html.erb +0 -8
@@ -1,6 +0,0 @@
1
- <li class="attachment" data-id="<%= attachment.to_param %>">
2
- <%= link_to attachment.filename, attachment.url, download: attachment.filename unless attachment.file.nil? %>
3
- <%= link_to t('media_magick.remove'), "javascript://", method: "delete", class: "remove btn btn-mini btn-danger", data: { confirm: t('media_magick.confirm_removal') } %>
4
-
5
- <%= hidden_field_tag "#{model.parameterize}[#{relation.singularize}_ids][]", attachment.id if model && relation %>
6
- </li>
@@ -1,6 +0,0 @@
1
- <li class="attachment" id="<%= attachment.to_param %>" data-id="<%= attachment.to_param %>">
2
- <%= image_tag attachment.url, alt: attachment.filename if attachment.file %>
3
- <%= link_to t('media_magick.remove'), "javascript://", method: "delete", class: "remove btn btn-mini btn-danger", data: { confirm: t('media_magick.confirm_removal') } %>
4
-
5
- <%= hidden_field_tag "#{model.parameterize}[#{relation.singularize}_ids][]", attachment.id if model && relation %>
6
- </li>
@@ -1,12 +0,0 @@
1
- <div class="newAttachments <%= newAttachments[:class] %>">
2
- <ul class="attachmentQueue">
3
- </ul>
4
-
5
- <div class="dropAttachments"></div>
6
- <a class="pickAttachments btn" href="javascript://"><%= t('media_magick.select') %></a>
7
- <a class="uploadAttachments btn" href="javascript://"><%= t('media_magick.upload') %></a>
8
- </div>
9
-
10
- <ul class="loadedAttachments <%= loadedAttachments[:class] %>">
11
- <%= render partial: partial, collection: model.send(relations), :as => :attachment, :locals => { model: nil, relation: nil } %>
12
- </ul>
@@ -1,8 +0,0 @@
1
- <% id = "#{model.class.name}-#{relations}" %>
2
-
3
- <input type="text" id="attachmentVideoUploaderField<%= id %>">
4
- <a id="attachmentVideoUploader<%= id %>" href="javascript://">upload</a>
5
-
6
- <ul class="loadedAttachments <%= loadedAttachments[:class] %>">
7
- <%= render partial: partial, collection: model.send(relations), :as => :attachment, :locals => { model: nil, relation: nil } %>
8
- </ul>