s3_cors_fileupload 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -2
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +19 -19
  5. data/README.md +13 -1
  6. data/lib/generators/s3_cors_fileupload/install/templates/s3_uploads.js +1 -2
  7. data/lib/generators/s3_cors_fileupload/install/templates/source_file.rb +1 -1
  8. data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_download.html.erb +19 -16
  9. data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_upload.html.erb +31 -26
  10. data/lib/generators/s3_cors_fileupload/install/templates/views/erb/_template_uploaded.html.erb +18 -13
  11. data/lib/generators/s3_cors_fileupload/install/templates/views/erb/index.html.erb +1 -1
  12. data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_download.html.haml +16 -21
  13. data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_upload.html.haml +15 -18
  14. data/lib/generators/s3_cors_fileupload/install/templates/views/haml/_template_uploaded.html.haml +12 -13
  15. data/lib/generators/s3_cors_fileupload/install/templates/views/haml/index.html.haml +1 -1
  16. data/lib/s3_cors_fileupload/rails/form_helper.rb +16 -14
  17. data/lib/s3_cors_fileupload/version.rb +3 -3
  18. data/vendor/assets/javascripts/s3_cors_fileupload/index.js +4 -1
  19. data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-image.js +213 -0
  20. data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-process.js +164 -0
  21. data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-ui.js +62 -228
  22. data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload-validate.js +116 -0
  23. data/vendor/assets/javascripts/s3_cors_fileupload/jquery.fileupload.js +212 -84
  24. data/vendor/assets/javascripts/s3_cors_fileupload/jquery.iframe-transport.js +24 -4
  25. data/vendor/assets/javascripts/s3_cors_fileupload/vendor/jquery.ui.widget.js +1 -1
  26. data/vendor/assets/javascripts/s3_cors_fileupload/vendor/load-image.js +138 -172
  27. data/vendor/assets/javascripts/s3_cors_fileupload/vendor/tmpl.js +3 -4
  28. data/vendor/assets/stylesheets/jquery.fileupload-ui.css.erb +12 -28
  29. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2cfe9cc0074544ce499718dcade6db5f33a0f51
4
- data.tar.gz: da9078e43ca4632005d14abd7722fa5ec91e28cc
3
+ metadata.gz: 1663604ff16d796357b7403b636742f6e24918bb
4
+ data.tar.gz: e57aa2433e8b7bc6d9dd2310eef4d3c618e0fb54
5
5
  SHA512:
6
- metadata.gz: c34ea6dcfdcbd365338edae0d6c9360bb99a4b4fb8023c3f2650775af59455cef3fc14e965677e9dff9f041faed8ce3fcf1f636a70b5fb32974610f8b6e1cd9c
7
- data.tar.gz: 80b107368d59fb206ea925c414047750d829208b425a318846b4e37a5deac53987517f3672f97d9f86f0f0e637aabe82caf09b43a23ad7f36caccdc02d9c5d66
6
+ metadata.gz: 5151172fdf0783b98a8a5f49230387c7bdc1856ccdf6840c4a657b814ed127af593e2e3ad2265bf76361fb9728f17b05935fbe5eb6dda2d89309c6dac462eaae
7
+ data.tar.gz: 1c609d8679a456000135604c3f008b1986290529fabf70e6b840ef08903a86d2399e345b77525afcd72e0f8373cfa76b733932af298070a99c215ea4ddae892d
data/CHANGELOG.md CHANGED
@@ -1,10 +1,20 @@
1
- ## 0.2.0 (Unreleased)
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
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
4
  gem 'rdoc', '~> 3.12'
5
- gem 'gem-release', '~> 0.5'
5
+ gem 'gem-release', '~> 0.6'
6
6
  end
7
7
 
8
8
  group :test do
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.15.0)
40
- gem-release (0.5.5)
41
- generator_spec (0.8.7)
42
- activerecord (>= 3.0, < 4.0)
43
- railties (>= 3.0, < 4.0)
44
- hike (1.2.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.7.7)
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.2)
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.4)
77
+ rake (10.1.0)
78
78
  rdoc (3.12.2)
79
79
  json (~> 1.4)
