File: website_slides_templates_homepage.xml

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (523 lines) | stat: -rw-r--r-- 32,258 bytes parent folder | download
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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
<?xml version="1.0" ?>
<odoo><data>

<!-- Channels home template -->
<template id='courses_home' name="Odoo Courses Homepage">
    <t t-set="body_classname" t-value="'o_wslides_body'"/>
    <t t-call="website.layout">
        <div id="wrap" class="wrap o_wslides_wrap">
            <div class="oe_structure oe_empty">
            <section class="s_banner overflow-hidden" style="background-color:(0, 0, 0, 0); background-image: url(&quot;/website_slides/static/src/img/banner_default.svg&quot;); background-size: cover; background-position: 55% 65%" data-snippet="s_banner">
                <div class="container align-items-center d-flex mb-5 mt-lg-5 pt-lg-4 pb-lg-1">
                    <div class="text-white">
                        <h1 class="display-3 mb-0">Reach new heights</h1>
                        <h2 class="mb-4">Start your online course today!</h2>
                        <div class="row mt-1 mb-3">
                            <div class="col">
                                <p>Skill up and have an impact! Your business career starts here.<br/>Time to start a course.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            </div>
            <div class="container mt16 o_wslides_home_nav position-relative">
                <nav class="navbar navbar-expand-lg navbar-light shadow-sm">
                    <t t-call="website.website_search_box_input">
                        <t t-set="_form_classes" t-valuef="o_wslides_nav_navbar_right order-lg-3"/>
                        <t t-set="search_type" t-valuef="slides"/>
                        <t t-set="action" t-valuef="/slides/all"/>
                        <t t-set="display_description" t-valuef="true"/>
                        <t t-set="display_detail" t-valuef="false"/>
                        <t t-set="placeholder">Search courses</t>
                        <input type="hidden" name="prevent_redirect" value="True"/>
                    </t>
                    <button class="navbar-toggler px-2 order-1" type="button"
                        data-bs-toggle="collapse" data-bs-target="#navbarSlidesHomepage"
                        aria-controls="navbarSlidesHomepage" aria-expanded="false" aria-label="Toggle navigation">
                        <span class="navbar-toggler-icon"/>
                    </button>
                    <div class="collapse navbar-collapse order-2" id="navbarSlidesHomepage">
                        <div class="navbar-nav pt-3 pt-lg-0">
                            <a class="nav-link nav-link me-md-2 o_wslides_home_all_slides" href="/slides/all"><i class="fa fa-graduation-cap me-1"/>All courses</a>
                        </div>
                    </div>
                </nav>
                <div class="o_wprofile_email_validation_container">
                    <t t-call="website_profile.email_validation_banner">
                        <t t-set="redirect_url" t-value="'/slides'"/>
                        <t t-set="send_alert_classes" t-value="'alert alert-danger alert-dismissable mt-4 mb-0'"/>
                        <t t-set="done_alert_classes" t-value="'alert alert-success alert-dismissable mt-4 mb-0'"/>
                        <t t-set="additional_validation_email_message"> and join this Community</t>
                        <t t-set="additional_validated_email_message"> You may now participate in our eLearning.</t>
                    </t>
                </div>
            </div>

            <div class="container o_wslides_home_main">
                <div class="row">
                    <t t-set="has_side_column" t-value="is_view_active('website_slides.toggle_leaderboard')"/>
                    <t t-if="is_public_user">
                        <div t-if="has_side_column" class="col-lg-3 order-3 order-lg-2">
                            <div class="row">
                                <div class="col-12 col-md-5 col-lg-12">
                                    <div class="ps-md-5 ps-lg-0">
                                        <t t-call="website_slides.slides_home_users_small"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </t>
                    <div t-else="" class="col-lg-3 order-lg-2">
                        <t t-set="has_side_column" t-value="True"/>
                        <div class="o_wslides_home_aside_loggedin card p-3 p-lg-0 mb-4">
                            <div class="o_wslides_home_aside_title">
                                <div class="d-flex align-items-center">
                                    <t t-call="website_slides.slides_misc_user_image">
                                        <t t-set="img_class" t-value="'rounded-circle me-1'"/>
                                        <t t-set="img_style" t-value="'width: 22px; height: 22px;'"/>
                                    </t>
                                    <h5 t-esc="user.name" class="d-flex flex-grow-1 mb-0"/>
                                    <a class="d-none d-lg-block" t-att-href="'/profile/user/%s' % user.id">View</a>
                                    <a class="d-lg-none btn btn-sm bg-white border" href="#" data-bs-toggle="collapse" data-bs-target="#o_wslides_home_aside_content">More info</a>
                                </div>
                                <hr class="d-none d-lg-block mt-2 mb-2 mb-1"/>
                            </div>
                            <div id="o_wslides_home_aside_content" class="collapse d-lg-block">
                                <div class="row g-0 mb-5 mt-3 mt-lg-0">
                                    <div class="col-12 col-sm-6 col-lg-12">
                                        <t t-call="website_slides.slides_home_user_profile_small"/>
                                    </div>
                                    <div class="col-12 col-sm-6 col-lg-12 ps-md-5 ps-lg-0 mt-lg-4">
                                        <t t-call="website_slides.slides_home_user_achievements_small"/>
                                    </div>
                                    <div class="col-12 col-md-7 col-lg-12 ps-md-5 ps-lg-0 mt-lg-4 mb-3">
                                        <t t-call="website_slides.slides_home_achievements_small"/>
                                    </div>
                                    <div class="col-12 col-sm-6 col-lg-12 ps-md-5 ps-lg-0 mt-lg-4">
                                        <t t-call="website_slides.slides_home_users_small"/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div t-att-class="'col-lg-9 pe-lg-5 order-lg-1' if has_side_column else 'col-lg pr-lg'">
                        <div t-if="invite_error_msg" role="alert" class="o_not_editable alert alert-danger text-center" t-esc="invite_error_msg"/>
                        <div class="o_wslides_home_content_section mb-3"
                            t-if="not channels_popular">
                            <p class="h2">No Course created yet.</p>
                            <p groups="website_slides.group_website_slides_officer">Click on "New" in the top-right corner to write your first course.</p>
                        </div>
                        <t t-if="channels_my">
                            <t t-set="void_count" t-value="3 - len(channels_my[:3])"/>
                            <div class="o_wslides_home_content_section mb-3">
                                <div class="row o_wslides_home_content_section_title align-items-center">
                                    <div class="col">
                                        <a href="/slides/all?my=1" class="float-end">View all</a>
                                        <h5 class="m-0">My courses</h5>
                                        <hr class="mt-2 mb-2"/>
                                    </div>
                                </div>
                                <div class="row mx-n2 mt8">
                                    <t t-foreach="channels_my[:3]" t-as="channel">
                                        <div class="col-md-4 col-sm-6 px-2 col-xs-12 d-flex">
                                            <t t-call="website_slides.course_card"/>
                                        </div>
                                    </t>
                                </div>
                            </div>
                        </t>
                        <div class="o_wslides_home_content_section mb-3"
                            t-if="channels_popular">
                            <div class="row o_wslides_home_content_section_title align-items-center">
                                <div class="col">
                                    <a href="slides/all" class="float-end">View all</a>
                                    <h5 class="m-0">Most popular courses</h5>
                                    <hr class="mt-2 mb-2"/>
                                </div>
                            </div>
                            <div class="row mx-n2 mt8">
                                <t t-foreach="channels_popular[:3]" t-as="channel">
                                    <div class="col-md-4 col-sm-6 px-2 col-xs-12 d-flex">
                                        <t t-call="website_slides.course_card"/>
                                    </div>
                                </t>
                            </div>
                        </div>
                        <div class="o_wslides_home_content_section mb-3"
                            t-if="channels_newest">
                            <div class="row o_wslides_home_content_section_title align-items-center">
                                <div class="col">
                                    <a href="slides/all" class="float-end">View all</a>
                                    <h5 class="m-0">Newest courses</h5>
                                    <hr class="mt-2 mb-2"/>
                                </div>
                            </div>
                            <div class="row mx-n2 mt8">
                                <t t-foreach="channels_newest[:3]" t-as="channel">
                                    <div class="col-md-4 col-sm-6 px-2 col-xs-12 d-flex">
                                        <t t-call="website_slides.course_card"/>
                                    </div>
                                </t>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <t t-call="website_slides.courses_footer"></t>
        </div>
    </t>
