/
fragments.html
422 lines (391 loc) · 16 KB
/
fragments.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
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<!DOCTYPE html>
<html>
<body>
<div th:fragment="empty"></div>
<div th:fragment="captcha">
<input id="captcha-id" name="captchaId" type="hidden">
<div class="field">
<img id="captcha-image">
<button type="button" id="captcha-refresh-button" class="button is-info colored" onclick="refreshCaptcha()">
<i class="fa fa-sync" id="captcha-refresh-icon"></i>
</button>
</div>
<div class="field">
<input class="input" id="captcha" name="captchaText" th:placeholder="#{captcha}" autocomplete="off"
required>
</div>
<div style="padding-top: 4px;"></div>
</div>
<div th:fragment="header-logged-out" id="header-logged-out" class="header">
<nav class="navbar is-info">
<div class="navbar-brand">
<a class="navbar-item" href="/"> <img src="/img/icon.png" width="40" height="40" alt="logo">
</a> <a class="navbar-item" href="/" id="navbar-text" th:text="#{app.name}"></a>
</div>
<div style="width: 100%; display: flex;">
<div class="navbar-end">
<div class="navbar-item" id="navbar-item-language" style="padding-right: 0px;">
<a class="button is-white is-outlined" onclick="onLanguageButtonClicked()"
style="width: 40px; height: 40px;"><i style="padding-right: 0px; color: white;"
class="fas fa-globe"></i></a>
</div>
<div class="navbar-item" id="navbar-item-register">
<a class="button is-white is-outlined" href="/register" th:text="#{sign-up}"></a>
</div>
<div class="navbar-item">
<a class="button is-white is-outlined" href="/login" th:text="#{login}"> </a>
</div>
</div>
</div>
</nav>
<script>
function onLanguageButtonClicked() {
let locale = document.getElementById('locale');
locale.scrollIntoView({behavior: 'smooth', block: 'center'});
setTimeout(function () {locale.focus()}, 700);
}
</script>
</div>
<div th:fragment="header-logged-in" id="header-logged-in" class="header">
<nav class="navbar is-info">
<div class="navbar-brand">
<a class="navbar-item"> <img src="/img/icon.png" width="40" height="40">
</a> <a id="navbar-text" class="navbar-item" th:text="#{app.name}"></a>
</div>
<div style="width: 100%; display: flex;">
<div class="navbar-end">
<form th:action="@{/logout}" method="post">
<span class="navbar-item">
<button class="button is-white is-outlined" href="/logout" id="logout">
<span th:text="#{logout}"></span>
</button>
</span>
</form>
</div>
</div>
</nav>
</div>
<footer class="footer" th:fragment="footer" id="footer">
<div class="container">
<div class="columns">
<div class="column">
<div class="control has-icons-left" style="margin-top: -8px;">
<div class="select">
<select id="locale" onchange="onChangeLocal(this)">
<option th:text="#{language}" hidden></option>
<option value="?lang=en">English</option>
<option value="?lang=de">Deutsch</option>
<option value="?lang=es">Español (beta)</option>
<option value="?lang=fr">Français (beta)</option>
<option value="?lang=pt">Português (beta)</option>
<option value="?lang=it">Italiano (beta)</option>
<option value="?lang=cz">Čeština (beta)</option>
<option value="?lang=ru">русский (beta)</option>
<option value="?lang=ja">日本語 (beta)</option>
<option value="?lang=zh">中文 (beta)</option>
<option value="?lang=ko">한국어 (beta)</option>
</select>
</div>
<span class="icon is-left"> <i class="fas fa-globe"></i>
</span>
</div>
</div>
<div class="column">
<div class="has-text-centered">
<a href="/privacy" th:text="#{privacy-policy}"></a>
</div>
</div>
<div class="column">
<div class="has-text-centered">
<a href="/tos" th:text="#{tos}"></a>
</div>
</div>
<div class="column">
<div class="has-text-centered">
<a href="/imprint" th:text="#{imprint}"></a>
</div>
</div>
<div class="column">
<div class="has-text-centered">
<a href="/faq" th:text="#{faq}"></a>
</div>
</div>
<div class="column">
<div class="has-text-centered">
<a href="https://twitter.com/alovoa_love"><img src="/img/t-icon.svg" style="height: 20px;"
alt="twitter"></a>
<a href="https://mastodon.social/@alovoa_love"><img src="/img/m-icon.svg" style="height: 20px;"
alt="mastodon"></a>
</div>
</div>
</div>
</div>
<script>
function onChangeLocal(e) {
let val = e.options[e.selectedIndex].value;
console.log(val);
if (val.includes('?lang=') && val.length == 8) {
window.location.search = val;
}
}
</script>
</footer>
<div th:fragment="navigation">
<nav class="navbar is-link is-fixed-bottom" role="navigation" style="display: block;">
<div class="navbar-brand">
<a class="navbar-item is-expanded navigation-item" href="/search" id="nav-search">
<div>
<i class="fa fa-search"></i><span th:text="#{search}"></span>
</div>
</a> <a class="navbar-item is-expanded navigation-item" href="/donate" id="nav-donate">
<div>
<i class="fa fa-coins"></i><span th:text="#{donate}"></span>
</div>
</a> <a class="navbar-item is-expanded navigation-item" id="nav-alerts" href="/alerts">
<div>
<i class="fa fa-bell"></i> <span th:text="#{alerts}"></span>
</div>
</a> <a class="navbar-item is-expanded navigation-item" id="nav-chats" href="/chats">
<div>
<i class="fa fa-comments"></i> <span th:text="#{chats}"></span>
</div>
</a> <a class="navbar-item is-expanded navigation-item" href="/profile" id="nav-profile">
<div>
<i class="fa fa-user"></i> <span th:text="#{profile}"></span>
</div>
</a>
</div>
</nav>
</div>
<th:block th:fragment="bulma">
<th:block th:if="${user != null}">
<th:block th:if="${user.accentColor != null}">
<link th:if="${user.accentColor == 'purple'}" rel="stylesheet" href="/css/lib/bulma.purple.css">
<link th:if="${user.accentColor == 'blue'}" rel="stylesheet" href="/css/lib/bulma.blue.css">
<link th:if="${user.accentColor == 'orange'}" rel="stylesheet" href="/css/lib/bulma.orange.css">
</th:block>
</th:block>
<th:block th:if="${currUser != null}">
<th:block th:if="${currUser.accentColor != null}">
<link th:if="${currUser.accentColor == 'purple'}" rel="stylesheet" href="/css/lib/bulma.purple.css">
<link th:if="${currUser.accentColor == 'blue'}" rel="stylesheet" href="/css/lib/bulma.blue.css">
<link th:if="${currUser.accentColor == 'orange'}" rel="stylesheet" href="/css/lib/bulma.orange.css">
</th:block>
</th:block>
</th:block>
<th:block th:fragment="ui-design">
<th:block th:if="${user != null}">
<th:block th:if="${user.uiDesign != null}">
<link th:if="${user.uiDesign == 'angular'}" rel="stylesheet" href="/css/snips/ui-angular.css">
</th:block>
</th:block>
<th:block th:if="${currUser != null}">
<th:block th:if="${currUser.uiDesign != null}">
<link th:if="${currUser.uiDesign == 'angular'}" rel="stylesheet" href="/css/snips/ui-angular.css">
</th:block>
</th:block>
</th:block>
<div th:fragment="search-users" class="user-search-div">
<audio id="audio" style="display: none;"></audio>
<div th:if="${#lists.isEmpty(dto.users)}"
style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding-top: 12px;">
<span th:text="#{no-users-found}"></span>
</div>
<div th:if="${dto.message != null}" id="search-message" th:text="${dto.message}" style="display: none;"></div>
<script>
{
let searchMessageDiv = $("#search-message");
if (searchMessageDiv) {
if (searchMessageDiv.text()) {
alert(searchMessageDiv.text());
}
}
}
</script>
<th:block th:each="user : ${dto.users}">
<div class="user-search-card" th:id="${user.idEncoded}">
<div class="swiper-container " th:id="${user.idEncoded}">
<div class="swiper-wrapper">
<div class="swiper-slide colored"
style="background-color: #48c774; display: flex; align-items: center; justify-content: center">
<i class="fa fa-thumbs-up fa-10x"></i>
</div>
<div class="swiper-slide">
<div class="card is-horizontal"
style="width: 100%; height: 100%;">
<div class="card-image" onclick="toggleCardContent()">
<figure class="image">
<img th:src="${user.profilePicture}" class="profile-pic">
</figure>
</div>
<div class="card-content">
<div onclick="toggleCardContent()">
<div class="content-background">
<div class="content">
<div class="media">
<div class="full-width">
<div class="left first-name" style="font-size: 2em" th:text="${user.firstName}"
th:classappend="${user.gender.text == 'male' ? 'male' : user.gender.text == 'female' ? 'female' : 'other'}"></div>
<div class="left" style="font-size: 1.5em; padding-top: 6px;">
<span>, </span><span
th:text="${user.age}"></span>
</div>
<div class="right" style="font-size: 1.2em; padding-top: 6px;">
<i class="fa fa-map-marker-alt"></i>
<span th:text="${user.distanceToUser}"></span><span> </span>
<span th:if="${currUser.units == 0}" th:text="#{km}"></span>
<span th:if="${currUser.units == 1}" th:text="#{mi}"></span>
</div>
</div>
</div>
<div class="media" style="padding-bottom: 8px; padding-top: 8px; font-size: 0.9em;">
<div class="full-width">
<div class="left">
<span th:text="#{last-active}"></span><span>: </span><span
th:text="${#dates.format(user.activeDate, 'yyyy-MM-dd')}"></span>
</div>
</div>
</div>
<div style="font-size: 1.1em;"
class="description" th:text="${user.description}"></div>
</div>
</div>
</div>
<div class="profile-bottom full-width dimmed"
style="display: inline-block;">
<div class="left">
<button class="button colored is-info"
th:onclick="viewProfile([[${user.idEncoded}]]);" style="margin-right: 4px;">
<i class="fa fa-user"></i>
</button>
<button class="button colored is-info search-audio" th:if="${user.hasAudio}"
th:onclick="playPauseAudio([[${user.idEncoded}]]);">
<i class="fa fa-headphones"></i>
</button>
</div>
<div class="right" th:if="${user.compatible}">
<button class="button colored is-danger"
style="margin-right: 4px;"
th:onclick="hideUser([[${user.idEncoded}]])">
<i class="fa fa-thumbs-down"></i>
</button>
<button class="button colored is-success"
th:onclick="likeUser([[${user.idEncoded}]])">
<i class="fa fa-thumbs-up"></i>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="swiper-slide colored"
style="background-color: #f14668; display: flex; align-items: center; justify-content: center;">
<i class="fa fa-thumbs-down fa-10x"></i>
</div>
</div>
</div>
</div>
</div>
</th:block>
<div th:fragment="message-detail">
<div th:each="message : ${messages}"
style="display: inline-block; width: 100%;">
<div th:if="${message.from && message.allowedFormatting}"
class="chat-message left" th:utext="${message.content}"></div>
<div th:if="${message.from && !message.allowedFormatting}"
class="chat-message left" th:text="${message.content}"></div>
<div th:if="${!message.from && message.allowedFormatting}"
class="chat-message right notification is-primary" th:utext="${message.content}"></div>
<div th:if="${!message.from && !message.allowedFormatting}"
class="chat-message right notification is-primary" th:text="${message.content}"></div>
</div>
</div>
<div th:fragment="donate-filter" id="donate-cards-div">
<div class="card is-horizontal" th:each="donation : ${donations}"
style="scroll-snap-align: end;">
<div class="card-image">
<figure class="image">
<th:block th:if="${donation.user.profilePicture}">
<img th:src="${donation.user.profilePicture}" class="profile-pic"
th:onclick="viewProfile([[${donation.user.idEncoded}]])">
</th:block>
</figure>
</div>
<div class="card-content">
<div class="content">
<div class="media">
<div class="full-width">
<div class="left first-name" style="font-size: 2em" th:text="${donation.user.firstName}"
th:classappend="${donation.user.gender.text == 'male' ? 'male' : donation.user.gender.text == 'female' ? 'female' : 'other'}"></div>
<div class="left" style="font-size: 1.5em; padding-top: 6px;">
<span>, </span><span
th:text="${donation.user.age}"></span>
</div>
<div class="right" style="font-size: 1.2em; padding-top: 6px;">
<i class="fa fa-map-marker-alt"></i>
<span th:text="${donation.user.distanceToUser}"></span><span> </span>
<span th:if="${user.units == 0}" th:text="#{km}"></span>
<span th:if="${user.units == 1}" th:text="#{mi}"></span>
</div>
</div>
</div>
<div class="media">
<div class="full-width">
<div class="left" style="font-size: 1.2em">
<span th:text="#{donated}"></span><span> </span> <span
th:text="${#numbers.formatDecimal(donation.amount, 1, 2, 'POINT') + ' €'}"
th:if="${filter == 1}"></span> <span
th:text="${#numbers.formatDecimal(donation.user.totalDonations, 1, 2, 'POINT') + ' €'}"
th:if="${filter == 2}"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div th:fragment="profile-warning">
<div th:if="${hasWarning}">
<header class="card-header collapsible-header" style="display: flex;">
<a href="#collapsible-card-warning" data-action="collapse" class="card-header-icon is-hidden-fullscreen full-width navbar is-danger"
id="profile-warning-collapsible" aria-label="more options">
<span class="label" style="margin-bottom: initial; color: white;" th:text="#{profile.warning.incomplete}"></span>
<div class="navbar-link" id="navbar-link-profile-warning" style="overflow-wrap: anywhere;"></div>
</a>
</header>
<div id="collapsible-card-warning" class="is-collapsible always-collapse">
<div class="card-content">
<a class="notification is-warning full-width" th:if="${noProfilePicture}"
th:text="#{profile.warning.no-profile-picture}" id="no-profile-picture"
onclick="onWarningProfileClicked()"></a> <a
class="notification is-warning full-width" th:if="${noDescription}"
th:text="#{profile.warning.no-description}" id="no-description"
onclick="onWarningDescriptionClicked()"></a> <a
class="notification is-warning full-width" th:if="${noIntention}"
onclick="onWarningIntentionClicked()" id="no-intention"
th:text="#{profile.warning.no-intention}"></a> <a
class="notification is-warning full-width" th:if="${noGender}"
onclick="onWarningGenderClicked()" id="no-gender"
th:text="#{profile.warning.no-gender-preference}"></a> <a
class="notification is-warning full-width" th:if="${noLocation}" id="no-location"
th:text="#{profile.warning.no-location}" href="/search"></a>
</div>
</div>
<script>
function onWarningProfileClicked() {
$("#profilePictureUpload").click();
}
function onWarningDescriptionClicked() {
document.getElementById('description').scrollIntoView({behavior: 'smooth', block: 'center'});
}
function onWarningIntentionClicked() {
document.getElementById('intention-field').scrollIntoView({behavior: 'smooth', block: 'center'});
}
function onWarningGenderClicked() {
document.getElementById('gender-field').scrollIntoView({behavior: 'smooth', block: 'center'});
}
</script>
</div>
</div>
</body>
</html>