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.
- data/.gitignore +2 -1
- data/CHANGELOG.md +53 -1
- data/Gemfile +0 -2
- data/Guardfile +5 -0
- data/LICENSE +1 -1
- data/README.md +32 -22
- data/Rakefile +1 -13
- data/app/assets/javascripts/media_magick/plupload_it.js +54 -45
- data/app/controllers/media_magick/attach_controller.rb +6 -6
- data/app/helpers/media_magick/application_helper.rb +58 -48
- data/app/views/_loader.html.erb +14 -0
- data/app/views/_uploader.html.erb +13 -0
- data/app/views/_video_uploader.html.erb +2 -0
- data/config/locales/en.yml +1 -0
- data/gemfiles/mongoid-3.0.gemfile +1 -2
- data/lib/media_magick.rb +1 -1
- data/lib/media_magick/controller/helpers.rb +25 -5
- data/lib/media_magick/engine.rb +1 -1
- data/lib/media_magick/image/dimensions.rb +23 -0
- data/lib/media_magick/model.rb +22 -5
- data/lib/media_magick/version.rb +2 -2
- data/media_magick.gemspec +10 -13
- data/spec/controllers/media_magick/attach_controller_spec.rb +35 -21
- data/spec/dummy/app/assets/javascripts/store/products.js +2 -0
- data/spec/dummy/app/assets/stylesheets/store/products.css +4 -0
- data/spec/dummy/app/controllers/store/products_controller.rb +83 -0
- data/spec/dummy/app/helpers/store/products_helper.rb +2 -0
- data/spec/dummy/app/models/post.rb +1 -0
- data/spec/dummy/app/models/store/product.rb +10 -0
- data/spec/dummy/app/models/user.rb +3 -2
- data/spec/dummy/app/uploaders/post_uploader.rb +11 -3
- data/spec/dummy/app/views/posts/_form.html.erb +16 -5
- data/spec/dummy/app/views/posts/index.html.erb +1 -1
- data/spec/dummy/app/views/store/products/_form.html.erb +34 -0
- data/spec/dummy/app/views/store/products/edit.html.erb +6 -0
- data/spec/dummy/app/views/store/products/index.html.erb +21 -0
- data/spec/dummy/app/views/store/products/new.html.erb +5 -0
- data/spec/dummy/app/views/store/products/show.html.erb +5 -0
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/config/environments/development.rb +2 -1
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/fixtures/example.jpg +0 -0
- data/spec/helpers/media_magick/application_helper_spec.rb +86 -33
- data/spec/lib/media_magick/controller/helper_spec.rb +40 -15
- data/spec/lib/media_magick/image/dimensions_spec.rb +62 -0
- data/spec/lib/media_magick/model_spec.rb +9 -3
- data/spec/views/_upload.html.erb_spec.rb +3 -3
- data/tmp/rspec_guard_result +1 -0
- metadata +52 -48
- data/app/views/_file.html.erb +0 -6
- data/app/views/_image.html.erb +0 -6
- data/app/views/_upload.html.erb +0 -12
- data/app/views/_video.html.erb +0 -8
data/app/views/_file.html.erb
DELETED
@@ -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>
|
data/app/views/_image.html.erb
DELETED
@@ -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>
|
data/app/views/_upload.html.erb
DELETED
@@ -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>
|
data/app/views/_video.html.erb
DELETED
@@ -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>
|