-
Notifications
You must be signed in to change notification settings - Fork 73
/
article_page.hbs
309 lines (288 loc) · 14.2 KB
/
article_page.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<div class="container container-spacing">
<nav class="sub-nav">{{breadcrumbs}}</nav>
<div class="article-container" id="article-container">
{{#if settings.show_articles_in_section}}
<aside class="article-sidebar" aria-labelledby="section-articles-title">
<div class="collapsible-sidebar sidenav">
<button type="button" class="collapsible-sidebar-toggle" aria-labelledby="section-articles-title"
aria-expanded="false">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" focusable="false" viewBox="0 0 12 12"
aria-hidden="true" class="collapsible-sidebar-toggle-icon chevron-icon">
<path fill="none" stroke="currentColor" stroke-linecap="round" d="M3 4.5l2.6 2.6c.2.2.5.2.7 0L9 4.5" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" focusable="false" viewBox="0 0 12 12"
aria-hidden="true" class="collapsible-sidebar-toggle-icon x-icon">
<path stroke="currentColor" stroke-linecap="round" d="M3 9l6-6m0 6L3 3" />
</svg>
</button>
<h3 id="section-articles-title" class="collapsible-sidebar-title sidenav-title">
{{t 'articles_in_section'}}
</h3>
<div class="collapsible-sidebar-body">
<ul>
{{#each section.articles}}
<li>
<a href="{{url}}" class="sidenav-item {{#is id ../article.id}}current-article{{/is}}">{{title}}</a>
</li>
{{/each}}
</ul>
{{#if section.more_articles}}
<a href="{{section.url}}" class="sidenav-item sidenav-item-show-all">{{t 'see_more'}}</a>
{{/if}}
</div>
</div>
</aside>
{{/if}}
<article class="article">
<header class="article-header">
<h1 class="article-title" title="{{article.title}}">
{{article.title}}
{{#if article.internal}}
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" focusable="false" viewBox="0 0 16 16" class="icon-lock"
title="{{t 'internal'}}">
<rect width="12" height="9" x="2" y="7" fill="currentColor" rx="1" ry="1" />
<path fill="none" stroke="currentColor" d="M4.5 7.5V4a3.5 3.5 0 017 0v3.5" />
</svg>
{{/if}}
</h1>
<div class="article-author">
{{#if settings.show_article_author}}
<div class="avatar article-avatar">
{{#if article.author.agent}}
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" focusable="false" viewBox="0 0 12 12"
class="icon-agent">
<path fill="currentColor"
d="M6 0C2.7 0 0 2.7 0 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm2.3 7H3.7c-.3 0-.4-.3-.3-.5C3.9 7.6 4.9 7 6 7s2.1.6 2.6 1.5c.1.2 0 .5-.3.5z" />
</svg>
{{/if}}
<img src="{{article.author.avatar_url}}" alt="" class="user-avatar" />
</div>
{{/if}}
<div class="article-meta">
{{#if settings.show_article_author}}
{{#link 'user_profile' id=article.author.id}}
{{article.author.name}}
{{/link}}
{{/if}}
<div class="article-date">
{{#if article.edited_at}}
Last updated {{date article.edited_at timeago=true}}
{{else}}
Published {{date article.created_at timeago=true}}
{{/if}}
</div>
</div>
</div>
{{#if settings.show_follow_article}}
<div class="article-subscribe">{{subscribe}}</div>
{{/if}}
</header>
<section class="article-info">
<div class="article-content">
<div class="article-body">{{article.body}}</div>
{{#if attachments}}
<div class="article-attachments">
<ul class="attachments">
{{#each attachments}}
<li class="attachment-item">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" focusable="false" viewBox="0 0 16 16" class="attachment-icon">
<path fill="none" stroke="currentColor" stroke-linecap="round" d="M9.5 4v7.7c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5V3C6.5 1.6 7.6.5 9 .5s2.5 1.1 2.5 2.5v9c0 1.9-1.6 3.5-3.5 3.5S4.5 13.9 4.5 12V4" />
</svg>
<a href="{{url}}" target="_blank">{{name}}</a>
</li>
{{/each}}
</ul>
</div>
{{/if}}
</div>
</section>
<footer>
{{#with article}}
<div class="article-votes">
<span class="article-votes-question" id="article-votes-label">{{t 'was_this_article_helpful'}}</span>
<div class="article-votes-controls" role="group" aria-labelledby="article-votes-label">
{{vote 'up' role='radio' class='button article-vote article-vote-up' selected_class="button-primary"}}
{{vote 'down' role='radio' class='button article-vote article-vote-down' selected_class="button-primary"}}
</div>
<small class="article-votes-count">
{{vote 'label' class='article-vote-label'}}
</small>
</div>
{{/with}}
<div class="article-more-questions">
{{request_callout}}
</div>
</footer>
{{#if settings.show_recently_viewed_articles}}
<div class="article-relatives">
{{#if settings.show_recently_viewed_articles}}
{{recent_articles}}
{{/if}}
{{#if settings.show_related_articles}}
{{related_articles}}
{{/if}}
</div>
{{/if}}
{{#if settings.show_article_comments}}
<div class="article-comments" id="article-comments">
<section class="comments">
<header class="comment-overview">
<h2 class="comment-heading">
{{t 'comments'}}
</h2>
<p class="comment-callout">{{t 'comments_count' count=article.comment_count}}</p>
{{#if comments}}
<div class="dropdown comment-sorter">
<button class="dropdown-toggle" aria-haspopup="true">
{{t 'sort_by'}}
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" focusable="false" viewBox="0 0 12 12"
class="dropdown-chevron-icon">
<path fill="none" stroke="currentColor" stroke-linecap="round" d="M3 4.5l2.6 2.6c.2.2.5.2.7 0L9 4.5" />
</svg>
</button>
<span class="dropdown-menu" role="menu">
{{#each comment_sorters}}
<a aria-selected="{{selected}}" href="{{url}}" role="menuitem">{{name}}</a>
{{/each}}
</span>
</div>
{{/if}}
</header>
<ul id="comments" class="comment-list">
{{#each comments}}
<li id="{{anchor}}" class="comment">
<div class="comment-wrapper">
<div class="comment-info">
<div class="comment-author">
<div class="avatar comment-avatar">
{{#if author.agent}}
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" focusable="false" viewBox="0 0 12 12"
class="icon-agent">
<path fill="currentColor"
d="M6 0C2.7 0 0 2.7 0 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zm0 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm2.3 7H3.7c-.3 0-.4-.3-.3-.5C3.9 7.6 4.9 7 6 7s2.1.6 2.6 1.5c.1.2 0 .5-.3.5z" />
</svg>
{{/if}}
<img src="{{author.avatar_url}}" alt="" class="user-avatar" />
</div>
<div class="comment-meta">
<span title="{{author.name}}">
{{#link 'user_profile' id=author.id}}
{{author.name}}
{{/link}}
</span>
<span aria-label="{{t 'badges'}}" class="community-badge community-badge-titles">
{{#each (filter author.badges on="category_slug" equals="titles")}}
<div class="community-badge community-badge-title" title="{{description}}" aria-label="{{name}}">
{{name}}
</div>
{{/each}}
</span>
<ul class="meta-group meta-group-opposite">
{{#if editor}}
<li class="meta-data">{{date edited_at timeago=true}}</li>
<li class="meta-data">{{t 'edited'}}</li>
{{else}}
<li class="meta-data">{{date created_at timeago=true}}</li>
{{/if}}
</ul>
<div aria-label="{{t 'badges'}}" class="community-badge-container-achievements">
{{#each (
slice
(
filter
(filter author.badges on="category_slug" equals="achievements")
on="icon_url"
starts_with="https"
)
0
4
)
}}
<div class="community-badge community-badge-achievements">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" />
</div>
{{/each}}
{{#if (compare (calc author.badges.length "-" 4) ">" 0)}}
<div class="community-badge community-badge-achievements">
{{#link "user_profile" id=author.id filter_by="badges"
class="community-badge-achievements-rest"}}{{t 'plus_more' count=(calc author.badges.length "-"
4)}}{{/link}}
</div>
{{/if}}
</div>
</div>
<div class="comment-labels">
{{#with ticket}}
<a href="{{url}}" target="_zendesk_lotus" class="status-label escalation-badge">
{{t 'request'}}{{id}}
</a>
{{/with}}
{{#if pending}}
<span class="comment-pending status-label status-label-pending-moderation">{{t
'pending_approval'}}</span>
{{/if}}
</div>
</div>
<section class="comment-body">{{body}}</section>
</div>
<div class="comment-actions-container">
<div class="comment-vote vote" role="group">
{{#vote 'up' role='radio' class='vote-up' selected_class='vote-voted'}}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" focusable="false" viewBox="0 0 16 16">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"
d="M4 6.5l3.6 3.6c.2.2.5.2.7 0L12 6.5" />
</svg>
{{/vote}}
{{vote 'sum' class='vote-sum'}}
{{#vote 'down' role='radio' class='vote-down' selected_class='vote-voted'}}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" focusable="false" viewBox="0 0 16 16">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"
d="M4 6.5l3.6 3.6c.2.2.5.2.7 0L12 6.5" />
</svg>
{{/vote}}
</div>
<div class="comment-actions actions">
{{#actions}}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" focusable="false" viewBox="0 0 16 16">
<path fill="none" stroke="currentColor"
d="M13.17 3.07l-1.64.71c-.48-.4-1.03-.72-1.63-.94l-.22-1.79a.511.511 0 00-.4-.44C8.86.54 8.44.5 8 .5c-.44 0-.86.04-1.28.11-.22.04-.38.22-.4.44l-.21 1.79c-.6.22-1.15.54-1.63.94l-1.65-.71a.491.491 0 00-.58.13c-.55.65-.99 1.4-1.29 2.21-.08.21 0 .44.18.58l1.45 1.08a4.91 4.91 0 000 1.87l-1.45 1.08c-.18.13-.25.37-.18.58.3.81.74 1.55 1.28 2.2.14.17.38.22.58.13l1.65-.71c.48.4 1.03.72 1.63.94l.21 1.79c.03.22.19.4.4.44.43.07.85.11 1.29.11.44 0 .86-.04 1.28-.11.22-.04.38-.22.4-.44l.21-1.79c.6-.22 1.15-.54 1.63-.94l1.65.71c.2.09.44.04.58-.13.54-.65.98-1.39 1.28-2.2.08-.21 0-.44-.18-.57L13.4 8.95c.07-.32.1-.63.1-.95s-.03-.63-.09-.94l1.45-1.08c.18-.13.25-.37.18-.58-.3-.81-.74-1.55-1.28-2.2a.51.51 0 00-.59-.13z" />
<circle cx="8" cy="8" r="2.5" fill="none" stroke="currentColor" />
</svg>
{{/actions}}
</div>
</div>
</div>
</li>
{{/each}}
</ul>
{{pagination}}
{{#form 'comment' class='comment-form'}}
<div class="avatar comment-avatar">
{{user_avatar class='user-avatar'}}
</div>
<div class="comment-container">
{{wysiwyg 'body'}}
<div class="comment-form-controls">
{{input type='submit' class="button button-large"}}
</div>
</div>
{{/form}}
<p class="comment-callout">{{comment_callout}}</p>
</section>
</div>
{{/if}}
</article>
</div>
</div>
{{!-- Code boxes syntax highlighting --}}
<script src="{{asset 'prism.min.js'}}"></script>
<script>Prism.plugins.customClass.prefix('prism-');</script>
{{!-- Code boxes copy to clipboard button --}}
<script src="{{asset 'clipboard.min.js'}}"></script>
<script src="{{asset 'clipboard-button.min.js'}}"></script>
{{!-- Anchor links --}}
<script src="{{asset 'anchor.min.js'}}"></script>
<script>
anchors.options = { placement: 'right', icon: '#', class: 'anchor-links' };
anchors.add('.article-body h2, .article-body h3, .article-body h4');
</script>