-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
236 lines (208 loc) · 8.29 KB
/
index.html
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
<head>
<title>JoliSlack</title>
<link rel="icon" sizes="32x32" href="/favicon.png">
</head>
<body>
{{> layout }}
</body>
<template name="layout">
{{> Template.dynamic template=top}}
{{> Template.dynamic template=main}}
<a href="https://github.com/tlenclos/Slack-quote-of-the-day"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
</template>
<template name="header">
<div class="header container">
<h1>JoliSlack</h1>
{{> loginButtons}}
</div>
{{#if loggedUser}}
{{> quote }}
{{/if}}
<div class="container">
{{#if loggedUser}}
<a id="searchMessage" href="/" class="button button-transparent"><i class="fa fa-search"></i> Search a message</a>
<a id="allQuotes" href="/quotes" class="button button-transparent"><i class="fa fa-list-alt"></i> See all quotes</a>
<a id="team" href="/team" class="button button-transparent"><i class="fa fa-users"></i> Team</a>
<a id="achievements" href="/achievements" class="button button-transparent"><i class="fa fa-rocket"></i> Achievements</a>
{{#if isInRole 'admin'}}
<a id="achievements" href="/parameters" class="button button-transparent"><i class="fa fa-cog"></i> Parameters</a>
{{/if}}
{{else}}
<div class="flex mxn2">
<div class="flex-auto p2">
<p class="text-preview">Search a message</p>
<img alt="Search a message" src="/preview_search.png" class="img-preview" />
</div>
<div class="flex-auto p2">
<p class="text-preview">Mark it as quote of the day</p>
<img alt="Quote of the day" src="/preview_quote.png" class="img-preview" />
</div>
<div class="flex-auto p2">
<p class="text-preview">Notify your team</p>
<img alt="Integrate with your team" src="/preview_channel.png" class="img-preview" />
</div>
</div>
{{/if}}
</div>
</template>
<template name="quote">
<div id="quoteOfTheDay" class="container">
{{#if isReady}}
{{#if quoteOfTheDay}}
{{#with quoteOfTheDay}}
<a href="" title="Remove this quote" id="removeQuote" class="fa fa-trash-o"></a>
<a href="{{ quote.permalink }}" title="See the message in slack" id="seeInSlack" class="fa fa-slack" target="_blank"></a>
<h2 class="quote"><i class="fa fa-quote-left"></i>{{{ formatMessage quote.text }}}<i class="fa fa-quote-right"></i></h2>
<p class="quote">Par <strong>{{ quote.username }}</strong></p>
{{/with}}
{{else}}
<h2 class="quote"><i class="fa fa-frown-o"></i> No quote for today.</h2>
{{/if}}
{{else}}
<div class="loader"></div>
{{/if}}
</div>
</template>
<template name="search">
<div class="container">
{{#if loggedUser}}
<form>
<input type="text" name="search" class="field-light" />
<button id="submit" class="button-outline olive">Search</button>
</form>
{{> results }}
{{/if}}
</div>
</template>
<template name="results">
<div id="results">
<div class="counts">{{ count }}</div>
<br />
{{#if loading}}
<div class="loader"></div>
{{else}}
<ul>
{{#each results}}
<li>
<strong>{{username}}</strong><br />
{{#if quoteOfTheDay}} {{else}} <a class="markAsQuote" href="#">Mark a QOTD</a> {{/if}}
{{{ formatMessage text }}}
</li>
{{/each}}
</ul>
{{/if}}
</div>
</template>
<template name="quotes">
<div class="container">
{{#if isReady}}
<ul class="quotes">
{{#each quotes}}
<li>
<img src="{{ avatar quote.user }}" class="avatar" />
<i class="fa fa-quote-left"></i>
<a href="{{ quote.permalink }}" title="See the message in slack" target="_blank">{{{ formatMessage quote.text }}}</a>
<i class="fa fa-quote-right"></i>
<br />
<strong>{{ quote.username }}</strong><span class="date">, {{formatDate day}}</span>
</li>
{{/each}}
</ul>
{{else}}
<div class="loader"></div>
{{/if}}
</div>
</template>
<template name="team">
<div class="container">
{{> members }}
</div>
</template>
<template name="members">
<h2>Members</h2>
{{#if isReady}}
<div class="flex flex-wrap mxn2">
{{#each members}}
<div class="flex col-6 sm-col-4 md-col-3 lg-col-4 p2">
<div class="p2">
<a href="/member/{{ _id }}">
<img src="{{ avatar id }}" class="avatar" />
<strong>{{ name }}</strong><br>
</a>
</div>
</div>
{{/each}}
</div>
{{else}}
<div class="loader"></div>
{{/if}}
</template>
<template name="achievements">
<div class="container">
<h2>Achievements</h2>
{{#if isReady}}
<ul class="achievements">
{{#each achievements}}
<li class="achievement">
<strong>{{> editableText collection="achievements" field="name"}}</strong>
{{> editableText collection="achievements" field="description"}}
<a href="" title="Remove this achievement" id="removeAchievement"><i class="fa fa-times"></i></a>
<br>
Unlocked by
{{#each unlockedBy }}
<a href="/member/{{ _id }}">{{ name }}</a>
{{/each}}
</li>
{{/each}}
</ul>
{{else}}
<div class="loader"></div>
{{/if}}
<h3>Add</h3>
{{> achievementForm }}
</div>
</template>
<template name="achievementForm">
{{> quickForm collection="AchievementsCollection" id="achievementForm" type="insert" omitFields="teamId"}}
</template>
<template name="parameters">
<div class="container">
<h2>Parameters</h2>
<form id="parameters">
<label for="webhook">Slack webhook</label>
<input type="text" name="webhook" class="block mb1 field-light col-10" value="{{ team.webhook }}" />
<button type="submit" class="button-outline olive">Update </button>
</form>
</div>
</template>
<template name="member">
<div class="container">
{{#with member}}
<div class="flex mxn2">
<div class="col-6 border-box p2">
<h2>{{ name }}</h2>
<img src="{{ avatar id }}" class="avatar" />
{{ profile.real_name }}
</div>
<div class="col-6 border-box p2">
<h3>Unlocked achievements</h3>
{{> unlockedAchievements }}
{{> addAchievement }}
</div>
</div>
{{/with}}
</div>
</template>
<template name="unlockedAchievements">
{{#each achievements}}
<li class="achievement">
<strong>{{ name }}</strong> {{ description }} <a href="" title="Remove this achievement" id="removeToUser"><i class="fa fa-times"></i></a>
</li>
{{/each}}
</template>
<template name="addAchievement">
{{#autoForm schema=Schemas.achievementSelect id="achievementSelect" validation="none"}}
{{> afQuickField name="achievement" options=achievementsData}}
<button type="submit" class="btn btn-primary">Add</button>
{{/autoForm}}
</template>