assetable 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzI1MmU4NTY3MGVhOWIxNDJiNTllMGE0NDQ3Mzc3YTNkM2QwMmQ0Yw==
4
+ MDZjYTk0MWJjYWE4ZDkxMjVkNGNiOWQ5ODk2MDZkMjQ5M2E3ZTBlZA==
5
5
  data.tar.gz: !binary |-
6
- MDZjZTliMGY5NDdjMjUyZjdjYTY3ZmQ4NjMxNzQzYTIzMjBkODdlMg==
6
+ OTAxMTQ4M2YxZjFkYzFlODQ5MTY3MGNmODkzNTBkODJlNjY1OWE4ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjIwMmU1NWQzNTExM2RiMjUzZjg0Mjc4N2FkN2QwMDJiY2NhNjE5ZjE1ZTY3
10
- ZTc0OTc3YjhhMjE5ZjY4ZmU2NzVlYzUwYmVkZmU1MjY3YmIxMWJkN2I5ZWVi
11
- N2Q0MjEzNmJhYWZkNDIwYmUzNDQyZTdkMGYxYmM3OTg3Y2EyM2U=
9
+ N2E3YThjNTcyOGYxNGY3NDQ2OTBjNTNhNGRlZjJlYjNmNzc2ZWE2ZmU2YTI1
10
+ ZmI3NGU2MTVlOWYzZGQzMjlmOWIxMjY4NTQ1ZTkzOTU3OGRjYWFiMzM5YWE3
11
+ MmZiYmIwMTQwOWUzNjE0NzVjYjAxNmFiYmZkYmE0NDQxYzU2NTc=
12
12
  data.tar.gz: !binary |-
13
- ZjQwNWVmOTQ2MjkxZmEzZTZjYzkzZGYxNzc3MGMzZjAyN2QwYWIwYzU2NDRl
14
- MmI1MjQ4MmZjODQxNjgyZjRjMzIzNTUwZjYxMTYxNTRmYWIwMzJkMjFjODZk
15
- YzkxMzc0YmQwZjc4ZjExZmUxNTEzMTgxYjU1ZGY1MDM3ZDhkYzk=
13
+ MDc1YWUwNDlkMjNkNjY3NDE1MjkzYzA3YWVkNzRkY2IzM2RhNmFjODViY2E5
14
+ NGM5YWYxOGFlYWE5ZWZmZjMxZmY1MzIxMzEyNGM1MDE3Njc5NTMxOGU1ZDc4
15
+ MWI1MzM5NGQyZDgwZmZkMmU1NjA2MWMwNzM3NDBiOTM4MmM3NWE=
@@ -5,6 +5,7 @@
5
5
  defaults =
6
6
  allow_select_mg: true
7
7
  authenticity_token: null
8
+ directions: 'or <a href="/assetable/external_services/new" class="btn-third-party-service">add third party service</a>'
8
9
  drag_drop: true
9
10
  fieldname: null
10
11
  FileUploaded: options.onUploaded
@@ -33,7 +34,7 @@
33
34
  # Create our extra HTML for the copy and queu
34
35
  # upload_directions = '<div class="uploader-directions" id="' + assetable_uploader.id + '-drop-area"><div class="uploader-directions-image"></div><div class="uploader-directions-copy">Drag and drop files or <a href="#" class="browse-btn" id="' + assetable_uploader.id + '-browse-btn">add them manually</a></div></div>'
35
36
  # upload_directions = '<div class="uploader-directions" id="' + assetable_uploader.id + '-drop-area"><div class="uploader-directions-image"></div><div class="uploader-directions-copy"><a href="#" class="browse-btn" id="' + assetable_uploader.id + '-browse-btn">select file</a> or <a href="#" class="btn-open-asset-gallery">open gallery</a></div></div>'
36
- upload_directions = '<div class="uploader-directions" id="' + assetable_uploader.id + '-drop-area"><div class="uploader-directions-image"></div><div class="uploader-directions-copy"><a href="#" class="browse-btn" id="' + assetable_uploader.id + '-browse-btn">select file</a> or <a href="/assetable/external_services/new" class="btn-third-party-service">add third party service</a></div></div>'
37
+ upload_directions = '<div class="uploader-directions" id="' + assetable_uploader.id + '-drop-area"><div class="uploader-directions-image"></div><div class="uploader-directions-copy"><a href="#" class="browse-btn" id="' + assetable_uploader.id + '-browse-btn">select file</a> ' + assetable_uploader.options.directions + '</div></div>'
37
38
  upload_queue = '<ul class="upload-queue"></ul>'
38
39
  # Add to the uploader
39
40
  $(assetable_uploader).append(upload_directions)
@@ -211,6 +212,7 @@ bind_uploaders = ->
211
212
  multi_selection: false
212
213
  url: "/assetable/assets"
213
214
  fieldname: field
215
+ directions: $this.attr('data-uploader-directions')
214
216
  authenticity_token: $("meta[name=\"csrf-token\"]").attr("content")
215
217
  onUploaded: (resp) ->
216
218
  $this.find('.uploader-data-wrapper').html(resp.html)
@@ -7,6 +7,8 @@ class ActionView::Helpers::FormBuilder
7
7
  include ActionView::Helpers::AssetTagHelper
8
8
  include ActionView::Helpers::NumberHelper
9
9
 
10
+ # = cf.uploader :attachment, select_file: true, text: "or drag and drop your PO"
11
+
10
12
  def uploader method, options = {}
11
13
  # add an ID to the options
12
14
  options[:id] = field_id(method, options[:index]) unless options[:id].present?
@@ -14,6 +16,8 @@ class ActionView::Helpers::FormBuilder
14
16
  # Set the fieldname
15
17
  fieldname = @object_name + "[#{method}_association_attributes][asset_id]"
16
18
 
19
+ directions = options[:directions] || ''
20
+
17
21
  # Create the uploader
18
22
  value = @object.nil? ? nil : @object.send(method)
19
23
 
@@ -28,7 +32,7 @@ class ActionView::Helpers::FormBuilder
28
32
  uploader_html = content_tag(:div, (asset_preview), class: "uploader-data-wrapper")
29
33
 
30
34
  # Create and return the uploader html
31
- uploader_wrapper = content_tag(:div, uploader_html, class: "uploader #{'uploader-has-asset' if asset} #{options[:class]}", id: options[:id], :'data-uploader-input-name' => fieldname)
35
+ uploader_wrapper = content_tag(:div, uploader_html, class: "uploader #{'uploader-has-asset' if asset} #{options[:class]}", id: options[:id], :'data-uploader-input-name' => fieldname, :'data-uploader-directions' => directions)
32
36
  return uploader_wrapper
33
37
  end
34
38
 
@@ -1,3 +1,3 @@
1
1
  module Assetable
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assetable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Koht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -293,6 +293,7 @@ files:
293
293
  - app/assets/images/assetable/icons/icon-xls.png
294
294
  - app/assets/images/assetable/icons/icon-xlsx.png
295
295
  - app/assets/images/assetable/icons/icon-xml.png
296
+ - app/assets/images/assetable/icons/icon-zip.png
296
297
  - app/assets/javascripts/assetable/asset_gallery.js.coffee
297
298
  - app/assets/javascripts/assetable/assetable_uploader.js.coffee
298
299
  - app/assets/javascripts/assetable/gallery.js.coffee