1 <script id="file-upload-tmpl" type="text/html">
2 <form id="fileupload" action="../server/php/" method="POST" enctype="multipart/form-data">
3 <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
4 <div class="row fileupload-buttonbar">
6 <!-- The fileinput-button span is used to style the file input field as button -->
7 <span class="btn btn-success fileinput-button">
8 <i class="icon-plus icon-white"></i>
9 <span>Add files...</span>
10 <input type="file" name="files[]" multiple>
12 <button type="submit" class="btn btn-primary start">
13 <i class="icon-upload icon-white"></i>
14 <span>Start upload</span>
16 <button type="reset" class="btn btn-warning cancel">
17 <i class="icon-ban-circle icon-white"></i>
18 <span>Cancel upload</span>
20 <button type="button" class="btn btn-danger delete">
21 <i class="icon-trash icon-white"></i>
24 <input type="checkbox" class="toggle">
27 <!-- The global progress bar -->
28 <div class="progress progress-success progress-striped active">
29 <div class="bar" style="width:0%;"></div>
33 <!-- The loading indicator is shown during image processing -->
34 <div class="fileupload-loading"></div>
36 <!-- The table listing the files available for upload/download -->
37 <table class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
43 <script id="template-upload" type="text/x-tmpl">
44 {% for (var i=0, file; file=o.files[i]; i++) { %}
45 <tr class="template-upload">
46 <td class="preview"><span class=""></span></td>
47 <td class="name"><span>{%=file.name%}</span></td>
48 <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
49 {% if (file.error) { %}
50 <td class="error" colspan="2"><span class="label label-important">{%=$.i18n.prop('locale.fileupload.error')%}</span> {%=$.i18n.prop('locale.fileupload.errors',[file.error]) || file.error%}</td>
51 {% } else if (o.files.valid && !i) { %}
53 <div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
55 <td class="start">{% if (!o.options.autoUpload) { %}
56 <button class="btn btn-primary">
57 <i class="icon-upload icon-white"></i>
58 <span>{%=$.i18n.prop('locale.fileupload.start')%}</span>
64 <td class="cancel">{% if (!i) { %}
65 <button class="btn btn-warning">
66 <i class="icon-ban-circle icon-white"></i>
67 <span>{%=$.i18n.prop('locale.fileupload.cancel')%}</span>
73 <!-- The template to display files available for download -->
74 <script id="template-download" type="text/x-tmpl">
75 {% for (var i=0, file; file=o.files[i]; i++) { %}
76 <tr class="template-download">
77 {% if (file.error) { %}
79 <td class="name"><span>{%=file.name%}</span></td>
80 <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
81 <td class="error" colspan="2"><span class="label label-important">{%=$.i18n.prop('locale.fileupload.error')%}</span> {%=$.i18n.prop('locale.fileupload.errors',[file.error]) || file.error%}</td>
83 <td class="preview">{% if (file.thumbnail_url) { %}
84 <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
87 <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
89 <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
93 <button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
94 <i class="icon-trash icon-white"></i>
95 <span>{%=$.i18n.prop('locale.fileupload.destroy')%}</span>
97 <input type="checkbox" name="delete" value="1">