form_file_upload.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!-- start: PAGE TITLE -->
  2. <section id="page-title">
  3. <div class="row">
  4. <div class="col-sm-8">
  5. <h1 class="mainTitle" translate="sidebar.nav.forms.UPLOAD">{{ mainTitle }}</h1>
  6. <span class="mainDescription">Angular File Upload supports drag-n-drop upload, upload progress, validation filters and a file upload queue.</span>
  7. </div>
  8. <div ncy-breadcrumb></div>
  9. </div>
  10. </section>
  11. <!-- end: PAGE TITLE -->
  12. <!-- start: UPLOADS ONLY IMAGES -->
  13. <div class="container-fluid container-fullw bg-white">
  14. <div class="row">
  15. <div class="col-md-12">
  16. <h5 class="over-title margin-bottom-15">Uploads <span class="text-bold">only images</span></h5>
  17. <p>
  18. with canvas preview
  19. </p>
  20. <!-- /// controller: 'UploadCtrl' - localtion: assets/js/controllers/uploadCtrl.js /// -->
  21. <div ng-controller="UploadCtrl" nv-file-drop="" uploader="uploaderImages">
  22. <div class="row">
  23. <div class="col-md-3">
  24. <h5>Select files</h5>
  25. <div class="panel panel-white">
  26. <div class="panel-body">
  27. <div ng-show="uploaderImages.isHTML5">
  28. <!-- 3. nv-file-over uploader="link" over-class="className" -->
  29. <div class="well my-drop-zone" nv-file-over="" uploader="uploaderImages">
  30. Base drop zone
  31. </div>
  32. <!-- Example: nv-file-drop="" uploader="{Object}" options="{Object}" filters="{String}" -->
  33. <div nv-file-drop="" uploader="uploaderImages" options="{ url: '/foo' }">
  34. <div nv-file-over="" uploader="uploaderImages" over-class="another-file-over-class" class="well my-drop-zone">
  35. Another drop zone with its own settings
  36. </div>
  37. </div>
  38. </div>
  39. <!-- Example: nv-file-select="" uploader="{Object}" options="{Object}" filters="{String}" -->
  40. <span class="btn btn-primary btn-o btn-file"> Select an image file
  41. <input type="file" nv-file-select="" uploader="uploaderImages" multiple />
  42. </span>
  43. <br/>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="col-md-9 file-upload" style="margin-bottom: 40px">
  48. <h4>The queue</h4>
  49. <p>
  50. Queue length: {{ uploaderImages.queue.length }}
  51. </p>
  52. <div class="table-responsive">
  53. <table class="table">
  54. <thead>
  55. <tr>
  56. <th width="50%">Name</th>
  57. <th ng-show="uploaderImages.isHTML5">Size</th>
  58. <th ng-show="uploaderImages.isHTML5">Progress</th>
  59. <th>Status</th>
  60. <th>Actions</th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <tr ng-repeat="item in uploaderImages.queue">
  65. <td><strong>{{ item.file.name }}</strong>
  66. <!-- Image preview -->
  67. <!--auto height-->
  68. <!--<div ng-thumb="{ file: item.file, width: 100 }"></div>-->
  69. <!--auto width-->
  70. <div ng-show="uploaderImages.isHTML5" ng-thumb="{ file: item._file, height: 100 }"></div>
  71. <!--fixed width and height -->
  72. <!--<div ng-thumb="{ file: item.file, width: 100, height: 100 }"></div>-->
  73. </td>
  74. <td ng-show="uploaderImages.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>
  75. <td ng-show="uploaderImages.isHTML5">
  76. <div class="progress progress-xs margin-bottom-0">
  77. <div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
  78. </div></td>
  79. <td class="text-center"><span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span><span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span><span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span></td>
  80. <td nowrap>
  81. <button type="button" class="btn btn-primary btn-xs" ng-click="item.upload()" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
  82. <span class="glyphicon glyphicon-upload"></span> Upload
  83. </button>
  84. <button type="button" class="btn btn-warning btn-xs" ng-click="item.cancel()" ng-disabled="!item.isUploading">
  85. <span class="glyphicon glyphicon-ban-circle"></span> Cancel
  86. </button>
  87. <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
  88. <span class="glyphicon glyphicon-trash"></span> Remove
  89. </button></td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. </div>
  94. <div>
  95. <div>
  96. Queue progress:
  97. <div class="progress progress-xs margin-top-5 margin-bottom-20">
  98. <div class="progress-bar" role="progressbar" ng-style="{ 'width': uploaderImages.progress + '%' }"></div>
  99. </div>
  100. </div>
  101. <button type="button" class="btn btn-primary btn-s" ng-click="uploaderImages.uploadAll()" ng-disabled="!uploaderImages.getNotUploadedItems().length">
  102. <span class="glyphicon glyphicon-upload"></span> Upload all
  103. </button>
  104. <button type="button" class="btn btn-primary btn-o btn-s" ng-click="uploaderImages.cancelAll()" ng-disabled="!uploaderImages.isUploading">
  105. <span class="glyphicon glyphicon-ban-circle"></span> Cancel all
  106. </button>
  107. <button type="button" class="btn btn-primary btn-o btn-s" ng-click="uploaderImages.clearQueue()" ng-disabled="!uploaderImages.queue.length">
  108. <span class="glyphicon glyphicon-trash"></span> Remove all
  109. </button>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <!-- end: UPLOADS ONLY IMAGES -->
  118. <!-- start: UPLOADS ALL FILES -->
  119. <div class="container-fluid container-fullw">
  120. <div class="row">
  121. <div class="col-md-12">
  122. <h5 class="over-title margin-bottom-15">Uploads <span class="text-bold">all files</span></h5>
  123. <p>
  124. without canvas preview
  125. </p>
  126. <!-- /// controller: 'UploadCtrl2' - localtion: assets/js/controllers/uploadCtrl.js /// -->
  127. <div ng-controller="UploadCtrl2" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">
  128. <div class="row">
  129. <div class="col-md-3">
  130. <h5>Select files</h5>
  131. <div class="panel panel-white">
  132. <div class="panel-body">
  133. <div ng-show="uploader.isHTML5">
  134. <!-- 3. nv-file-over uploader="link" over-class="className" -->
  135. <div class="well my-drop-zone" nv-file-over="" uploader="uploader">
  136. Base drop zone
  137. </div>
  138. <!-- Example: nv-file-drop="" uploader="{Object}" options="{Object}" filters="{String}" -->
  139. <div nv-file-drop="" uploader="uploader" options="{ url: '/foo' }">
  140. <div nv-file-over="" uploader="uploader" over-class="another-file-over-class" class="well my-drop-zone">
  141. Another drop zone with its own settings
  142. </div>
  143. </div>
  144. </div>
  145. <!-- Example: nv-file-select="" uploader="{Object}" options="{Object}" filters="{String}" -->
  146. <span class="btn btn-primary btn-o btn-file margin-bottom-15"> Select multiple files
  147. <input type="file" nv-file-select="" uploader="uploader" multiple />
  148. </span>
  149. <br/>
  150. <span class="btn btn-primary btn-o btn-file"> Select single file
  151. <input type="file" nv-file-select="" uploader="uploader" />
  152. </span>
  153. </div>
  154. </div>
  155. </div>
  156. <div class="col-md-9" style="margin-bottom: 40px">
  157. <h4>Upload queue</h4>
  158. <div class="panel panel-transparent">
  159. <div class="panel-body">
  160. <p>
  161. Queue length: {{ uploader.queue.length }}
  162. </p>
  163. <div class="table-responsive">
  164. <table class="table">
  165. <thead>
  166. <tr>
  167. <th width="50%">Name</th>
  168. <th ng-show="uploader.isHTML5">Size</th>
  169. <th ng-show="uploader.isHTML5">Progress</th>
  170. <th>Status</th>
  171. <th>Actions</th>
  172. </tr>
  173. </thead>
  174. <tbody>
  175. <tr ng-repeat="item in uploader.queue">
  176. <td><strong>{{ item.file.name }}</strong></td>
  177. <td ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>
  178. <td ng-show="uploader.isHTML5">
  179. <div class="progress progress-xs margin-bottom-0">
  180. <div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
  181. </div></td>
  182. <td class="text-center"><span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span><span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span><span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span></td>
  183. <td nowrap>
  184. <button type="button" class="btn btn-success btn-xs" ng-click="item.upload()" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
  185. <span class="glyphicon glyphicon-upload"></span> Upload
  186. </button>
  187. <button type="button" class="btn btn-warning btn-xs" ng-click="item.cancel()" ng-disabled="!item.isUploading">
  188. <span class="glyphicon glyphicon-ban-circle"></span> Cancel
  189. </button>
  190. <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()">
  191. <span class="glyphicon glyphicon-trash"></span> Remove
  192. </button></td>
  193. </tr>
  194. </tbody>
  195. </table>
  196. </div>
  197. <div>
  198. <div>
  199. Queue progress:
  200. <div class="progress progress-xs margin-top-5 margin-bottom-20">
  201. <div class="progress-bar" role="progressbar" ng-style="{ 'width': uploader.progress + '%' }"></div>
  202. </div>
  203. </div>
  204. <button type="button" class="btn btn-primary btn-s" ng-click="uploader.uploadAll()" ng-disabled="!uploader.getNotUploadedItems().length">
  205. <span class="glyphicon glyphicon-upload"></span> Upload all
  206. </button>
  207. <button type="button" class="btn btn-primary btn-o btn-s" ng-click="uploader.cancelAll()" ng-disabled="!uploader.isUploading">
  208. <span class="glyphicon glyphicon-ban-circle"></span> Cancel all
  209. </button>
  210. <button type="button" class="btn btn-primary btn-o btn-s" ng-click="uploader.clearQueue()" ng-disabled="!uploader.queue.length">
  211. <span class="glyphicon glyphicon-trash"></span> Remove all
  212. </button>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. <!-- end: UPLOADS ALL FILES -->