Debian Codegraph @

addons/website_slides/views/website_slides_templates_homepage.xml

raw symbols SCIP
1 <?xml version="1.0" ?>
2 <odoo><data>
3
4 <template id="courses_home_side_bar">
5 <div class="container o_wslides_home_main">
6 <div class="row">
7 <t t-set="has_side_column" t-value="not is_public_user"/>
8 <!-- To do: remove in Master since it’s no longer shown. -->
9 <t t-if="is_public_user">
10 <div t-if="has_side_column">
11 <div class="row">
12 <div class="col-12 col-md-5 col-lg-12">
13 <div class="ps-md-5 ps-lg-0">
14 <t t-call="website_slides.slides_home_users_small"/>
15 </div>
16 </div>
17 </div>
18 </div>
19 </t>
20 <div t-else="">
21 <t t-set="has_side_column" t-value="True"/>
22 <div class="o_wslides_home_aside_loggedin card p-3 p-lg-0 mb-4">
23 <div id="o_wslides_home_aside_content" class="d-none d-lg-block">
24 <div class="row g-0 mb-5 mt-3 mt-lg-0">
25 <div class="col-12 col-sm-6 col-lg-12">
26 <t t-call="website_slides.slides_home_user_profile_small"/>
27 </div>
28 <div class="col-12 col-sm-6 col-lg-12 ps-md-5 ps-lg-0 mt-lg-4">
29 <t t-call="website_slides.slides_home_user_achievements_small"/>
30 </div>
31 <div class="col-12 col-md-7 col-lg-12 ps-md-5 ps-lg-0 mt-lg-4 mb-3">
32 <t t-call="website_slides.slides_home_achievements_small"/>
33 </div>
34 <div class="col-12 col-sm-6 col-lg-12 ps-md-5 ps-lg-0 mt-lg-4">
35 <t t-call="website_slides.slides_home_users_small"/>
36 </div>
37 </div>
38 </div>
39 </div>
40 </div>
41 </div>
42 </div>
43 </template>
44
45 <template id="courses_my">
46 <div t-if="channels_my" class="container">
47 <div class="o_wslides_home_content_section mb-5">
48 <div class="d-flex justify-content-between">
49 <h2 class="h5 mb-3">My courses</h2>
50 <a t-if="channels_my[5:]" href="/slides?my=1">View all</a>
51 </div>
52 <div t-foreach="channels_my[:5]" t-as="channel">
53 <div class="row">
54 <div class="col-5 d-flex align-items-center my-2">
55 <a t-attf-href="/slides/#{slug(channel)}" t-out="channel.name"/>
56 <span t-if="not channel.is_published" class="badge text-bg-danger ms-1">Unpublished</span>
57 </div>
58 <div class="col-5 d-flex justify-content-between align-items-center">
59 <div t-if="channel.completed" class="badge rounded-pill text-bg-success pull-right">
60 <i class="fa fa-check"/> Completed
61 </div>
62 <t t-elif="not channel.completion">
63 <small class="text-muted d-none d-md-inline"><i class="fa fa-check me-1" role="img"/>You are enrolled</small>
64 <div class="d-md-none">0 %</div>
65 </t>
66 <t t-else="">
67 <div class="d-none d-md-block flex-grow-1">
68 <div class="progress me-3" style="height: 6px">
69 <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"/>
70 </div>
71 </div>
72 <div class="text-start" style="width: 6ch;"><t t-out="channel.completion"/> %</div>
73 </t>
74 <div class="text-muted d-flex">
75 <div t-out="'{:.1f}'.format(channel.total_time or 0).removesuffix('.0') if channel.total_time &lt; 1 else round(channel.total_time)" class="text-end pe-1" style="width: 3ch;"/>
76 hours
77 </div>
78 </div>
79 <div t-if="not channel.completed" class="col-2 d-flex flex-row-reverse align-items-center">
80 <a t-if="not channel.completion" role="button" class="btn btn-sm btn-primary" t-attf-href="/slides/#{slug(channel)}">
81 <span class="d-none d-md-inline me-2 me-md-0">Start now</span><i class="oi oi-arrow-right d-md-none" aria-hidden="true"/>
82 </a>
83 <a t-else="" role="button" class="align-items-center" t-attf-href="/slides/#{slug(channel)}">
84 <span class="me-2 d-none d-md-inline">Continue</span><i class="oi oi-arrow-right" aria-hidden="true"/>
85 </a>
86 </div>
87 <div t-else="" class="col-2">&amp;nbsp;</div>
88 </div>
89 <div t-if="not channel_last" class="row mx-1 my-1">
90 <hr class="m-0"/>
91 </div>
92 </div>
93 </div>
94 </div>
95 </template>
96
97 <!-- Channels home template -->
98 <template id='courses_home' name="Odoo Courses Homepage">
99 <t t-set="body_classname" t-value="'o_wslides_body'"/>
100 <t t-set="has_side_column" t-value="not is_public_user"/>
101 <t t-call="website.layout">
102 <div id="wrap" class="wrap o_wslides_wrap">
103 <div class="oe_structure oe_empty"/>
104 <div class="container">
105 <t t-call="website_slides.courses_search_bar"/>
106 <div class="row">
107 <div t-attf-class="#{'col-12 col-lg-8 col-xl-9 pe-lg-5' if has_side_column else 'col-12'}">
108 <div t-if="invite_error_msg" role="alert" class="o_not_editable alert alert-danger text-center" t-out="invite_error_msg"/>
109 <div class="o_wslides_home_nav">
110 <div class="o_wprofile_email_validation_container">
111 <t t-call="website_profile.email_validation_banner">
112 <t t-set="redirect_url" t-value="'/slides'"/>
113 <t t-set="send_alert_classes" t-value="'alert alert-danger alert-dismissable mt-4 mb-0'"/>
114 <t t-set="done_alert_classes" t-value="'alert alert-success alert-dismissable mt-4 mb-0'"/>
115 <t t-set="additional_validation_email_message"> and join this Community</t>
116 <t t-set="additional_validated_email_message"> You may now participate in our eLearning.</t>
117 </t>
118 </div>
119 </div>
120 <div class="container o_wslides_home_content_section mb-3 d-none"
121 t-if="not len(channels)">
122 <p class="h2">No Course created yet.</p>
123 <p groups="website_slides.group_website_slides_officer">Click on "New" in the top-right corner to write your first course.</p>
124 </div>
125 <t t-call="website_slides.courses_my"/>
126 <t t-call="website_slides.courses_search_results"/>
127 </div>
128 <div t-if="has_side_column" class="d-none d-lg-block col-lg-4 col-xl-3">
129 <t t-call="website_slides.courses_home_side_bar"/>
130 </div>
131 </div>
132 </div>
133 <div class="offcanvas offcanvas-end" tabindex="-1" id="o_wslides_overview_offcanvas" aria-labelledby="o_wslides_overview_offcanvas_header">
134 <div class="offcanvas-header">
135 <h2 class="h5 offcanvas-title" id="o_wslides_overview_offcanvas_header">Overview</h2>
136 <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"/>
137 </div>
138 <div class="offcanvas-body o_wslides_home_aside_loggedin d-flex flex-column gap-4">
139 <t t-if="is_public_user">
140 <t t-call="website_slides.slides_home_users_small"/>
141 </t>
142 <t t-else="">
143 <t t-call="website_slides.slides_home_user_profile_small"/>
144 <t t-call="website_slides.slides_home_user_achievements_small"/>
145 <t t-call="website_slides.slides_home_achievements_small"/>
146 <t t-call="website_slides.slides_home_users_small"/>
147 </t>
148 </div>
149 </div>
150 <t t-call="website_slides.courses_footer"></t>
151 <!-- Off canvas filters on mobile -->
152 <div id="o_wslides_index_offcanvas" class="o_website_offcanvas offcanvas offcanvas-end d-lg-none p-0 overflow-visible">
153 <div class="offcanvas-header">
154 <h5 class="offcanvas-title">Filters</h5>
155 <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"/>
156 </div>
157 <div class="offcanvas-body p-0">
158 <div class="accordion accordion-flush">
159 <!-- Tag Groups Filters -->
160 <div class="accordion-item" t-foreach="tag_groups" t-as="tag_group">
161 <t t-set="group_frontend_tags" t-value="tag_group.tag_ids.filtered('color')"/>
162 <t t-if="group_frontend_tags">
163 <h2 class="accordion-header">
164 <button class="accordion-button collapsed"
165 type="button"
166 data-bs-toggle="collapse"
167 t-attf-aria-controls="o_wslides_offcanvas_cat_#{tag_group.id}"
168 t-att-data-bs-target="'.o_wslides_offcanvas_cat_%s' % tag_group.id"
169 aria-expanded="false"
170 >
171 <t t-out="tag_group.name"/>
172 </button>
173 </h2>
174 <div t-attf-id="o_wslides_offcanvas_cat_#{tag_group.id}" t-attf-class="o_wslides_offcanvas_cat_#{tag_group.id} accordion-collapse collapse">
175 <div class="accordion-body pt-0">
176 <ul class="list-group list-group-flush">
177 <li t-foreach="group_frontend_tags" t-as="tag" class="list-group-item border-0 px-0">
178 <div 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)"
179 class="post_link text-reset cursor-pointer" t-att-title="tag.name">
180 <div class="form-check">
181 <input class="form-check-input pe-none" type="checkbox" t-attf-name="#{tag.color}" t-att-checked="tag in search_tags"/>
182 <label class="form-check-label" t-attf-for="#{tag.color}" t-out="tag.name"/>
183 </div>
184 </div>
185 </li>
186 </ul>
187 </div>
188 </div>
189 </t>
190 </div>
191 </div>
192 </div>
193 <div class="offcanvas-body flex-grow-0 border-top overflow-hidden">
194 <a href="/slides" class="btn btn-light">Clear Filters</a>
195 </div>
196 </div>
197 <!-- Search Modal for Mobile -->
198 <div
199 id="o_wslides_search_modal"
200 class="modal fade css_editable_mode_hidden"
201 aria-hidden="true"
202 tabindex="-1"
203 >
204 <div class="modal-dialog modal-lg pt-5">
205 <div class="modal-content mt-5 bg-transparent border-0">
206 <div class="o_container_small">
207 <t t-call="website.website_search_box_input">
208 <t t-set="default_style" t-valuef="true"/>
209 <t t-set="search_type" t-valuef="slides"/>
210 <t t-set="_classes" t-valuef="input-group rounded o_cc o_cc1 mb-1"/>
211 <t t-set="_input_classes" t-valuef="border-0 p-3"/>
212 <t t-set="_submit_classes" t-valuef="px-4"/>
213 <t t-set="placeholder">Search courses</t>
214 <t t-set="search" t-value="original_search or search_term"/>
215 <input type="hidden" name="my" t-attf-value="#{1 if search_my else 0}"/>
216 <input t-if="search_slide_category" type="hidden" name="slide_category" t-att-value="search_slide_category" />
217 <input type="hidden" name="prevent_redirect" value="True"/>
218 </t>
219 </div>
220 </div>
221 </div>
222 </div>
223 </div>
224 </t>
225 </template>
226
227 <template id="courses_search_bar">
228 <!-- Navbar dynamically composed using displayed channel tag groups. -->
229 <div class="d-flex flex-wrap align-items-md-center gap-2 mt-4 mb-3">
230 <h1 class="h4 mb-0 me-auto">Courses</h1>
231 <div class="d-flex gap-2 flex-grow-1 flex-md-grow-0 align-items-start">
232 <!-- Desktop tag groups -->
233 <div id="navbarTagGroups" class="d-none d-lg-block">
234 <t t-set="search_tag_groups" t-value="search_tags.mapped('group_id')"/>
235 <ul class="list-unstyled d-flex flex-wrap gap-2 mb-0">
236 <t t-foreach="tag_groups" t-as="tag_group">
237 <t t-set="group_frontend_tags" t-value="tag_group.tag_ids.filtered(lambda tag: tag.color)"/>
238 <li class="dropdown" t-if="group_frontend_tags">
239 <a t-att-class="'btn btn-light dropdown-toggle %s' % ('active' if tag_group in search_tag_groups else '')"
240 href="/slides"
241 t-att-data-bs-target="'#navToogleTagGroup%s' % tag_group.id"
242 role="button" data-bs-toggle="dropdown"
243 aria-haspopup="true" aria-expanded="false"
244 t-out="tag_group.name"/>
245 <div class="dropdown-menu" t-att-id="'navToogleTagGroup%s' % tag_group.id">
246 <t t-foreach="group_frontend_tags" t-as="tag">
247 <span t-att-class="'post_link cursor-pointer dropdown-item %s' % ('active' if tag in search_tags else '')"
248 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)"
249 t-out="tag.name"/>
250 </t>
251 </div>
252 </li>
253 </t>
254 </ul>
255 </div>
256 <div class="d-flex gap-2 align-items-center ms-auto">
257 <t t-call="website.website_search_box_input">
258 <t t-set="_classes" t-valuef="d-none d-md-flex"/>
259 <t t-set="search_type" t-valuef="slides"/>
260 <!-- No action: remain on same URL -->
261 <t t-set="display_description" t-valuef="true"/>
262 <t t-set="display_detail" t-valuef="false"/>
263 <t t-set="placeholder">Search courses</t>
264 <t t-set="search" t-value="original_search or search_term"/>
265 <input type="hidden" name="my" t-attf-value="#{1 if search_my else 0}"/>
266 <input t-if="search_slide_category" type="hidden" name="slide_category" t-att-value="search_slide_category" />
267 <input type="hidden" name="prevent_redirect" value="True"/>
268 </t>
269 <!-- Mobile Search button -->
270 <a
271 class="btn o_not_editable d-md-none btn-light"
272 data-bs-target="#o_wslides_search_modal"
273 data-bs-toggle="modal"
274 role="button"
275 title="Search Courses"
276 href="#"
277 >
278 <i class="oi oi-search" role="img"/>
279 </a>
280 <!-- Mobile Filter button -->
281 <button class="o_not_editable btn btn-light position-relative d-lg-none"
282 data-bs-toggle="offcanvas"
283 data-bs-target="#o_wslides_index_offcanvas">
284 <i class="fa fa-sliders"/>
285 <span t-if="search_tags or search_my"
286 class="position-absolute top-0 start-100 translate-middle border border-light rounded-circle bg-danger p-1"
287 />
288 </button>
289 <a t-if="not request.env.user._is_public()" class="btn d-block d-lg-none p-0" data-bs-toggle="offcanvas" href="#o_wslides_overview_offcanvas" role="button" aria-controls="o_wslides_overview_offcanvas">
290 <t t-call="website_slides.slides_misc_user_image">
291 <t t-set="img_class" t-value="'o_wslides_user_avatar rounded-circle'"/>
292 </t>
293 </a>
294 </div>
295 </div>
296 </div>
297 </template>
298
299 <template id="courses_search_tags">
300 <t t-if="search_my">
301 <span class="align-items-baseline border d-inline-flex ps-2 rounded mb-2">
302 <i class="fa fa-tag me-2 text-muted"/>
303 My Courses
304 <span t-att-data-post="slide_query_url(tag=slugify_tags(search_tags.ids), search=search_term, prevent_redirect=True)"
305 class="post_link cursor-pointer btn border-0 py-1">&#215;</span>
306 </span>
307 </t>
308 <t t-if="search_term">
309 <span class="align-items-baseline border d-inline-flex ps-2 rounded mb-2">
310 <i class="fa fa-tag me-2 text-muted"/>
311 <t t-out="search_term"/>
312 <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)"
313 class="post_link cursor-pointer btn border-0 py-1">&#215;</span>
314 </span>
315 </t>
316 <t t-foreach="search_tags" t-as="tag">
317 <span class="align-items-baseline border d-inline-flex ps-2 rounded mb-2">
318 <i class="fa fa-tag me-2 text-muted"/>
319 <t t-out="tag.display_name"/>
320 <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)"
321 class="post_link cursor-pointer btn border-0 py-1">&#215;</span>
322 </span>
323 </t>
324 </template>
325
326 <template id="courses_search_results">
327 <div class="o_wslides_home_main pb-5">
328 <h2 t-if="not search_term and not search_slide_category and not search_my and not search_tags and channels" class="h5 mb-3">All Courses</h2>
329 <t t-call="website_slides.courses_search_tags"/>
330 <div t-if="not channels and not search_term and not search_slide_category and not search_my and not search_tags" class="text-center">
331 <p class="h2 h3">No Course created yet.</p>
332 <p groups="website_slides.group_website_slides_officer">Click on "New" in the top-right corner to write your first course.</p>
333 </div>
334 <div t-elif="search_term and not channels" class="alert alert-info mb-5">
335 No course was found matching your search <code><t t-out="search_term"/></code>.
336 </div>
337 <div t-elif="not channels" class="alert alert-info mb-5">
338 No course was found matching your search.
339 </div>
340 <t t-else="">
341 <div t-if="original_search" class="alert alert-warning mb-5">
342 No results found for '<span t-out="original_search"/>'. Showing results for '<span t-out="search_term"/>'.
343 </div>
344 <div t-attf-class="row g-4 g-lg-3 g-xxl-4 #{'row-cols-1 row-cols-sm-2 row-cols-xl-4' if (is_public_user and not has_side_column) else 'row-cols-1 row-cols-sm-2 row-cols-xl-3'}">
345 <t t-foreach="channels" t-as="channel">
346 <div class="d-flex">
347 <t t-call="website_slides.course_card"/>
348 </div>
349 </t>
350 </div>
351 </t>
352 <div class="d-flex justify-content-center" t-if="pager">
353 <t t-call="website.pager"/>
354 </div>
355 </div>
356 </template>
357
358 <template id='courses_footer'>
359 <section class="s_banner">
360 <div class="oe_structure oe_empty" id="oe_structure_website_slides_course_footer_1"/>
361 </section>
362 </template>
363
364 <template id='course_card' name="Course Card">
365 <a t-attf-href="/slides/#{slug(channel)}" t-title="channel.name" t-attf-class="card o_wslides_course_card w-100 h-100 text-decoration-none #{'o_wslides_course_unpublished' if not channel.is_published else ''}">
366 <t t-set="channel_frontend_tags" t-value="channel.tag_ids.filtered(lambda tag: tag.color)"/>
367 <div>
368 <div t-field="channel.image_1920" t-options="{'widget': 'image', 'preview_image': 'image_512'}" class="o_wslides_background_image ratio ratio-16x9"/>
369 <t t-if="channel.partner_has_new_content" t-call="website_slides.course_card_information"/>
370 </div>
371 <div class="card-body">
372 <h3 class="o_line_clamp card-title h6" t-field="channel.name"/>
373 <span t-if="not channel.is_published" class="badge text-bg-danger">Unpublished</span>
374 <div class="card-text d-flex flex-column flex-grow-1 mt-1">
375 <div class="o_line_clamp small" t-field="channel.description_short"/>
376 <div t-if="channel_frontend_tags" class="small o_wslides_desc_truncate_2_badges">
377 <t t-foreach="channel_frontend_tags" t-as="tag">
378 <t t-if="search_tags">
379 <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)"
380 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-out="tag.name"/>
381 </t>
382 <t t-else="">
383 <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)"
384 t-attf-class="post_link cursor-pointer badge o_badge_clickable o_wslides_channel_tag #{'o_color_'+str(tag.color)}" t-out="tag.name"/>
385 </t>
386 </t>
387 </div>
388 </div>
389 </div>
390 <div t-attf-class="card-footer d-flex align-items-center #{'justify-content-between' if channel.total_time else 'justify-content-end'}">
391 <t t-if="channel.completion and not channel.completed">
392 <div class="d-flex align-items-center gap-2 flex-basis-50">
393 <div class="progress flex-grow-1" style="height: 6px">
394 <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"/>
395 </div>
396 <small><t t-out="channel.completion"/>%</small>
397 </div>
398 <button class="btn btn-sm btn-primary">Continue</button>
399 </t>
400 <t t-elif="channel.is_member and not channel.completion">
401 <small t-if="channel.total_time" t-out="channel.total_time" t-options="{'widget': 'duration', 'unit': 'hour', 'round': 'minute', 'format': 'narrow'}"/>
402 <button class="btn btn-sm btn-primary">Start now</button>
403 </t>
404 <span t-elif="channel.is_member and channel.completed" class="badge text-bg-success"><i class="fa fa-check" aria-hidden="true"/> Completed</span>
405 <t t-else="">
406 <small t-if="channel.total_time" t-out="channel.total_time" t-options="{'widget': 'duration', 'unit': 'hour', 'round': 'minute', 'format': 'narrow'}"/>
407 <small><t t-out="channel.total_slides"/> steps</small>
408 </t>
409 </div>
410 </a>
411 </template>
412
413 <template id="course_card_information" name='Course Information'>
414 <t id="course_card_information_content">
415 </t>
416 </template>
417
418 <template id="course_card_information_badge" inherit_id="website_slides.course_card_information"
419 active="True" name='New Content Badge'>
420 <xpath expr="//t[@id='course_card_information_content']" position="inside">
421 <span class="position-absolute top-0 badge bg-secondary mt-2 ms-2">New Content</span>
422 </xpath>
423 </template>
424
425 <template id='slides_home_achievements_small' name="Users">
426 <div class="o_wslides_home_aside">
427 </div>
428 </template>
429
430 <template id="toggle_latest_achievements" inherit_id="website_slides.slides_home_achievements_small" active="True" name='Display Achievements'>
431 <xpath expr="//div[hasclass('o_wslides_home_aside')]" position="inside">
432 <div t-if="achievements">
433 <h2 class="h6 mb-3">Latest achievements</h2>
434 <div class="d-flex flex-column gap-3">
435 <t t-foreach="achievements" t-as="achievement">
436 <t t-call="website_slides.achievement_card"/>
437 </t>
438 </div>
439 </div>
440 </xpath>
441 </template>
442
443 <template id='achievement_card' name="Achivement Card">
444 <div class="d-flex gap-2">
445 <t t-call="website_slides.slides_misc_user_image">
446 <t t-set="user" t-value="achievement.user_id"/>
447 </t>
448 <div>
449 <div class="lh-1" t-out="achievement.user_id.name"/>
450 <small class="text-muted" t-out="achievement.badge_id.name"/>
451 </div>
452 </div>
453 </template>
454
455 <template id='slides_home_users_small' name="Users">
456 <div class="o_wslides_home_aside">
457 </div>
458 </template>
459
460 <template id="toggle_leaderboard" inherit_id="website_slides.slides_home_users_small" active="True" name='Display Leaderboard'>
461 <xpath expr="//div[hasclass('o_wslides_home_aside')]" position="inside">
462 <div t-if="not is_public_user" class="d-flex justify-content-between">
463 <h2 class="h6 mb-3">Leaderboard</h2>
464 <a t-if="users" href="/profile/users">View all</a>
465 </div>
466 <t t-if="users">
467 <div class="d-flex flex-column gap-3">
468 <t t-foreach="users" t-as="user">
469 <t t-call="website_slides.user_quickkarma_card"/>
470 </t>
471 </div>
472 </t>
473 <t t-else=""><p class="text-muted">No leaderboard currently :(</p></t>
474 </xpath>
475 </template>
476
477 <template id='user_quickkarma_card' name="User QuickKarma Card">
478 <div class="d-flex align-items-start gap-2">
479 <t t-call="website_slides.slides_misc_user_image"/>
480 <div class="flex-grow-1">
481 <div class="lh-1" t-out="user.name"/>
482 <div class="d-flex align-items-center">
483 <small class="text-muted" t-out="user.rank_id.name"/>
484 </div>
485 </div>
486 <div class="small">
487 <span class="badge bg-light"><t t-out="user.karma"/> xp</span>
488 </div>
489 </div>
490 </template>
491
492 <template id='slides_home_user_profile_small' name="User Profile">
493 <div class="position-relative d-flex justify-content-between gap-3 mb-4">
494 <div class="d-flex gap-2">
495 <t t-call="website_slides.slides_misc_user_image">
496 <t t-set="img_class" t-value="'o_wslides_user_avatar rounded-circle'"/>
497 </t>
498 <div class="lh-1">
499 <h6 t-out="user.name" class="mb-0"/>
500 <span class="text-muted"><t t-out="user.karma"/>XP</span>
501 </div>
502 </div>
503 <a class="stretched-link" t-att-href="'/profile/user/%s' % user.id">View</a>
504 </div>
505 <div class="o_wslides_home_aside">
506 <t t-set="next_rank_id" t-value="user._get_next_rank()"/>
507 <div t-if="next_rank_id">
508 <t t-call="website_profile.profile_next_rank_card"/>
509 <div t-field="next_rank_id.description_motivational" class="mt-3 rounded p-3 bg-100"/>
510 </div>
511 <div t-else="" class="mt-3">Congratulations, you have reached the last rank!</div>
512 </div>
513 </template>
514
515 <template id='slides_home_user_achievements_small' name="User Achievements">
516 <div class="o_wslides_home_aside flex-grow-1">
517 <div class="d-flex justify-content-between">
518 <h2 class="h6 mb-3">Badges</h2>
519 <a href="/profile/ranks_badges?badge_category=slides">View all</a>
520 </div>
521 <t t-foreach="challenges" t-as="challenge">
522 <t t-set="challenge_done" t-value="challenge in challenges_done if challenges_done else False"/>
523 <div t-attf-class="d-flex #{'opacity-50' if challenge_done else ''}">
524 <div t-if="challenge.reward_id.image_1920" class="flex-shrink-0" t-field="challenge.reward_id.image_1920"
525 t-options="{'widget': 'image', 'preview_image': 'image_128', 'class': 'me-2', 'style': 'max-height: 36px'}"/>
526 <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="flex-shrink-0 me-2"/>
527 <div class="flex-grow-1">
528 <div class="lh-1" t-out="challenge.reward_id.name"/>
529 <small class="text-muted" t-out="challenge.reward_id.description"/>
530 </div>
531 <i t-if="challenge_done" class="fa fa-check text-success" aria-label="Done" title="Done" role="img"/>
532 </div>
533 </t>
534 </div>
535 </template>
536
537 <template id='slides_misc_user_image' name="User Avatar">
538 <img t-attf-class="o_avatar {{img_class or 'rounded-circle'}}"
539 t-att-style="img_style if img_style else ''"
540 t-att-src="'/profile/avatar/%s?field=avatar_128' % user.id"
541 t-att-alt="user.name"/>
542 </template>
543 </data></odoo>