|
21 | 21 | ({{t 'general.version'}}: {{this.viewedVersion}}) |
22 | 22 | {{/if}} |
23 | 23 | </h2> |
24 | | - <FileActionsMenu @item={{this.model.fileModel}} /> |
| 24 | + <FileActionsMenu @item={{this.model}} @onDelete={{this.onDelete}} @allowRename={{false}} /> |
25 | 25 | </div> |
26 | 26 | </:header> |
27 | 27 | <:body> |
|
33 | 33 | </div> |
34 | 34 | </:body> |
35 | 35 | <:right> |
36 | | - {{#if this.revisionsOpened}} |
37 | | - <section data-test-revisions-tab local-class='FileDetail__revisions'> |
38 | | - <h2 local-class='FileDetail__right-section-heading'>{{t 'general.revisions'}}</h2> |
39 | | - <ol local-class='FileDetail__revision-list' reversed> |
40 | | - <hr> |
41 | | - {{#if this.model.getRevisions.isRunning}} |
42 | | - <LoadingIndicator @dark={{true}} /> |
43 | | - {{else}} |
44 | | - {{#each this.model.waterButlerRevisions as |version|}} |
45 | | - <FileVersion |
46 | | - @version={{version}} |
47 | | - @downloadUrl={{this.model.links.download}} |
48 | | - @changeVersion={{this.changeVersion}} |
49 | | - /> |
50 | | - <hr> |
| 36 | + {{#if (or this.model.shouldShowTags this.model.shouldShowRevisions) }} |
| 37 | + {{#if this.revisionsOpened}} |
| 38 | + <section data-test-revisions-tab local-class='FileDetail__revisions'> |
| 39 | + <h2 local-class='FileDetail__right-section-heading'>{{t 'general.revisions'}}</h2> |
| 40 | + <ol local-class='FileDetail__revision-list' reversed> |
| 41 | + <hr aria-hidden='true'> |
| 42 | + {{#if this.model.getRevisions.isRunning}} |
| 43 | + <LoadingIndicator @dark={{true}} /> |
51 | 44 | {{else}} |
52 | | - {{t 'file_detail.no_revisions'}} |
53 | | - {{/each}} |
54 | | - {{/if}} |
55 | | - </ol> |
56 | | - </section> |
57 | | - {{/if}} |
58 | | - {{#if this.tagsOpened}} |
59 | | - <div local-class='RightContainer'> |
60 | | - <h2>{{t 'general.tags'}}</h2> |
61 | | - <TagsWidget |
62 | | - @taggable={{this.model.fileModel}} |
63 | | - @readOnly={{not this.model.userCanEditMetadata}} |
64 | | - @inline={{true}} |
65 | | - /> |
66 | | - </div> |
| 45 | + {{#each this.model.waterButlerRevisions as |version|}} |
| 46 | + <FileVersion |
| 47 | + @version={{version}} |
| 48 | + @downloadUrl={{this.model.links.download}} |
| 49 | + @changeVersion={{this.changeVersion}} |
| 50 | + /> |
| 51 | + <hr aria-hidden='true'> |
| 52 | + {{else}} |
| 53 | + {{t 'file_detail.no_revisions'}} |
| 54 | + {{/each}} |
| 55 | + {{/if}} |
| 56 | + </ol> |
| 57 | + </section> |
| 58 | + {{/if}} |
| 59 | + {{#if this.tagsOpened}} |
| 60 | + <div local-class='RightContainer'> |
| 61 | + <h2>{{t 'general.tags'}}</h2> |
| 62 | + <TagsWidget |
| 63 | + @taggable={{this.model.fileModel}} |
| 64 | + @readOnly={{not this.model.userCanEditMetadata}} |
| 65 | + @inline={{true}} |
| 66 | + /> |
| 67 | + </div> |
| 68 | + {{/if}} |
67 | 69 | {{/if}} |
68 | 70 | </:right> |
69 | 71 | <:rightButtons> |
70 | | - {{#if this.media.isMobile}} |
71 | | - <BsButton |
72 | | - data-test-file-renderer-button |
73 | | - data-analytics-name='File renderer button' |
74 | | - local-class='SlideButtons {{if this.rightColumnClosed 'Active'}}' |
75 | | - @size='lg' |
76 | | - @onClick={{this.toggleFileRenderer}} |
77 | | - > |
78 | | - <FaIcon @icon='file-alt' @fixedWidth={{true}}/> |
79 | | - </BsButton> |
| 72 | + {{#if (or this.model.shouldShowTags this.model.shouldShowRevisions) }} |
| 73 | + {{#if this.media.isMobile}} |
| 74 | + <BsButton |
| 75 | + data-test-file-renderer-button |
| 76 | + data-analytics-name='File renderer button' |
| 77 | + local-class='SlideButtons {{if this.rightColumnClosed 'Active'}}' |
| 78 | + @size='lg' |
| 79 | + @onClick={{this.toggleFileRenderer}} |
| 80 | + > |
| 81 | + <FaIcon @icon='file-alt' @fixedWidth={{true}}/> |
| 82 | + </BsButton> |
| 83 | + {{/if}} |
| 84 | + {{#if this.model.shouldShowRevisions}} |
| 85 | + <BsButton |
| 86 | + aria-label={{if this.revisionsOpened (t 'file_detail.close_revisions') (t 'file_detail.view_revisions')}} |
| 87 | + data-test-versions-button |
| 88 | + data-analytics-name='Versions button' |
| 89 | + local-class='SlideButtons {{if this.revisionsOpened 'Active'}}' |
| 90 | + @size='lg' |
| 91 | + @onClick={{this.toggleRevisions}} |
| 92 | + > |
| 93 | + <FaIcon @icon='history' @fixedWidth={{true}}/> |
| 94 | + </BsButton> |
| 95 | + {{/if}} |
| 96 | + {{#if this.model.shouldShowTags}} |
| 97 | + <BsButton |
| 98 | + aria-label={{if this.tagsOpened (t 'file_detail.close_tags') (t 'file_detail.view_tags')}} |
| 99 | + data-test-tags-button |
| 100 | + data-analytics-name='Tags button' |
| 101 | + local-class='SlideButtons {{if this.tagsOpened 'Active'}}' |
| 102 | + @size='lg' |
| 103 | + @onClick={{this.toggleTags}} |
| 104 | + > |
| 105 | + <FaIcon @icon='tags' @fixedWidth={{true}}/> |
| 106 | + </BsButton> |
| 107 | + {{/if}} |
80 | 108 | {{/if}} |
81 | | - <BsButton |
82 | | - aria-label={{if this.revisionsOpened (t 'file_detail.close_revisions') (t 'file_detail.view_revisions')}} |
83 | | - data-test-versions-button |
84 | | - data-analytics-name='Versions button' |
85 | | - local-class='SlideButtons {{if this.revisionsOpened 'Active'}}' |
86 | | - @size='lg' |
87 | | - @onClick={{this.toggleRevisions}} |
88 | | - > |
89 | | - <FaIcon @icon='history' @fixedWidth={{true}}/> |
90 | | - </BsButton> |
91 | | - <BsButton |
92 | | - aria-label={{if this.tagsOpened (t 'file_detail.close_tags') (t 'file_detail.view_tags')}} |
93 | | - data-test-tags-button |
94 | | - data-analytics-name='Tags button' |
95 | | - local-class='SlideButtons {{if this.tagsOpened 'Active'}}' |
96 | | - @size='lg' |
97 | | - @onClick={{this.toggleTags}} |
98 | | - > |
99 | | - <FaIcon @icon='tags' @fixedWidth={{true}}/> |
100 | | - </BsButton> |
101 | 109 | </:rightButtons> |
102 | 110 | </GuidFile::-Components::FileDetailLayout> |
0 commit comments