toolbarV2.pug 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .history-toolbar(
  2. ng-controller="HistoryV2ToolbarController"
  3. ng-if="ui.view == 'history' && history.isV2 && history.viewMode === HistoryViewModes.POINT_IN_TIME"
  4. )
  5. span.history-toolbar-selected-version(ng-show="history.loadingFileTree")
  6. i.fa.fa-spin.fa-refresh
  7. |    #{translate("loading")}...
  8. span.history-toolbar-selected-version(
  9. ng-show="!history.loadingFileTree && !history.showOnlyLabels && history.selection.updates.length && !history.error"
  10. ) #{translate("browsing_project_as_of")} 
  11. time.history-toolbar-time {{ history.selection.updates[0].meta.end_ts | formatDate:'Do MMM YYYY, h:mm a' }}
  12. span.history-toolbar-selected-version(
  13. ng-show="!history.loadingFileTree && history.showOnlyLabels && history.selection.label && !history.error"
  14. ) #{translate("browsing_project_labelled")} 
  15. span.history-toolbar-selected-label "{{ history.selection.label.comment }}"
  16. div.history-toolbar-actions(
  17. ng-if="!history.error"
  18. )
  19. button.history-toolbar-btn(
  20. ng-click="showAddLabelDialog();"
  21. ng-if="!history.showOnlyLabels"
  22. ng-disabled="history.loadingFileTree || history.selection.updates.length == 0"
  23. )
  24. i.fa.fa-tag
  25. |  #{translate("history_label_this_version")}
  26. button.history-toolbar-btn(
  27. ng-click="toggleHistoryViewMode();"
  28. ng-disabled="history.loadingFileTree || history.selection.updates.length == 0"
  29. )
  30. i.fa.fa-exchange
  31. |  #{translate("compare_to_another_version")}
  32. button.history-toolbar-btn-danger.pull-right(
  33. tooltip-html="'<p>This feature is still in progress. Please use copy and paste to restore your files.</p><p>More restore options are coming soon.</p>'"
  34. tooltip-placement="bottom"
  35. )
  36. i.fa.fa-undo
  37. | &nbsp;#{translate("restore_to_before_these_changes")}
  38. .history-toolbar-entries-list(
  39. ng-if="!history.error"
  40. )
  41. toggle-switch(
  42. ng-model="history.showOnlyLabels"
  43. label-true=translate("history_view_labels")
  44. label-false=translate("history_view_all")
  45. description=translate("history_view_a11y_description")
  46. )
  47. script(type="text/ng-template", id="historyV2AddLabelModalTemplate")
  48. form(
  49. name="addLabelModalForm"
  50. ng-submit="addLabelModalFormSubmit();"
  51. novalidate
  52. )
  53. .modal-header
  54. h3 #{translate("history_add_label")}
  55. .modal-body
  56. .alert.alert-danger(ng-show="state.error.message") {{ state.error.message}}
  57. .alert.alert-danger(ng-show="state.error && !state.error.message") #{translate("generic_something_went_wrong")}
  58. .form-group
  59. input.form-control(
  60. type="text"
  61. placeholder=translate("history_new_label_name")
  62. ng-model="inputs.labelName"
  63. focus-on="open"
  64. required
  65. )
  66. p.help-block(ng-if="update")
  67. | #{translate("history_new_label_added_at")}
  68. strong {{ update.meta.end_ts | formatDate:'ddd Do MMM YYYY, h:mm a' }}
  69. .modal-footer
  70. button.btn.btn-default(
  71. type="button"
  72. ng-disabled="state.inflight"
  73. ng-click="$dismiss()"
  74. ) #{translate("cancel")}
  75. input.btn.btn-primary(
  76. ng-disabled="addLabelModalForm.$invalid || state.inflight"
  77. ng-value="state.inflight ? '" + translate("history_adding_label") + "' : '" + translate("history_add_label") + "'"
  78. type="submit"
  79. )