forked from evoko/zendesk-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommunity_post_page.hbs
219 lines (197 loc) · 7.76 KB
/
community_post_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
<div class="container-divider"></div>
<div class="container">
<nav class="sub-nav">
{{breadcrumbs}}
{{search scoped=settings.scoped_community_search submit=false}}
</nav>
<div class="post-container">
<div class="post">
<article>
<header class="post-header">
<div class="post-title">
<h1 title="{{post.title}}">
{{post.title}}
{{#if post.internal}}
<span class="icon-lock" title="{{t 'internal'}}"></span>
{{/if}}
</h1>
{{#if post.pinned}}
<span class="status-label status-label-pinned">{{t 'pinned'}}</span>
{{/if}}
{{#if post.featured}}
<span class="status-label status-label-featured">{{t 'featured'}}</span>
{{/if}}
{{#is post.status 'none'}}
{{else}}
<span class="status-label-{{post.status_dasherized}} status-label">{{post.status_name}}</span>
{{/is}}
</div>
{{#if settings.show_follow_post}}
<div class="community-follow">{{subscribe}}</div>
{{/if}}
</header>
<section class="post-info-container">
<div class="post-info">
<div class="post-author">
<div class="avatar post-avatar">
{{#if post.author.agent}}
<span class="icon-agent"></span>
{{/if}}
<img src="{{post.author.avatar_url}}" alt="" class="user-avatar"/>
</div>
<div class="post-meta">
<span title="{{post.author.name}}">
{{#link 'user_profile' id=post.author.id}}
{{post.author.name}}
{{/link}}
</span>
<ul class="meta-group">
{{#if post.editor}}
<li class="meta-data">{{date post.edited_at timeago=true}}</li>
<li class="meta-data">{{t 'edited'}}</li>
{{else}}
<li class="meta-data">{{date post.created_at timeago=true}}</li>
{{/if}}
</ul>
</div>
{{#if post.pending}}
<span class="status-label status-label-pending">{{t 'pending_approval'}}</span>
{{/if}}
{{#with post.ticket}}
<a href="{{url}}" target="_zendesk_lotus" class="status-label escalation-badge">
{{t 'request'}}{{id}}
</a>
{{/with}}
</div>
<div class="post-content">
<div class="post-body">{{post.details}}</div>
</div>
</div>
<div class="post-actions-wrapper">
<div class="post-vote vote" role='radiogroup'>
{{#with post}}
{{vote 'up' role='radio' class='vote-up' selected_class='vote-voted'}}
{{vote 'sum' class='vote-sum'}}
{{vote 'down' role='radio' class='vote-down' selected_class='vote-voted'}}
{{/with}}
</div>
<div class="post-actions actions">
{{post.actions}}
</div>
</div>
</section>
{{#if settings.show_post_sharing}}
<footer class="post-footer">
<div class="post-share">{{share}}</div>
{{#if comments}}
<a href="#comment-overview" class="post-comment-count">
<span class="icon-comments"></span>
{{post.comment_count}}
</a>
{{/if}}
</footer>
{{/if}}
</article>
<section class="comment-overview" id="comment-overview">
<h3 class="comment-heading">
{{t 'comments'}}
</h3>
<p class="comment-callout">{{t 'comments_count' count=post.comment_count}}</p>
{{#if comments}}
<div class="dropdown comment-sorter">
<button class="dropdown-toggle" aria-haspopup="true">
{{t 'sort_by'}}
</button>
<span class="dropdown-menu" role="menu">
{{#each comment_sorters}}
<a aria-selected="{{selected}}" href="{{url}}" role="menuitem">{{name}}</a>
{{/each}}
</span>
</div>
{{/if}}
</section>
<ul id="comments" class="comment-list">
{{#each comments}}
<li id="{{anchor}}" class="comment">
<div class="comment-wrapper {{#if official}} comment-official {{/if}}">
<div class="comment-info">
{{#if official}}
<span class="comment-official status-label status-label-official">{{t 'official_comment'}}</span>
{{/if}}
<div class="comment-author">
<div class="avatar comment-avatar">
{{#if author.agent}}
<span class="icon-agent"></span>
{{/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>
<ul class="meta-group">
{{#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>
<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">{{t 'pending_approval'}}</span>
{{/if}}
</div>
</div>
<section class="comment-body">{{body}}</section>
</div>
<div class="comment-actions-container">
{{#unless official}}
<div class="comment-vote vote" role='radiogroup'>
{{vote 'up' role='radio' class='vote-up' selected_class='vote-voted'}}
{{vote 'sum' class='vote-sum'}}
{{vote 'down' role='radio' class='vote-down' selected_class='vote-voted'}}
</div>
{{/unless}}
<div class="comment-actions actions">
{{actions}}
</div>
</div>
</div>
</li>
{{/each}}
</ul>
{{pagination}}
<section class="post-comments">
{{#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">
{{checkbox 'official'}}
{{label 'official'}}
{{input type='submit'}}
</div>
</div>
{{/form}}
</section>
<p class="comment-callout">{{comment_callout}}</p>
</div>
<section class="post-sidebar">
<h3 class="sidebar-title">{{t 'suggest_new_post'}}</h3>
<span class="post-to-community">
{{link 'new_post' role='button' class='button-large'}}
</span>
</section>
</div>
</div>