rails-uploader 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -98,6 +98,21 @@ class User
98
98
  end
99
99
  ```
100
100
 
101
+ ### Notice
102
+
103
+ User method fileuploads only once pre model. So if you have many attached files, use this:
104
+
105
+ ``` ruby
106
+ class User
107
+ include Uploader::Fileuploads
108
+
109
+ has_one :picture, :as => :assetable
110
+ has_one :avatar, :as => :assetable
111
+
112
+ fileuploads :picture, :avatar
113
+ end
114
+
115
+
101
116
  ### Include assets
102
117
 
103
118
  Javascripts:
@@ -1,20 +1,19 @@
1
1
  <!-- The template to display files available for download -->
2
2
  <script id="template-download-<%= field.klass %>" type="text/x-tmpl">
3
3
  {% for (var i=0, file; file=o.files[i]; i++) { %}
4
-
5
4
  <div id="asset_{%=file.id%}" class="attach_item template-download">
6
- <div class="delete">
7
- <a href="#" class="del_btn" data-type="DELETE" data-url="/uploader/attachments/{%=file.id%}?klass=<%= field.klass %>"></a>
8
- </div>
9
- <div class="thumbnail preview">
10
- <a href="{%=file.url%}" download="{%=file.filename%}">
11
- <img src="{%=file.thumb_url%}" title="{%=file.filename%}" rel="gallery" />
12
- </a>
13
- </div>
14
- <div class="infoHolder">
15
- <div class="fileName">{%=file.filename%}</div>
16
- <div class="fileWeight">{%=o.formatFileSize(file.size)%}</div>
17
- </div>
18
- </div>
5
+ <div class="buttons-panel">
6
+ <a href="#" class="del_btn delete" data-type="DELETE" data-url="/uploader/attachments/{%=file.id%}?klass=<%= field.klass %>"></a>
7
+ </div>
8
+ <div class="thumbnail preview">
9
+ <a href="{%=file.url%}" download="{%=file.filename%}">
10
+ <img src="{%=file.thumb_url%}" title="{%=file.filename%}" rel="gallery" />
11
+ </a>
12
+ </div>
13
+ <div class="infoHolder">
14
+ <div class="fileName">{%=file.filename%}</div>
15
+ <div class="fileWeight">{%=o.formatFileSize(file.size)%}</div>
16
+ </div>
17
+ </div>
19
18
  {% } %}
20
19
  </script>
@@ -2,7 +2,7 @@
2
2
  <script id="template-upload-<%= field.klass %>" type="text/x-tmpl">
3
3
  {% for (var i=0, file; file=o.files[i]; i++) { %}
4
4
  <div class="attach_item loading template-upload">
5
- <div class="cancel"><a href="#" class="del_btn"></a></div>
5
+ <div class="buttons-panel"><a href="#" class="del_btn cancel"></a></div>
6
6
  <div class="thumbnail preview"><img class="preloader" src="/assets/uploader/preloader.gif" alt=""></div>
7
7
  <div class="infoHolder">
8
8
  <div class="fileName">{%=file.name%}</div>
@@ -1,3 +1,3 @@
1
1
  module Uploader
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.1.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: