516 lines
31 KiB
XML
516 lines
31 KiB
XML
<?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("/website_slides/static/src/img/banner_default.svg"); 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>
|
|
</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("/website_slides/static/src/img/banner_default_all.svg"); 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("/website_slides/static/src/img/banner_default_all.svg"); 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("/website_slides/static/src/img/banner_default_all.svg"); 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" />
|
|
</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">
|
|
<a rel="nofollow" t-att-class="'dropdown-item post_link %s' % ('active' if tag in search_tags else '')"
|
|
t-att-href="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)"
|
|
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" />
|
|
</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
|
|
<a t-att-href="slide_query_url(tag=slugify_tags(search_tags.ids), search=search_term)" class="btn border-0 py-1 post_link" t-att-rel="search_tags and 'nofollow'">×</a>
|
|
</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"/>
|
|
<a t-att-href="slide_query_url(tag=slugify_tags(search_tags.ids), my=search_my, slide_category=search_slide_category)" class="btn border-0 py-1 post_link" t-att-rel="search_tags and 'nofollow'">×</a>
|
|
</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"/>
|
|
<a t-att-href='slide_query_url(tag=slugify_tags(search_tags.ids, tag.id), my=search_my, search=search_term, slide_category=search_slide_category)' class="btn border-0 py-1 post_link" t-att-rel="search_tags and 'nofollow'">×</a>
|
|
</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 p-1">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">
|
|
<a t-att-href="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)" t-attf-class="badge post_link #{'text-bg-primary' if tag in search_tags else 'o_wslides_channel_tag o_tag_color_0'}" t-att-rel="search_tags and 'nofollow'" t-esc="tag.name"/>
|
|
</t>
|
|
<t t-else="">
|
|
<a t-att-href="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)" t-attf-class="badge post_link o_wslides_channel_tag #{'o_tag_color_'+str(tag.color)}" t-att-rel="search_tags and 'nofollow'" 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 rounded-pill text-bg-success pull-right py-1 px-2"><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}%;"/>
|
|
</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">•</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>
|