</template>

<!-- Channel all/main template -->
<template id='courses_all' name="Odoo All Courses">
    <t t-set="body_classname" t-value="'o_wslides_body'"/>
    <t t-call="website.layout">
        <div id="wrap" class="wrap o_wslides_wrap">
            <!-- Repeat structure for every section to allow customization through website editor. !-->
            <div class="oe_structure oe_empty" t-if="search_my">
                <section class="s_banner" data-snippet="s_banner"
                         style="background-color:(0, 0, 0, 0); background-image: url(&quot;/website_slides/static/src/img/banner_default_all.svg&quot;); background-size: cover; background-position: 80% 20%">
                    <div class="container py-5"><h1 class="display-3 mb-0 text-white">My Courses</h1></div>
                </section>
            </div>
            <div class="oe_structure oe_empty" t-elif="search_slide_category == 'certification'">
               <section class="s_banner" data-snippet="s_banner"
                        style="background-color:(0, 0, 0, 0); background-image: url(&quot;/website_slides/static/src/img/banner_default_all.svg&quot;); background-size: cover; background-position: 80% 20%">
                    <div class="container py-5"><h1 class="display-3 mb-0 text-white">Certifications</h1></div>
                </section>
            </div>
            <div class="oe_structure oe_empty" t-else="">
                <section class="s_banner" data-snippet="s_banner"
                         style="background-color:(0, 0, 0, 0); background-image: url(&quot;/website_slides/static/src/img/banner_default_all.svg&quot;); background-size: cover; background-position: 80% 20%">
                    <div class="container py-5"><h1 class="display-3 mb-0 text-white">All Courses</h1></div>
                </section>
            </div>
            <div class="container mt16 o_wslides_home_nav position-relative">
                <!-- Navbar dynamically composed using displayed channel tag groups. -->
                <nav class="navbar navbar-expand-md navbar-light shadow-sm ps-0">
                    <div class="navbar-nav border-end">
                        <a class="nav-link nav-item px-3" href="/slides"><i class="oi oi-chevron-left"/></a>
                    </div>
                    <!-- Clear filtering (mobile)-->
                    <div class="text-nowrap ms-auto d-md-none" t-if="search_slide_category or search_my or search_tags">
                        <a href="/slides/all" class="btn btn-info me-2" role="button" title="Clear filters">
                            <i class="fa fa-eraser"/> Clear filters
                        </a>
                    </div>
                    <t t-else="" t-call="website.website_search_box_input">
                        <!-- Search box (mobile)-->
                        <t t-set="_form_classes" t-valuef="o_wslides_nav_navbar_right d-md-none"/>
                        <t t-set="search_type" t-valuef="slides"/>
                        <!-- No action: remain on same URL -->
                        <t t-set="display_description" t-valuef="true"/>
                        <t t-set="display_detail" t-valuef="false"/>
                        <t t-set="placeholder">Search courses</t>
                        <t t-set="search" t-value="original_search or search_term"/>
                        <input t-if="search_my" type="hidden" name="my" t-att-value="1"/>
                        <input t-if="search_slide_category" type="hidden" name="slide_category" t-att-value="search_slide_category" />
                        <input type="hidden" name="prevent_redirect" value="True"/>
                    </t>
                    <button class="navbar-toggler px-1" type="button"
                        data-bs-toggle="collapse" data-bs-target="#navbarTagGroups"
                        aria-controls="navbarTagGroups" aria-expanded="false" aria-label="Toggle navigation">
                        <span class="navbar-toggler-icon small"/>
                    </button>
                    <div class="collapse navbar-collapse" id="navbarTagGroups">
                        <t t-set="search_tag_groups" t-value="search_tags.mapped('group_id')"/>
                        <ul class="navbar-nav flex-grow-1">
                            <t t-foreach="tag_groups" t-as="tag_group">
                                <t t-set="group_frontend_tags" t-value="tag_group.tag_ids.filtered(lambda tag: tag.color)"/>
                                <li class="nav-item dropdown ml16" t-if="group_frontend_tags">
                                    <a t-att-class="'nav-link dropdown-toggle %s' % ('active' if tag_group in search_tag_groups else '')"
                                        href="/slides/all"
                                        t-att-data-bs-target="'#navToogleTagGroup%s' % tag_group.id"
                                        role="button" data-bs-toggle="dropdown"
                                        aria-haspopup="true" aria-expanded="false"
                                        t-esc="tag_group.name"/>
                                    <div class="dropdown-menu" t-att-id="'navToogleTagGroup%s' % tag_group.id">
                                        <t t-foreach="group_frontend_tags" t-as="tag">
                                            <span t-att-class="'post_link cursor-pointer dropdown-item %s' % ('active' if tag in search_tags else '')"
                                                t-att-data-post="slide_query_url(tag=slugify_tags(search_tags.ids, toggle_tag_id=tag.id), my=search_my, search=search_term, slide_category=search_slide_category, prevent_redirect=True)"
                                                t-esc="tag.name"/>
                                        </t>
                                    </div>
                                </li>
                            </t>
                        </ul>
                        <!-- Clear filtering (desktop)-->
                        <div class="ms-auto d-none d-md-flex" t-if="search_slide_category or search_my or search_tags">
                            <a href="/slides/all" class="btn btn-info text-nowrap me-2" role="button" title="Clear filters">
                                <i class="fa fa-eraser"/> Clear filters
                            </a>
                        </div>
                        <!-- Search box (desktop) -->
                        <t t-call="website.website_search_box_input">
                            <t t-set="_form_classes" t-valuef="o_wslides_nav_navbar_right d-none d-md-flex"/>
                            <t t-set="search_type" t-valuef="slides"/>
                            <!-- No action: remain on same URL -->
                            <t t-set="display_description" t-valuef="true"/>
                            <t t-set="display_detail" t-valuef="false"/>
                            <t t-set="placeholder">Search courses</t>
                            <t t-set="search" t-value="original_search or search_term"/>
                            <input t-if="search_my" type="hidden" name="my" t-att-value="1"/>
                            <input t-if="search_slide_category" type="hidden" name="slide_category" t-att-value="search_slide_category" />
                            <input type="hidden" name="prevent_redirect" value="True"/>
                        </t>
                    </div>
                </nav>
                <div class="o_wprofile_email_validation_container mb16 mt16">
                    <t t-call="website_profile.email_validation_banner">
                        <t t-set="redirect_url" t-value="'/slides'"/>
                        <t t-set="additional_validation_email_message"> and join this Community</t>
                        <t t-set="additional_validated_email_message"> You may now participate in our eLearning.</t>
                    </t>
                </div>
                <!-- Display tags -->
                <t t-if="search_my">
                      <span class="align-items-baseline border d-inline-flex ps-2 rounded mb-2">
                      <i class="fa fa-tag me-2 text-muted"/>
                      My Courses
                      <span t-att-data-post="slide_query_url(tag=slugify_tags(search_tags.ids), search=search_term, prevent_redirect=True)"
                         class="post_link cursor-pointer btn border-0 py-1">&#215;</span>
                    </span>
                </t>
                <t t-if="search_term">
                      <span class="align-items-baseline border d-inline-flex ps-2 rounded mb-2">
                      <i class="fa fa-tag me-2 text-muted"/>
                      <t t-esc="search_term"/>
                      <span t-att-data-post="slide_query_url(tag=slugify_tags(search_tags.ids), my=search_my, slide_category=search_slide_category, prevent_redirect=True)"
                         class="post_link cursor-pointer btn border-0 py-1">&#215;</span>
                    </span>
                </t>
                <t t-foreach="search_tags" t-as="tag">
                    <span class="align-items-baseline border d-inline-flex ps-2 rounded mb-2">
                        <i class="fa fa-tag me-2 text-muted"/>
                        <t t-esc="tag.display_name"/>
                        <span t-att-data-post='slide_query_url(tag=slugify_tags(search_tags.ids, tag.id), my=search_my, search=search_term, slide_category=search_slide_category, prevent_redirect=True)'
                            class="post_link cursor-pointer btn border-0 py-1">&#215;</span>
                    </span>
                </t>
            </div>
            <div class="container o_wslides_home_main pb-5">
                <div t-if="not channels and not search_term and not search_slide_category and not search_my and not search_tags">
                    <p class="h2">No Course created yet.</p>
                    <p groups="website_slides.group_website_slides_officer">Click on "New" in the top-right corner to write your first course.</p>
                </div>
                <div t-elif="search_term and not channels" class="alert alert-info mb-5">
                    No course was found matching your search <code><t t-esc="search_term"/></code>.
                </div>
                <div t-elif="not channels" class="alert alert-info mb-5">
                    No course was found matching your search.
                </div>
                <t t-else="">
                    <div t-if="original_search" class="alert alert-warning mb-5">
                        No results found for '<span t-esc="original_search"/>'. Showing results for '<span t-esc="search_term"/>'.
                    </div>
                    <div class="row mx-n2">
                        <t t-foreach="channels" t-as="channel">
                            <div class="col-12 col-sm-6 col-md-4 col-lg-3 px-2 d-flex">
                                <t t-call="website_slides.course_card"/>
                            </div>
                        </t>
                    </div>
                </t>
            </div>

            <t t-call="website_slides.courses_footer"></t>
        </div>
    </t>
