]> source.dussan.org Git - archiva.git/blob
ec1d55c0ba97d0d2faba1e77363d194a2bf0627d
[archiva.git] /
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">
5         <div class="span7">
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>
11             </span>
12             <button type="submit" class="btn btn-primary start">
13                 <i class="icon-upload icon-white"></i>
14                 <span>Start upload</span>
15             </button>
16             <button type="reset" class="btn btn-warning cancel">
17                 <i class="icon-ban-circle icon-white"></i>
18                 <span>Cancel upload</span>
19             </button>
20             <button type="button" class="btn btn-danger delete">
21                 <i class="icon-trash icon-white"></i>
22                 <span>Delete</span>
23             </button>
24             <input type="checkbox" class="toggle">
25         </div>
26         <div class="span5">
27             <!-- The global progress bar -->
28             <div class="progress progress-success progress-striped active">
29                 <div class="bar" style="width:0%;"></div>
30             </div>
31         </div>
32     </div>
33     <!-- The loading indicator is shown during image processing -->
34     <div class="fileupload-loading"></div>
35     <br>
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>
38 </form>
39
40 </script>
41
42
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) { %}
52             <td>
53                 <div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
54             </td>
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>
59                 </button>
60             {% } %}</td>
61         {% } else { %}
62             <td colspan="2"></td>
63         {% } %}
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>
68             </button>
69         {% } %}</td>
70     </tr>
71 {% } %}
72 </script>
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) { %}
78             <td></td>
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>
82         {% } else { %}
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>
85             {% } %}</td>
86             <td class="name">
87                 <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
88             </td>
89             <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
90             <td colspan="2"></td>
91         {% } %}
92         <td class="delete">
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>
96             </button>
97             <input type="checkbox" name="delete" value="1">
98         </td>
99     </tr>
100 {% } %}
101 </script>