fileTreeV2.pug 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. aside.editor-sidebar.full-size(
  2. ng-controller="HistoryV2FileTreeController"
  3. ng-if="ui.view == 'history' && history.isV2"
  4. )
  5. .history-file-tree-inner
  6. history-file-tree(
  7. files="history.selection.files"
  8. selected-pathname="history.selection.pathname"
  9. on-selected-file-change="handleFileSelection(file)"
  10. is-loading="history.loadingFileTree"
  11. )
  12. script(type="text/ng-template", id="historyFileTreeTpl")
  13. .history-file-tree
  14. history-file-entity(
  15. ng-repeat="fileEntity in $ctrl._fileTree | orderBy : [ '-type', 'operation', 'name' ]"
  16. file-entity="fileEntity"
  17. ng-show="!$ctrl.isLoading"
  18. )
  19. script(type="text/ng-template", id="historyFileEntityTpl")
  20. .history-file-entity-wrapper
  21. a.history-file-entity-link(
  22. href
  23. ng-click="$ctrl.isSelected ? '' : $ctrl.handleClick()"
  24. ng-class="{ 'history-file-entity-link-selected': $ctrl.isSelected }"
  25. )
  26. span.history-file-entity-name-container
  27. i.history-file-entity-icon.history-file-entity-icon-folder-state.fa.fa-fw(
  28. ng-class="{\
  29. 'fa-chevron-down': ($ctrl.fileEntity.type === 'folder' && $ctrl.isOpen),\
  30. 'fa-chevron-right': ($ctrl.fileEntity.type === 'folder' && !$ctrl.isOpen)\
  31. }"
  32. )
  33. i.history-file-entity-icon.fa(
  34. ng-class="::$ctrl.entityTypeIconClass"
  35. )
  36. span.history-file-entity-name(
  37. ng-class="::$ctrl.entityOpTextClass"
  38. ) {{ ::$ctrl.fileEntity.name }}
  39. span.history-file-entity-operation-badge(
  40. ng-if="::$ctrl.hasOperation && $ctrl.fileEntity.operation !== 'renamed' && $ctrl.fileEntity.operation !== 'removed'"
  41. ) {{ ::$ctrl.getFileOperationName() }}
  42. span.history-file-entity-operation-badge(
  43. ng-if="::$ctrl.hasOperation && $ctrl.fileEntity.operation === 'renamed'"
  44. tooltip-append-to-body="true"
  45. tooltip-placement="right"
  46. tooltip-class="tooltip-history-file-tree"
  47. tooltip-html=`::$ctrl.getRenameTooltip()`
  48. ) {{ ::$ctrl.getFileOperationName() }}
  49. div(
  50. ng-show="$ctrl.isOpen"
  51. )
  52. history-file-entity(
  53. ng-repeat="childEntity in $ctrl.fileEntity.children"
  54. file-entity="childEntity"
  55. )