80
- rspec-core (2.13.1)
81
- rspec-expectations (2.13.0)
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.13.1)
84
- rspec-rails (2.13.1)
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.13.0)
89
- rspec-expectations (~> 2.13.0)
90
- rspec-mocks (~> 2.13.0)
91
- shoulda-matchers (2.0.0)
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.3.7)
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.5)
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 (c) 2012 Ben Atkins. See [LICENSE.txt](https://github.com/fullbridge-batkins/s3_cors_fileupload/blob/master/LICENSE.txt)
154
+ Copyright &copy; 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_' + deleted_object_id).remove();
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
 
@@ -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
- {% if (file.error) { %}
6
- <td></td>
7
- <td class="name"><span>{%=file.name%}</span></td>
8
- <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
9
- <td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
10
- {% } else { %}
11
- <td class="preview">{% if (file.thumbnail_url) { %}
12
- <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
13
- {% } %}</td>
14
- <td class="name">
15
- <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
16
- </td>
17
- <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
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>
@@ -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
- <tr class="template-upload fade">
5
- <td class="preview"><span class="fade"></span></td>
6
- <td class="name"><span>{%=file.name%}</span></td>
7
- <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
8
- {% if (file.error) { %}
9
- <td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>
10
- {% } else if (o.files.valid && !i) { %}
11
- <td>
12
- <div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
13
- </td>
14
- <td>{% if (!o.options.autoUpload) { %}
15
- <button class="btn btn-primary start">
16
- <i class="icon-upload icon-white"></i>
17
- <span>Start</span>
18
- </button>
19
- {% } %}</td>
20
- {% } else { %}
21
- <td colspan="2"></td>
22
- {% } %}
23
- <td>{% if (!i) { %}
24
- <button class="btn btn-warning cancel">
25
- <i class="icon-ban-circle icon-white"></i>
26
- <span>Cancel</span>
27
- </button>
28
- {% } %}</td>
29
- </tr>
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>
@@ -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 class="preview">
6
- {% if (o.image == true) { %}
7
- <a href="{%=o.url%}" title="{%=o.name%}" rel="gallery" download="{%=o.name%}">
8
- <image src="{%=o.url%}", style='width:80px; height:56px;'></image>
9
- </a>
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 class="name">
13
- <a href="{%=o.url%}" title="{%=o.name%}" rel="{%=o.thumbnail_url&&'gallery'%}" download="{%=o.name%}">{%=o.name%}</a>
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 class="size"><span>{%=formatFileSize(o.size)%}</span></td>
16
- <td colspan="2"></td>
17
- <td class="delete">
18
- <button class="btn btn-danger delete" data-type="DELETE" data-url="{%=o.delete_url%}" data-confirmation="Are you sure?" {% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
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/css/bootstrap-combined.min.css' %>
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>
@@ -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
- %td.name
9
- %span {%=file.name%}
10
- %td.size
11
- %span {%=o.formatFileSize(file.size)%}
12
- %td.error{:colspan => "2"}
13
- %span.label.label-important Error
14
- {%=file.error%}
15
- {% } else { %}
16
- %td.preview
17
- {% if (file.thumbnail_url) { %}
18
- %a{:download => "{%=file.name%}", :href => "{%=file.url%}", :rel => "gallery", :title => "{%=file.name%}"}
19
- %img{:src => "{%=file.thumbnail_url%}"}/
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.name
22
- %a{:download => "{%=file.name%}", :href => "{%=file.url%}", :rel => "{%=file.thumbnail_url&&'gallery'%}".html_safe, :title => "{%=file.name%}"} {%=file.name%}
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
+ {% } %}
@@ -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
- .progress.progress-success.progress-striped.active
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
+ {% } %}
@@ -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
- %td.name
13
- %a{:download => "{%=o.name%}", :href => "{%=o.url%}", :rel => "{%=o.thumbnail_url&&'gallery'%}".html_safe, :title => "{%=o.name%}"} {%=o.name%}
14
- %td.size
15
- %span {%=formatFileSize(o.size)%}
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
- %button.btn.btn-danger.delete{"data-type" => "DELETE", "data-url" => "{%=o.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} {% } %}"}
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"}