</template>

<template id='courses_footer'>
    <section class="s_banner">
        <div class="oe_structure oe_empty" id="oe_structure_website_slides_course_footer_1"/>
    </section>
</template>

<template id='course_card' name="Course Card">
    <div t-attf-class="card w-100 o_wslides_course_card mb-4 #{'o_wslides_course_unpublished' if not channel.is_published else ''}" t-cache="channel if is_public_user and not search_tags else None">
        <t t-set="channel_frontend_tags" t-value="channel.tag_ids.filtered(lambda tag: tag.color)"/>
        <a t-attf-href="/slides/#{slug(channel)}" t-title="channel.name" style="height:120px">
            <div t-field="channel.image_1920" t-options="{'widget': 'image', 'preview_image': 'image_512'}" class="o_wslides_background_image h-100">
                <t t-if="channel.partner_has_new_content" t-call="website_slides.course_card_information"/>
            </div>
        </a>
        <div class="card-body p-3">
            <a class="card-title h5 mb-2 o_wslides_desc_truncate_2" t-attf-href="/slides/#{slug(channel)}" t-field="channel.name"/>
            <span t-if="not channel.is_published" class="badge text-bg-danger">Unpublished</span>
            <div class="card-text d-flex flex-column flex-grow-1 mt-1">
                <div class="fw-light o_wslides_desc_truncate_3" t-field="channel.description_short"/>
                <div t-if="channel_frontend_tags" class="mt-auto pt-1 o_wslides_desc_truncate_2_badges">
                    <t t-foreach="channel_frontend_tags" t-as="tag">
                        <t t-if="search_tags">
                            <span t-att-data-post="slide_query_url(tag=slugify_tags(search_tags.ids, toggle_tag_id=tag.id), my=search_my, search=search_term, slide_category=search_slide_category, prevent_redirect=True)"
                                t-attf-class="post_link cursor-pointer badge o_badge_clickable #{'o_color_'+str(tag.color) if tag in search_tags else 'o_wslides_channel_tag o_color_0'}" t-esc="tag.name"/>
                        </t>
                        <t t-else="">
                            <span t-att-data-post="slide_query_url(tag=slugify_tags(search_tags.ids, toggle_tag_id=tag.id), my=search_my, search=search_term, slide_category=search_slide_category, prevent_redirect=True)"
                                t-attf-class="post_link cursor-pointer badge o_badge_clickable o_wslides_channel_tag #{'o_color_'+str(tag.color)}" t-esc="tag.name"/>
                        </t>
                    </t>
                </div>
            </div>
        </div>
        <div class="card-footer bg-white text-600 px-3">
            <div class="d-flex justify-content-between align-items-center">
                <small t-if="channel.total_time" class="fw-bold" t-esc="channel.total_time" t-options="{'widget': 'duration', 'unit': 'hour', 'round': 'minute'}"/>
                <div class="d-flex flex-grow-1 justify-content-end">
                    <t t-if="channel.is_member and channel.completed">
                        <span class="badge text-bg-success pull-right"><i class="fa fa-check"/> Completed</span>
                    </t>
                    <div t-elif="channel.is_member and channel.channel_type != 'documentation'" class="progress w-50" style="height: 6px">
                        <div class="progress-bar" role="progressbar" t-att-aria-valuenow="channel.completion" aria-valuemin="0" aria-valuemax="100" t-attf-style="width:#{channel.completion}%;" aria-label="Progress bar"/>
                    </div>
                    <small t-else=""><b t-esc="channel.total_slides"/> steps</small>
                </div>
            </div>
        </div>
    </div>
