|
49 | 49 | <script id="template-upload" type="text/x-tmpl">
|
50 | 50 | [% for (var i=0, file; file=o.files[i]; i++) { %]
|
51 | 51 | <tr class="template-upload fade">
|
52 |
| - <td class="preview"><span class="fade"></span></td> |
53 |
| - <td class="name"><span>[%=file.name%]</span></td> |
54 |
| - <td class="size"><span>[%=o.formatFileSize(file.size)%]</span></td> |
55 |
| - [% if (file.error) { %] |
56 |
| - <td class="error" colspan="2">Error [%=file.error%]</td> |
57 |
| - [% } else if (o.files.valid && !i) { %] |
58 |
| - <td> |
59 |
| - <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> |
60 |
| - </td> |
61 |
| - <td>[% if (!o.options.autoUpload) { %] |
62 |
| - <button class="start">Start</button> |
63 |
| - [% } %]</td> |
64 |
| - [% } else { %] |
65 |
| - <td colspan="2"></td> |
66 |
| - [% } %] |
67 |
| - <td>[% if (!i) { %] |
68 |
| - <button class="cancel">Cancel</button> |
69 |
| - [% } %]</td> |
| 52 | + <td class="preview"> |
| 53 | + <span class="fade"></span> |
| 54 | + </td> |
| 55 | + <td class="name"> |
| 56 | + [%=file.name%] |
| 57 | + [% if (file.error) { %] |
| 58 | + <div>{% trans 'Error' %} [%=file.error%]</div> |
| 59 | + [% } %] |
| 60 | + </td> |
| 61 | + <td class="size"> |
| 62 | + <p>[%=o.formatFileSize(file.size)%]</p> |
| 63 | + [% if (!o.files.error) { %] |
| 64 | + <div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"></div> |
| 65 | + [% } %] |
| 66 | + </td> |
| 67 | + <td> |
| 68 | + [% if (!o.files.error && !i && !o.options.autoUpload) { %] |
| 69 | + <button class="start">{% trans 'Start' %}</button> |
| 70 | + [% } %] |
| 71 | + [% if (!i) { %] |
| 72 | + <button class="cancel">{% trans 'Cancel' %}</button> |
| 73 | + [% } %] |
| 74 | + </td> |
70 | 75 | </tr>
|
71 | 76 | [% } %]
|
72 | 77 | </script>
|
|
76 | 81 | <script id="template-download" type="text/x-tmpl">
|
77 | 82 | [% for (var i=0, file; file=o.files[i]; i++) { %]
|
78 | 83 | <tr class="template-download fade">
|
79 |
| - [% if (file.error) { %] |
80 |
| - <td></td> |
81 |
| - <td class="name"><span>[%=file.name%]</span></td> |
82 |
| - <td class="size"><span>[%=o.formatFileSize(file.size)%]</span></td> |
83 |
| - <td class="error" colspan="2">>Error [%=file.error%]</td> |
84 |
| - [% } else { %] |
85 |
| - <td class="preview">[% if (file.thumbnail_url) { %] |
86 |
| - <a href="[%=file.url%]" title="[%=file.name%]" data-gallery="gallery" download="[%=file.name%]"><img src="[%=file.thumbnail_url%]"></a> |
87 |
| - [% } %]</td> |
88 |
| - <td class="name"> |
89 |
| - <a href="[%=file.url%]" title="[%=file.name%]" data-gallery="[%=file.thumbnail_url&&'gallery'%]" download="[%=file.name%]">[%=file.name%]</a> |
90 |
| - </td> |
91 |
| - <td class="size"><span>[%=o.formatFileSize(file.size)%]</span></td> |
92 |
| - <td colspan="2"></td> |
93 |
| - [% } %] |
94 | 84 | <td>
|
95 |
| - <button class="delete" data-type="[%=file.delete_type%]" data-url="[%=file.delete_url%]"[% if (file.delete_with_credentials) { %] data-xhr-fields='{"withCredentials":true}'[% } %]>Delete</button> |
| 85 | + <span class="preview"> |
| 86 | + [% if (file.thumbnail_url) { %] |
| 87 | + <a href="[%=file.url%]" title="[%=file.name%]" class="gallery" download="[%=file.name%]" data-gallery><img src="[%=file.thumbnail_url%]"></a> |
| 88 | + [% } %] |
| 89 | + </span> |
| 90 | + </td> |
| 91 | + <td> |
| 92 | + <p class="name"> |
| 93 | + <a href="[%=file.url%]" title="[%=file.name%]" download="[%=file.name%]" [%=file.thumbnail_url?'data-gallery':''%]>[%=file.name%]</a> |
| 94 | + </p> |
| 95 | + [% if (file.error) { %] |
| 96 | + <div><span class="error">{% trans 'Error' %}</span> [%=file.error%]</div> |
| 97 | + [% } %] |
| 98 | + </td> |
| 99 | + <td> |
| 100 | + <span class="size">[%=o.formatFileSize(file.size)%]</span> |
| 101 | + </td> |
| 102 | + <td> |
| 103 | + <button class="delete" data-type="[%=file.deleteType%]" data-url="[%=file.deleteUrl%]"[% if (file.deleteWithCredentials) { %] data-xhr-fields='{"withCredentials":true}'[% } %]>Delete</button> |
96 | 104 | <input type="checkbox" name="delete" value="1" class="toggle">
|
97 | 105 | <!-- Fields to work properly with the uploader -->
|
98 | 106 | <input type="hidden" name="jquery_uploads" value="[%=file.url%]">
|
|
143 | 151 | tmpl.regexp = /([\s'\\])(?![^%]*%\])|(?:\[%(=|#)([\s\S]+?)%\])|(\[%)|(%\])/g;
|
144 | 152 |
|
145 | 153 | // Initialize the jQuery File Upload widget:
|
146 |
| - // Uncomment the following to send cross-domain cookies: |
147 | 154 | $("#fileupload").fileupload({
|
148 | 155 | maxFileSize: {{ max_file_size }},
|
149 | 156 | previewMaxHeight: {{ preview_max_height }},
|
150 | 157 | previewMaxWidth: {{ preview_max_width }},
|
| 158 | + |
| 159 | + // Uncomment the following to send cross-domain cookies: |
151 | 160 | //xhrFields: {withCredentials: true},
|
152 | 161 | });
|
153 | 162 |
|
154 | 163 | });
|
155 | 164 | </script>
|
156 | 165 |
|
157 | 166 | <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->
|
158 |
| -<!--[if gte IE 8]><script src="js/cors/jquery.xdr-transport.js"></script><![endif]--> |
| 167 | +<!--[if gte IE 8]> |
| 168 | +<script src="{% get_static_prefix %}jquery_uploader/js/cors/jquery.xdr-transport.js"></script> |
| 169 | +<![endif]--> |
0 commit comments