s3_cors_fileupload 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +19 -19
- data/README.md +13 -1
- data/lib/generators/s3_cors_fileupload/install/templates/s3_uploads.js +1 -2
- data/lib/generators/s3_cors_fileupload/install/templates/source_file.rb +1 -1
- data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_download.html.erb +19 -16
- data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_upload.html.erb +31 -26
- data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_uploaded.html.erb +18 -13
- data/lib/generators/s3_cors_fileupload/install/templates/views/erb/index.html.erb +1 -1
- data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_download.html.haml +16 -21
- data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_upload.html.haml +15 -18
- data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_uploaded.html.haml +12 -13
- data/lib/generators/s3_cors_fileupload/install/templates/views/haml/index.html.haml +1 -1
- data/lib/s3_cors_fileupload/rails/form_helper.rb +16 -14
- data/lib/s3_cors_fileupload/version.rb +3 -3
- data/vendor/assets/javascripts/s3_cors_fileupload/index.js +4 -1
- data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-image.js +213 -0
- data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-process.js +164 -0
- data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-ui.js +62 -228
- data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-validate.js +116 -0
- data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload.js +212 -84
- data/vendor/assets/javascripts/s3_cors_fileupload/jquery.iframe-transport.js +24 -4
- data/vendor/assets/javascripts/s3_cors_fileupload/vendor/jquery.ui.widget.js +1 -1
- data/vendor/assets/javascripts/s3_cors_fileupload/vendor/load-image.js +138 -172
- data/vendor/assets/javascripts/s3_cors_fileupload/vendor/tmpl.js +3 -4
- data/vendor/assets/stylesheets/jquery.fileupload-ui.css.erb +12 -28
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1663604ff16d796357b7403b636742f6e24918bb
|
4
|
+
data.tar.gz: e57aa2433e8b7bc6d9dd2310eef4d3c618e0fb54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5151172fdf0783b98a8a5f49230387c7bdc1856ccdf6840c4a657b814ed127af593e2e3ad2265bf76361fb9728f17b05935fbe5eb6dda2d89309c6dac462eaae
|
7
|
+
data.tar.gz: 1c609d8679a456000135604c3f008b1986290529fabf70e6b840ef08903a86d2399e345b77525afcd72e0f8373cfa76b733932af298070a99c215ea4ddae892d
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,20 @@
|
|
1
|
-
## 0.
|
1
|
+
## 0.3.0 (Unreleased)
|
2
|
+
|
3
|
+
- Added a lot more spec coverage.
|
4
|
+
|
5
|
+
## 0.2.1
|
6
|
+
|
7
|
+
- Adjusted FormHelper module so that the 'Add files...' button is a `span` tag instead of a `button` tag (fixes compatibility with FireFox)
|
8
|
+
- Upgraded jQuery-File-Upload and the other JavaScript files it is dependent upon to the most recent releases (see [lib/s3\_cors\_fileupload/version.rb](https://github.com/fullbridge-batkins/s3_cors_fileupload/blob/master/lib/s3_cors_fileupload/version.rb) for the current version #'s)
|
9
|
+
- Added new Process and Validation plugins from the jQuery-File-Upload package.
|
10
|
+
- Minor stability enhancements.
|
11
|
+
|
12
|
+
## 0.2.0
|
2
13
|
|
3
14
|
- Upgraded jQuery-File-Upload and the other JavaScript files it is dependent upon to the most recent releases (see [lib/s3\_cors\_fileupload/version.rb](https://github.com/fullbridge-batkins/s3_cors_fileupload/blob/master/lib/s3_cors_fileupload/version.rb) for the current version #'s)
|
4
15
|
- Adjusted the `s3_cors_fileupload_form_tag` view helper so that block arguments passed to it are inserted inside of the form tag as opposed to the end of it.
|
5
16
|
- Changed the default expiration time for the form from 1 hour to 10 hours.
|
6
17
|
- Swapped in [MultiJSON](https://github.com/intridea/multi_json) for the JSON gem.
|
7
|
-
- Added a lot more spec coverage.
|
8
18
|
|
9
19
|
## 0.1.5
|
10
20
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -36,21 +36,21 @@ GEM
|
|
36
36
|
builder (3.0.4)
|
37
37
|
diff-lcs (1.2.4)
|
38
38
|
erubis (2.7.0)
|
39
|
-
ffaker (1.
|
40
|
-
gem-release (0.
|
41
|
-
generator_spec (0.
|
42
|
-
activerecord (>= 3.0,
|
43
|
-
railties (>= 3.0,
|
44
|
-
hike (1.2.
|
39
|
+
ffaker (1.16.2)
|
40
|
+
gem-release (0.6.0)
|
41
|
+
generator_spec (0.9.0)
|
42
|
+
activerecord (>= 3.0, <= 4.0)
|
43
|
+
railties (>= 3.0, <= 4.0)
|
44
|
+
hike (1.2.3)
|
45
45
|
i18n (0.6.1)
|
46
46
|
journey (1.0.4)
|
47
|
-
json (1.
|
47
|
+
json (1.8.0)
|
48
48
|
mail (2.5.3)
|
49
49
|
i18n (>= 0.4.0)
|
50
50
|
mime-types (~> 1.16)
|
51
51
|
treetop (~> 1.4.8)
|
52
52
|
mime-types (1.23)
|
53
|
-
multi_json (1.7.
|
53
|
+
multi_json (1.7.7)
|
54
54
|
polyglot (0.3.3)
|
55
55
|
rack (1.4.5)
|
56
56
|
rack-cache (1.2)
|
@@ -74,21 +74,21 @@ GEM
|
|
74
74
|
rake (>= 0.8.7)
|
75
75
|
rdoc (~> 3.4)
|
76
76
|
thor (>= 0.14.6, < 2.0)
|
77
|
-
rake (10.0
|
77
|
+
rake (10.1.0)
|
78
78
|
rdoc (3.12.2)
|
79
79
|
json (~> 1.4)
|
80
|
-
rspec-core (2.
|
81
|
-
rspec-expectations (2.
|
80
|
+
rspec-core (2.14.3)
|
81
|
+
rspec-expectations (2.14.0)
|
82
82
|
diff-lcs (>= 1.1.3, < 2.0)
|
83
|
-
rspec-mocks (2.
|
84
|
-
rspec-rails (2.
|
83
|
+
rspec-mocks (2.14.1)
|
84
|
+
rspec-rails (2.14.0)
|
85
85
|
actionpack (>= 3.0)
|
86
86
|
activesupport (>= 3.0)
|
87
87
|
railties (>= 3.0)
|
88
|
-
rspec-core (~> 2.
|
89
|
-
rspec-expectations (~> 2.
|
90
|
-
rspec-mocks (~> 2.
|
91
|
-
shoulda-matchers (2.
|
88
|
+
rspec-core (~> 2.14.0)
|
89
|
+
rspec-expectations (~> 2.14.0)
|
90
|
+
rspec-mocks (~> 2.14.0)
|
91
|
+
shoulda-matchers (2.2.0)
|
92
92
|
activesupport (>= 3.0.0)
|
93
93
|
sprockets (2.2.2)
|
94
94
|
hike (~> 1.2)
|
@@ -97,7 +97,7 @@ GEM
|
|
97
97
|
tilt (~> 1.1, != 1.3.0)
|
98
98
|
sqlite3 (1.3.7)
|
99
99
|
thor (0.18.1)
|
100
|
-
tilt (1.
|
100
|
+
tilt (1.4.1)
|
101
101
|
treetop (1.4.12)
|
102
102
|
polyglot
|
103
103
|
polyglot (>= 0.3.1)
|
@@ -110,7 +110,7 @@ PLATFORMS
|
|
110
110
|
DEPENDENCIES
|
111
111
|
aws-s3
|
112
112
|
ffaker
|
113
|
-
gem-release (~> 0.
|
113
|
+
gem-release (~> 0.6)
|
114
114
|
generator_spec
|
115
115
|
rails (~> 3.2)
|
116
116
|
rdoc (~> 3.12)
|
data/README.md
CHANGED
@@ -3,6 +3,18 @@
|
|
3
3
|
A gem to allow for uploading of files to directly AWS-S3 via [CORS](http://www.w3.org/TR/cors/) using the
|
4
4
|
[jQuery-File-Upload javascript](http://blueimp.github.com/jQuery-File-Upload/) for Rails 3.1 and greater.
|
5
5
|
|
6
|
+
### Included JavaScript plugin versions
|
7
|
+
|
8
|
+
* jQuery File Upload User Interface Plugin 8.5.0
|
9
|
+
* jQuery File Upload Plugin 5.32.0
|
10
|
+
* jQuery UI Widget 1.10.3+amd
|
11
|
+
|
12
|
+
### Upgrade notes for `0.2` (and higher) releases
|
13
|
+
|
14
|
+
If you are upgrading from an older version, please re-run the install generator with the `--skip-migration` option.
|
15
|
+
The view templates (`_template_download`, `_template_upload`, `_template_uploaded`) often change to stay compatible with
|
16
|
+
the new version(s) of the jQuery-File-Upload UI JavaScript.
|
17
|
+
|
6
18
|
## Installation
|
7
19
|
Add this line to your application's Gemfile:
|
8
20
|
|
@@ -139,5 +151,5 @@ Note: I am still in the process of trying to write a more thorough test suite, s
|
|
139
151
|
|
140
152
|
## Copyright
|
141
153
|
|
142
|
-
Copyright
|
154
|
+
Copyright © 2013 Ben Atkins. See [LICENSE.txt](https://github.com/fullbridge-batkins/s3_cors_fileupload/blob/master/LICENSE.txt)
|
143
155
|
for further details.
|
@@ -72,9 +72,8 @@ $(function() {
|
|
72
72
|
if (!data.url) // sometimes this callback seems to get triggered a couple times, and has null data after the first time
|
73
73
|
return null;
|
74
74
|
|
75
|
-
var deleted_object_id = String(data.url).split('/').pop();
|
76
75
|
// remove the table row containing the source file information from the page
|
77
|
-
$('#source_file_' +
|
76
|
+
$('#source_file_' + data.object_id).remove();
|
78
77
|
});
|
79
78
|
|
80
79
|
});
|
@@ -24,7 +24,7 @@ class SourceFile < ActiveRecord::Base
|
|
24
24
|
'size' => file_size,
|
25
25
|
'url' => url,
|
26
26
|
'image' => self.is_image?,
|
27
|
-
'delete_url' => Rails.application.routes.url_helpers.source_file_path(self)
|
27
|
+
'delete_url' => Rails.application.routes.url_helpers.source_file_path(self, :format => :json)
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_download.html.erb
CHANGED
@@ -2,28 +2,31 @@
|
|
2
2
|
<script id="template-download" type="text/x-tmpl">
|
3
3
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
4
4
|
<tr class="template-download fade">
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<td colspan="2"></td>
|
5
|
+
<td>
|
6
|
+
<span class="preview">
|
7
|
+
{% if (file.thumbnailUrl) { %}
|
8
|
+
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
|
9
|
+
{% } %}
|
10
|
+
</span>
|
11
|
+
</td>
|
12
|
+
<td>
|
13
|
+
<p class="name">
|
14
|
+
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl ? 'data-gallery' : ''%}>{%=file.name%}</a>
|
15
|
+
</p>
|
16
|
+
{% if (file.error) { %}
|
17
|
+
<div><span class="label label-important">Error</span> {%=file.error%}</div>
|
19
18
|
{% } %}
|
19
|
+
</td>
|
20
|
+
<td>
|
21
|
+
<span class="size">{%=o.formatFileSize(file.size)%}</span>
|
22
|
+
</td>
|
20
23
|
<td>
|
21
24
|
<button class="btn btn-danger delete" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}" data-confirmation="Are you sure?" {% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
|
22
25
|
<i class="icon-trash icon-white"></i>
|
23
26
|
<span>Delete</span>
|
24
27
|
</button>
|
25
|
-
<input type="checkbox" name="delete" value="1">
|
28
|
+
<input type="checkbox" name="delete" value="1" class="toggle">
|
26
29
|
</td>
|
27
30
|
</tr>
|
28
|
-
|
31
|
+
{% } %}
|
29
32
|
</script>
|
data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_upload.html.erb
CHANGED
@@ -1,31 +1,36 @@
|
|
1
1
|
<!-- The template to display files available for upload -->
|
2
2
|
<script id="template-upload" type="text/x-tmpl">
|
3
3
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
4
|
+
<tr class="template-upload fade">
|
5
|
+
<td>
|
6
|
+
<span class="preview"></span>
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
<p class="name">{%=file.name%}</p>
|
10
|
+
{% if (file.error) { %}
|
11
|
+
<div><span class="label label-important">Error</span> {%=file.error%}</div>
|
12
|
+
{% } %}
|
13
|
+
</td>
|
14
|
+
<td>
|
15
|
+
<p class="size">{%=o.formatFileSize(file.size)%}</p>
|
16
|
+
{% if (!o.files.error) { %}
|
17
|
+
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
|
18
|
+
{% } %}
|
19
|
+
</td>
|
20
|
+
<td>
|
21
|
+
{% if (!o.files.error && !i && !o.options.autoUpload) { %}
|
22
|
+
<button class="btn btn-primary start">
|
23
|
+
<i class="icon-upload icon-white"></i>
|
24
|
+
<span>Start</span>
|
25
|
+
</button>
|
26
|
+
{% } %}
|
27
|
+
{% if (!i) { %}
|
28
|
+
<button class="btn btn-warning cancel">
|
29
|
+
<i class="icon-ban-circle icon-white"></i>
|
30
|
+
<span>Cancel</span>
|
31
|
+
</button>
|
32
|
+
{% } %}
|
33
|
+
</td>
|
34
|
+
</tr>
|
30
35
|
{% } %}
|
31
36
|
</script>
|
data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_uploaded.html.erb
CHANGED
@@ -2,24 +2,29 @@
|
|
2
2
|
<!-- This essentially is a stand-in for the template_download partial for the s3_cors_fileupload gem's purposes -->
|
3
3
|
<script id="template-uploaded" type="text/x-tmpl">
|
4
4
|
<tr class="template-uploaded" id="source_file_{%=o.id%}">
|
5
|
-
<td
|
6
|
-
|
7
|
-
|
8
|
-
<
|
9
|
-
|
10
|
-
|
5
|
+
<td>
|
6
|
+
<span class="preview">
|
7
|
+
{% if (o.image == true) { %}
|
8
|
+
<a href="{%=o.url%}" title="{%=o.name%}" download="{%=o.name%}" data-gallery>
|
9
|
+
<image src="{%=o.url%}", style='width:80px; height:56px;'></image>
|
10
|
+
</a>
|
11
|
+
{% } %}
|
12
|
+
</span>
|
11
13
|
</td>
|
12
|
-
<td
|
13
|
-
<
|
14
|
+
<td>
|
15
|
+
<p class="name">
|
16
|
+
<a href="{%=o.url%}" title="{%=o.name%}" download="{%=o.name%}" {%=o.image ? 'data-gallery' : ''%}>{%=o.name%}</a>
|
17
|
+
</p>
|
14
18
|
</td>
|
15
|
-
<td
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
<td>
|
20
|
+
<span class="size">{%=formatFileSize(o.size)%}</span>
|
21
|
+
</td>
|
22
|
+
<td>
|
23
|
+
<button class="btn btn-danger delete" data-type="DELETE" data-url="{%=o.delete_url%}" data-object_id="{%=o.id%}" data-confirmation="Are you sure?" {% if (o.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
|
19
24
|
<i class="icon-trash icon-white"></i>
|
20
25
|
<span>Delete</span>
|
21
26
|
</button>
|
22
|
-
<input type="checkbox" name="delete" value="1">
|
27
|
+
<input type="checkbox" name="delete" value="1" class="toggle">
|
23
28
|
</td>
|
24
29
|
</tr>
|
25
30
|
</script>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= stylesheet_link_tag '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.
|
1
|
+
<%= stylesheet_link_tag '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css' %>
|
2
2
|
|
3
3
|
<div style="padding: 10px;">
|
4
4
|
<h2>Upload file(s)</h2>
|
data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_download.html.haml
CHANGED
@@ -3,30 +3,25 @@
|
|
3
3
|
%script#template-download{:type => "text/x-tmpl"}
|
4
4
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
5
5
|
%tr.template-download.fade
|
6
|
-
{% if (file.error) { %}
|
7
6
|
%td
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
%span.preview
|
8
|
+
{% if (file.thumbnailUrl) { %}
|
9
|
+
%a{:download => "{%=file.name%}", :href => "{%=file.url%}", :title => "{%=file.name%}", :"data-gallery" => ''}
|
10
|
+
%img{:src => "{%=file.thumbnailUrl%}"}/
|
11
|
+
{% } %}
|
12
|
+
%td
|
13
|
+
%p.name
|
14
|
+
%a{:href => "{%=file.url%}", :title => "{%=file.name%}", :download => "{%=file.name%}", :"data-gallery" => !"{%= file.thumbnailUrl ? ' ' : '' %}".html_safe.empty? && ''} {%=file.name%}
|
15
|
+
{% if (file.error) { %}
|
16
|
+
%div
|
17
|
+
%span.label.label-important Error
|
18
|
+
{%=file.error%}
|
20
19
|
{% } %}
|
21
|
-
%td
|
22
|
-
%
|
23
|
-
%td.size
|
24
|
-
%span {%=$('#fileupload').formatFileSize(file.size)%}
|
25
|
-
%td{:colspan => "2"}
|
26
|
-
{% } %}
|
20
|
+
%td
|
21
|
+
%span.size {%=o.formatFileSize(file.size)%}
|
27
22
|
%td
|
28
23
|
%button.btn.btn-danger.delete{"data-type" => "{%=file.delete_type%}", "data-url" => "{%=file.delete_url%}", "data-confirmation" => "Are you sure?", "data-xhr-fields" => !"{% if (file.delete_with_credentials) { %} {'withCredentials': true} {% } %}".blank? && "{% if (file.delete_with_credentials) { %} {'withCredentials': true} {% } %}"}
|
29
24
|
%i.icon-trash.icon-white
|
30
25
|
%span Delete
|
31
|
-
%input{:name => "delete", :type => "checkbox", :value => "1"}
|
32
|
-
{% } %}
|
26
|
+
%input.toggle{:name => "delete", :type => "checkbox", :value => "1"}
|
27
|
+
{% } %}
|
data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_upload.html.haml
CHANGED
@@ -3,33 +3,30 @@
|
|
3
3
|
%script#template-upload{:type => "text/x-tmpl"}
|
4
4
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
5
5
|
%tr.template-upload.fade
|
6
|
-
%td.preview
|
7
|
-
%span.fade
|
8
|
-
%td.name
|
9
|
-
%span {%=file.name%}
|
10
|
-
%td.size
|
11
|
-
%span {%=o.formatFileSize(file.size)%}
|
12
|
-
{% if (file.error) { %}
|
13
|
-
%td.error{:colspan => "2"}
|
14
|
-
%span.label.label-important Error
|
15
|
-
{%=file.error%}
|
16
|
-
{% } else if (o.files.valid && !i) { %}
|
17
6
|
%td
|
18
|
-
.
|
7
|
+
%span.preview
|
8
|
+
%td
|
9
|
+
%p.name {%=file.name%}
|
10
|
+
{% if (file.error) { %}
|
11
|
+
%div
|
12
|
+
%span.label.label-important Error
|
13
|
+
{%=file.error%}
|
14
|
+
{% } %}
|
15
|
+
%td
|
16
|
+
%p.size {%=o.formatFileSize(file.size)%}
|
17
|
+
{% if (!o.files.error) { %}
|
18
|
+
.progress.progress-success.progress-striped.active{:role => 'progressbar', :"aria-valuemin" => '0', :"aria-valuemax" => '100', :"aria-valuenow" => '0'}
|
19
19
|
.bar{:style => "width:0%;"}
|
20
|
+
{% } %}
|
20
21
|
%td
|
21
|
-
{% if (!o.options.autoUpload) { %}
|
22
|
+
{% if (!o.files.error && !i && !o.options.autoUpload) { %}
|
22
23
|
%button.btn.btn-primary.start
|
23
24
|
%i.icon-upload.icon-white
|
24
25
|
%span Start
|
25
26
|
{% } %}
|
26
|
-
{% } else { %}
|
27
|
-
%td{:colspan => "2"}
|
28
|
-
{% } %}
|
29
|
-
%td
|
30
27
|
{% if (!i) { %}
|
31
28
|
%button.btn.btn-warning.cancel
|
32
29
|
%i.icon-ban-circle.icon-white
|
33
30
|
%span Cancel
|
34
31
|
{% } %}
|
35
|
-
{% } %}
|
32
|
+
{% } %}
|
data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_uploaded.html.haml
CHANGED
@@ -2,20 +2,19 @@
|
|
2
2
|
/ The template to display files that have been uploaded to S3 already
|
3
3
|
%script#template-uploaded{:type => "text/x-tmpl"}
|
4
4
|
%tr.template-uploaded{:id => "source_file_{%=o.id%}"}
|
5
|
-
{% if (o.image == true) { %}
|
6
|
-
%td.preview
|
7
|
-
%a{:download => "{%=o.name%}", :href => "{%=o.url%}", :rel => "gallery", :title => "{%=o.name%}"}
|
8
|
-
%img{:src => "{%=o.url%}", :style => 'width:80px; height:56px;'}
|
9
|
-
{% } else { %}
|
10
5
|
%td
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
%td{:colspan => "2"}
|
6
|
+
%span.preview
|
7
|
+
{% if (o.image == true) { %}
|
8
|
+
%a{:download => "{%=o.name%}", :href => "{%=o.url%}", :title => "{%=o.name%}", :"data-gallery" => ''}
|
9
|
+
%img{:src => "{%=o.url%}", :style => 'width:80px; height:56px;'}
|
10
|
+
{% } %}
|
17
11
|
%td
|
18
|
-
%
|
12
|
+
%p.name
|
13
|
+
%a{:href => "{%=o.url%}", :title => "{%=o.name%}", :download => "{%=o.name%}", :"data-gallery" => !"{%= o.thumbnailUrl ? 'true' : '' %}".html_safe.empty? && ''} {%=o.name%}
|
14
|
+
%td
|
15
|
+
%span.size {%=formatFileSize(o.size)%}
|
16
|
+
%td
|
17
|
+
%button.btn.btn-danger.delete{"data-type" => "DELETE", "data-url" => "{%=o.delete_url%}", "data-object_id" => "{%=o.id%}", "data-confirmation" => "Are you sure?", "data-xhr-fields" => !"{% if (o.delete_with_credentials) { %} {'withCredentials': true} {% } %}".blank? && "{% if (o.delete_with_credentials) { %} {'withCredentials': true} {% } %}"}
|
19
18
|
%i.icon-trash.icon-white
|
20
19
|
%span Delete
|
21
|
-
%input{:name => "delete", :type => "checkbox", :value => "1"}
|
20
|
+
%input.toggle{:name => "delete", :type => "checkbox", :value => "1"}
|