</template>

<template id="course_card_information" name='Course Information'>
    <t id="course_card_information_content">
    </t>
</template>

<template id="course_card_information_arrow" inherit_id="website_slides.course_card_information"
    active="True" name='New Content Ribbon'>
    <xpath expr="//t[@id='course_card_information_content']" position="inside">
        <span class="o_wslides_arrow">New Content</span>
    </xpath>
</template>

<template id='slides_home_achievements_small' name="Users">
    <t class="o_wslides_home_aside">
    </t>
</template>

<template id="toggle_latest_achievements" inherit_id="website_slides.slides_home_achievements_small" active="True" name='Display Achievements'>
    <xpath expr="//t[hasclass('o_wslides_home_aside')]" position="inside">
        <div t-if="achievements">
            <div class="row o_wslides_home_aside_title">
                <div class="col">
                    <h5 class="m-0">Latest achievements</h5>
                    <hr class="mt-2"/>
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <t t-foreach="achievements" t-as="achievement">
                        <t t-call="website_slides.achievement_card"/>
                    </t>
                </div>
            </div>
        </div>
    </xpath>
</template>

<template id='achievement_card' name="Achivement Card">
    <div class="d-flex g-0 mt8 align-items-center">
        <t t-call="website_slides.slides_misc_user_image">
            <t t-set="user" t-value="achievement.user_id"/>
        </t>
        <div style="line-height: 1.3">
            <span class="fw-bold" t-esc="achievement.user_id.name"/> achieved <span class="fw-bold" t-esc="achievement.badge_id.name"/>
        </div>
    </div>
