|
51 | 51 | };
|
52 | 52 | </script>
|
53 | 53 |
|
54 |
| -<!-- The template to display files available for upload --> |
55 |
| -<script id="template-upload" type="text/x-tmpl"> |
56 |
| - {% for (var i=0, file; file=o.files[i]; i++) { %} |
57 |
| - <tr class="template-upload fade"> |
58 |
| - <td class="preview"><span class="fade"></span></td> |
59 |
| - <td class="name"><span>{%=file.name%}</span></td> |
60 |
| - <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td> |
61 |
| - {% if (file.error) { %} |
62 |
| - <td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td> |
63 |
| - {% } else if (o.files.valid && !i) { %} |
64 |
| - <td> |
65 |
| - <div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div> |
66 |
| - </td> |
67 |
| - <td class="start">{% if (!o.options.autoUpload) { %} |
68 |
| - <button class="btn btn-primary"> |
69 |
| - <i class="icon-upload icon-white"></i> |
70 |
| - <span>{%=locale.fileupload.start%}</span> |
71 |
| - </button> |
72 |
| - {% } %}</td> |
73 |
| - {% } else { %} |
74 |
| - <td colspan="2"></td> |
75 |
| - {% } %} |
76 |
| - <td class="cancel">{% if (!i) { %} |
77 |
| - <button class="btn btn-warning"> |
78 |
| - <i class="icon-ban-circle icon-white"></i> |
79 |
| - <span>{%=locale.fileupload.cancel%}</span> |
80 |
| - </button> |
81 |
| - {% } %}</td> |
82 |
| - </tr> |
83 |
| - {% } %} |
84 |
| -</script> |
85 |
| -<!-- The template to display files available for download --> |
86 |
| -<script id="template-download" type="text/x-tmpl"> |
87 |
| - {% for (var i=0, file; file=o.files[i]; i++) { %} |
88 |
| - <tr class="template-download fade"> |
89 |
| - {% if (file.error) { %} |
90 |
| - <td></td> |
91 |
| - <td class="name"><span>{%=file.name%}</span></td> |
92 |
| - <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td> |
93 |
| - <td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td> |
94 |
| - {% } else { %} |
95 |
| - <td class="preview">{% if (file.thumbnail_url) { %} |
96 |
| - <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a> |
97 |
| - {% } %}</td> |
98 |
| - <td class="name"> |
99 |
| - <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a> |
100 |
| - </td> |
101 |
| - <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td> |
102 |
| - <td colspan="2"></td> |
103 |
| - {% } %} |
104 |
| - <td class="delete"> |
105 |
| - <button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"> |
106 |
| - <i class="icon-trash icon-white"></i> |
107 |
| - <span>{%=locale.fileupload.destroy%}</span> |
108 |
| - </button> |
109 |
| - <input type="checkbox" name="delete" value="1"> |
110 |
| - </td> |
111 |
| - </tr> |
112 |
| - {% } %} |
113 |
| -</script> |
| 54 | +<%== render "upload_template" %> |
| 55 | +<%== render "download_template" %> |
114 | 56 |
|
115 | 57 | <script type="text/javascript" charset="utf-8">
|
116 | 58 | $(function () {
|
|
0 commit comments