This repository was archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpublication-menu.hbs
100 lines (100 loc) · 2.63 KB
/
publication-menu.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<div
role="menubar"
class="publish-menu {{this.publicationStatus}}"
data-test-session-publication-menu
{{on-click-outside (set this.isOpen false)}}
>
<button
aria-label={{this.title}}
role="menuitem"
class="toggle"
aria-haspopup="true"
aria-expanded={{if this.isOpen "true" "false"}}
data-test-toggle
{{on "click" (toggle "isOpen" this)}}
{{on "keydown" (fn this.toggleMenu)}}
>
<FaIcon @icon={{this.icon}} />
<span>
{{this.title}}
</span>
</button>
{{#if this.isOpen}}
<div
class="menu"
role="menu"
{{ref this "menuElement"}}
{{did-insert this.focusOnFirstItem}}
data-test-menu
>
{{#if this.showAsIs}}
<button
class="danger"
role="menuitemradio"
tabindex="-1"
{{on "click" this.publish}}
{{on "keydown" (fn this.moveFocus)}}
{{on "mouseenter" (fn this.clearFocus)}}
data-test-publish-as-is
>
{{t "general.publishAsIs"}}
</button>
{{/if}}
{{#if this.showPublish}}
<button
class="good"
role="menuitemradio"
tabindex="-1"
{{on "click" this.publish}}
{{on "keydown" (fn this.moveFocus)}}
{{on "mouseenter" (fn this.clearFocus)}}
data-test-publish
>
{{t "general.publishSession"}}
</button>
{{/if}}
{{#if this.showReview}}
<button
class="good"
role="menuitemradio"
tabindex="-1"
{{on "click" this.scrollToSessionPublication}}
{{on "keydown" (fn this.moveFocus)}}
{{on "mouseenter" (fn this.clearFocus)}}
data-test-review
>
{{t
"general.reviewMissingItems"
count=(get @session "allPublicationIssuesLength")
}}
</button>
{{/if}}
{{#if this.showTbd}}
<button
class="good"
role="menuitemradio"
tabindex="-1"
{{on "click" this.publishAsTbd}}
{{on "keydown" (fn this.moveFocus)}}
{{on "mouseenter" (fn this.clearFocus)}}
data-test-tbd
>
{{t "general.markAsScheduled"}}
</button>
{{/if}}
{{#if this.showUnPublish}}
<button
class="danger"
role="menuitemradio"
tabindex="-1"
{{on "click" this.unpublish}}
{{on "keydown" (fn this.moveFocus)}}
{{on "mouseenter" (fn this.clearFocus)}}
data-test-un-publish
>
{{t "general.unPublishSession"}}
</button>
{{/if}}
</div>
{{/if}}
</div>