</template>

<template id='slides_home_users_small' name="Users">
    <div class="o_wslides_home_aside">
    </div>
</template>

<template id="toggle_leaderboard" inherit_id="website_slides.slides_home_users_small" active="True" name='Display Leaderboard'>
    <xpath expr="//div[hasclass('o_wslides_home_aside')]" position="inside">
        <div class="row o_wslides_home_aside_title">
            <div class="col">
                <a t-if="users" href="/profile/users" class="float-end">View all</a>
                <h5 class="m-0">Leaderboard</h5>
                <hr class="mt-2 mb-2"/>
            </div>
        </div>
        <div class="row">
            <t t-if="users">
                <div class="col">
                    <t t-set="counter" t-value="1"/>
                    <t t-foreach="users" t-as="user">
                        <t t-call="website_slides.user_quickkarma_card"/>
                        <t t-set="counter" t-value="counter + 1"/>
                    </t>
                </div>
            </t>
            <t t-else=""><p class="col mt8">No leaderboard currently :(</p></t>
        </div>
    </xpath>
</template>

<template id='user_quickkarma_card' name="User QuickKarma Card">
    <div class="d-flex mb-3 align-items-center">
        <b class="me-2 text-muted" t-esc="counter"/>
        <t t-call="website_slides.slides_misc_user_image"/>
        <div style="line-height:1.3">
            <span class="fw-bold" t-esc="user.name"/>
            <div class="d-flex align-items-center">
                <t t-esc="user.rank_id.name"/>
                <span class="text-500 mx-2">&#8226;</span>
                <span class="badge text-bg-success"><t t-esc="user.karma"/> xp</span>
            </div>
        </div>
    </div>
</template>

<template id='slides_home_user_profile_small' name="User Profile">
    <div class="o_wslides_home_aside">
        <div t-if="user.rank_id" class="d-flex align-items-center">
            <span class="fw-bold text-muted me-2">Current rank:</span>
            <img t-att-src="website.image_url(user.rank_id, 'image_128')" width="16" height="16" alt="" class="o_object_fit_cover me-1"/>
            <a href="/profile/ranks_badges" t-field="user.rank_id"/>
        </div>
        <t t-set="next_rank_id" t-value="user._get_next_rank()"/>
        <div t-if="next_rank_id" class="fw-bold text-muted mt-1">Next rank:</div>
        <t t-if="next_rank_id or user.rank_id" t-call="website_profile.profile_next_rank_card">
            <t t-set="bg_class" t-valuef="bg-200"/>
            <t t-set="img_max_width" t-value="'50%'"/>
        </t>
        <div t-if="next_rank_id" t-field="next_rank_id.description_motivational"/>
        <div t-else="">Congratulations, you have reached the last rank!</div>
    </div>
</template>

<template id='slides_home_user_achievements_small' name="User Achievements">
    <div class="o_wslides_home_aside flex-grow-1">
        <div class="row o_wslides_home_aside_title">
            <div class="col">
                <a href="/profile/ranks_badges?badge_category=slides" class="float-end">View all</a>
                <h5 class="m-0">Badges</h5>
                <hr class="mt-2 mt-2"/>
            </div>
        </div>
        <t t-foreach="challenges" t-as="challenge">
            <t t-set="challenge_done" t-value="challenge in challenges_done if challenges_done else False"/>
            <div t-attf-class="d-flex mb-3 align-items-center #{'o_wslides_entry_muted' if not challenge_done else ''}">
                <div t-if="challenge.reward_id.image_1920" t-field="challenge.reward_id.image_1920"
                    t-options="{'widget': 'image', 'preview_image': 'image_128', 'class': 'me-2', 'style': 'max-height: 36px'}"/>
                <img t-else="" t-attf-src="'/website_profile/static/src/img/badge_%s.svg' % (challenge.reward_id.level)" t-att-alt="challenge.reward_id.name" style="max-height: 36px" class="me-2"/>
                <div class="flex-grow-1">
                    <b class="text_small_caps" t-esc="challenge.reward_id.name"/><br/>
                    <span class="text-muted" t-esc="challenge.reward_id.description"/>
                </div>
                <i t-if="challenge_done" class="fa fa-check h5 text-success" aria-label="Done" title="Done" role="img"></i>
            </div>
        </t>
    </div>
</template>

<template id='slides_misc_user_image' name="User Avatar">
    <img t-attf-class="o_avatar {{img_class or 'rounded-circle float-start'}}"
        t-att-style="img_style if img_style else 'width: 32px; height: 32px;'"
        t-att-src="'/profile/avatar/%s?field=avatar_128' % user.id"
        t-att-alt="user.name"/>
</template>
</data></odoo>