upload.view 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @Init{
  2. $this->RegisterCSSFile("gallery.css");
  3. $this->RegisterJSFile("controllers/galleryUpload.js");
  4. $this->RegisterJSFile("directives/dragDrop.js");
  5. $this->RegisterJSFile("directives/contextMenu.js");
  6. }@
  7. @Title{Gallery}@
  8. @ButtonsRight{
  9. <?php if (Session::GetLoggedInUser()->HasAccess("gallery/manage")){?>
  10. <button onclick="Navigate('/gallery/manage/')" title="Manage">
  11. <img src="/images/gallery.svg" alt="Manage" />
  12. </button>
  13. <?php } ?>
  14. }@
  15. @Body{
  16. <div ng-controller="galleryUpload" id="galleryUpload">
  17. <div drag-drop="fileDrop" class="dragDrop" ng-class="{dragOver:images.length===0}">
  18. <context-menu actions="contextMenuActions"></context-menu>
  19. <div ng-repeat="image in images" class="newImage">
  20. <table class="information">
  21. <tr>
  22. <td>File name:</td>
  23. <td>{{image.file.name}}</td>
  24. </tr>
  25. <tr>
  26. <td><label for="imageTitle">Image title:</label></td>
  27. <td><input type="text" name="imageTitle" ng-model="image.title" /></td>
  28. </tr>
  29. <tr>
  30. <td><label for="imageDesc">Image description</label></td>
  31. <td><textarea name="imageDesc" ng-model="image.description"></textarea></td>
  32. </tr>
  33. </table>
  34. <div class="preview">
  35. <div class="imageContainer">
  36. <img ng-src="{{image.preview}}" />
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="percentageBar"><div style="width:{{(getTotalImageSize() / safeUploadSize()) * 100}}%"></div></div>
  42. <button class="upload" ng-if="images.length>0" ng-click="upload()">Upload</button>
  43. <scope-init value="maxUploadSize"><?=$maxUploadSize?></scope-init>
  44. </div>
  45. }@