form_fileupload.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <div class="hbox hbox-auto-xs hbox-auto-sm" ng-controller="FileUploadCtrl" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">
  2. <div class="col w-lg bg-light b-r bg-auto">
  3. <div class="wrapper-md dker b-b">
  4. <h3 class="m-n font-thin">Select files</h3>
  5. </div>
  6. <div class="wrapper-md">
  7. <div ng-show="uploader.isHTML5" class="m-b-md">
  8. <!-- 3. nv-file-over uploader="link" over-class="className" -->
  9. <div class="b-a b-2x b-dashed wrapper-lg bg-white text-center m-b" nv-file-over="" over-class="b-info" uploader="uploader">
  10. Base drop zone
  11. </div>
  12. <!-- Example: nv-file-drop="" uploader="{Object}" options="{Object}" filters="{String}" -->
  13. <div nv-file-drop="" uploader="uploader" options="{ url: '/foo' }">
  14. <div nv-file-over="" uploader="uploader" over-class="b-danger" class="b-a b-2x b-dashed wrapper-lg lter text-center">
  15. Another drop zone with its own settings
  16. </div>
  17. </div>
  18. </div>
  19. <!-- Example: nv-file-select="" uploader="{Object}" options="{Object}" filters="{String}" -->
  20. <p>Multiple</p>
  21. <input type="file" nv-file-select="" uploader="uploader" multiple />
  22. <p class="m-t-md">Single</p>
  23. <input type="file" nv-file-select="" uploader="uploader" />
  24. </div>
  25. </div>
  26. <div class="col">
  27. <div class="wrapper-md bg-light dk b-b">
  28. <span class="pull-right m-t-xs">Queue length: <b class="badge bg-info">{{ uploader.queue.length }}</b></span>
  29. <h3 class="m-n font-thin">Upload queue</h3>
  30. </div>
  31. <div class="wrapper-md">
  32. <table class="table bg-white-only b-a">
  33. <thead>
  34. <tr>
  35. <th width="50%">Name</th>
  36. <th ng-show="uploader.isHTML5">Size</th>
  37. <th ng-show="uploader.isHTML5">Progress</th>
  38. <th>Status</th>
  39. <th>Actions</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. <tr ng-repeat="item in uploader.queue">
  44. <td><strong>{{ item.file.name }}</strong></td>
  45. <td ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>
  46. <td ng-show="uploader.isHTML5">
  47. <div class="progress progress-sm m-b-none m-t-xs">
  48. <div class="progress-bar bg-info" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
  49. </div>
  50. </td>
  51. <td class="text-center">
  52. <span ng-show="item.isSuccess" class="text-success"><i class="glyphicon glyphicon-ok"></i></span>
  53. <span ng-show="item.isCancel" class="text-warning"><i class="glyphicon glyphicon-ban-circle"></i></span>
  54. <span ng-show="item.isError" class="text-danger"><i class="glyphicon glyphicon-remove"></i></span>
  55. </td>
  56. <td nowrap>
  57. <button type="button" class="btn btn-default btn-xs" ng-click="item.upload()" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
  58. Upload
  59. </button>
  60. <button type="button" class="btn btn-default btn-xs" ng-click="item.cancel()" ng-disabled="!item.isUploading">
  61. Cancel
  62. </button>
  63. <button type="button" class="btn btn-default btn-xs" ng-click="item.remove()">
  64. Remove
  65. </button>
  66. </td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. <div>
  71. <div>
  72. <p>Queue progress:</p>
  73. <div class="progress bg-light dker" style="">
  74. <div class="progress-bar progress-bar-striped bg-info" role="progressbar" ng-style="{ 'width': uploader.progress + '%' }"></div>
  75. </div>
  76. </div>
  77. <button type="button" class="btn btn-addon btn-success" ng-click="uploader.uploadAll()" ng-disabled="!uploader.getNotUploadedItems().length">
  78. <i class="fa fa-arrow-circle-o-up"></i> Upload all
  79. </button>
  80. <button type="button" class="btn btn-addon btn-warning" ng-click="uploader.cancelAll()" ng-disabled="!uploader.isUploading">
  81. <i class="fa fa-ban"></i> Cancel all
  82. </button>
  83. <button type="button" class="btn btn-addon btn-danger" ng-click="uploader.clearQueue()" ng-disabled="!uploader.queue.length">
  84. <i class="fa fa-trash-o"></i> Remove all
  85. </button>
  86. <p class="text-muted m-t-xl">Note: upload.php file included, files will be uploaded to "src/js/controllers/uploads".</p>
  87. </div>
  88. </div>
  89. </div>
  90. </div>