OSPPCloudEnterprise3/addons/mx_elearning_plus/views/website_slides_templates_co...

230 lines
15 KiB
XML

<?xml version="1.0" ?>
<odoo><data>
<template id="course_slides_list_collapse" inherit_id="website_slides.course_slides_list">
<div t-att-data-channel-id="channel.id" position="attributes">
<attribute name="class" separator=" " add="o_course_extended"/>
</div>
<div t-att-class="'d-flex align-items-center ps-3 %s' % ('o_wslides_slides_list_drag' if channel.can_publish else '')" position="attributes">
<attribute name="data-toggle">collapse</attribute>
<attribute name="t-att-data-target">'%s%s' % ('#slide-', category_id)</attribute>
<attribute name="aria-expanded">false</attribute>
<attribute name="t-att-aria-controls">category_id</attribute>
<attribute name="id">collapse_div</attribute>
</div>
<xpath expr="//div[@t-if='channel.can_publish and category_id']/i" position="replace">
<i class="fa fa-plus"/>
</xpath>
<ul class="list-unstyled pb-1 border-top" position="replace">
<t t-if="category_id">
<div class="collapse" t-att-id="'slide-%s' % (category_id)">
<ul t-att-data-category-id="category_id" class="list-unstyled pb-1 border-top">
<li class="o_wslides_slides_list_slide o_not_editable border-0"/>
<li class="o_wslides_js_slides_list_empty border-0"/>
<t t-foreach="category['slides']" t-as="slide">
<!-- <t t-if="not slide.is_hide"> -->
<t t-call="website_slides.course_slides_list_slide" />
<!-- </t> -->
<t t-set="j" t-value="j+1"/>
</t>
</ul>
</div>
</t>
<t t-if="not category_id">
<ul t-att-data-category-id="category_id" class="list-unstyled pb-1 border-top">
<li class="o_wslides_slides_list_slide o_not_editable border-0"/>
<li class="o_wslides_js_slides_list_empty border-0"/>
<t t-foreach="category['slides']" t-as="slide">
<t t-call="website_slides.course_slides_list_slide" />
<t t-set="j" t-value="j+1"/>
</t>
</ul>
</t>
</ul>
</template>
<!-- introduction video in courses home page template -->
<template id="course_card_inherit" inherit_id="website_slides.course_card">
<div t-else="" class="o_wslides_background_image" position="before">
<div t-elif="channel.video_embed_code" t-out="channel.video_embed_code" t-options='{"widget": "video_preview", "class": "embed-responsive-item"}' class="o_wslides_background_image h-100">
<t t-if="channel.partner_has_new_content" t-call="website_slides.course_card_information"/>
</div>
</div>
</template>
<!-- introduction video in course main page template -->
<template id="mx_course_slides_course_main" inherit_id="website_slides.course_main">
<div class="d-flex align-items-end justify-content-around h-100" position="replace">
<div class="d-flex align-items-end justify-content-around h-100">
<t t-if="channel.image_1920">
<div t-field="channel.image_1920" t-options='{"widget": "image", "class": "o_wslides_course_pict d-inline-block mb-2 mt-3 my-md-0"}' class="h-100"/>
</t>
<t t-elif="channel.video_embed_code" >
<div t-out="channel.video_embed_code" t-options='{"widget": "video_preview", "class": "o_wslides_course_pict embed-responsive-item d-inline-block mb-2 mt-3 my-md-0"}' class="h-100" style="width:-webkit-fill-available;"/>
</t>
</div>
</div>
</template>
<template id="mx_plus_slide_fullscreen_inherit" inherit_id="website_slides.slide_fullscreen">
<a class="o_wslides_fs_share d-flex align-items-center px-3" position="before">
<div t-if="slide.channel_id.allow_comment" class="o_wslides_js_slide_like_mx d-flex align-items-center px-3">
<span t-attf-class="o_wslides_js_slide_like_up_mx #{'disabled' if not slide.channel_id.can_vote else ''}" tabindex="0" data-bs-toggle="popover" t-att-data-slide-id="slide.id" t-att-data-user-vote="slide.user_vote">
<i t-attf-class="fa fa-1x #{'fa-thumbs-up' if slide.user_vote == 1 else 'fa-thumbs-o-up'}" role="img" aria-label="Likes" title="Like"/>
<span t-field="slide.likes" t-options="{'format_decimalized_number': True}"/>
</span>
<span t-attf-class="o_wslides_js_slide_like_down_mx ms-3 #{'disabled' if not slide.channel_id.can_vote else ''}" tabindex="0" data-bs-toggle="popover" t-att-data-slide-id="slide.id" t-att-data-user-vote="slide.user_vote">
<i t-attf-class="fa fa-1x #{'fa-thumbs-down' if slide.user_vote == -1 else 'fa-thumbs-o-down'}" role="img" aria-label="Dislikes" title="Dislike"/>
<span t-field="slide.dislikes" t-options="{'format_decimalized_number': True}"/>
</span>
</div>
</a>
<a class="o_wslides_fs_review d-flex align-items-center" position="after">
<a class="o_wslides_fs_comment d-flex align-items-center" title="Comments">
<t t-call="mx_elearning_plus.mx_fullscreen_comment">
<t t-set="enable_slide_comments" t-value="0"/>
<t t-set="allow_comment" t-value="slide.channel_id.allow_comment"/>
<t t-set="channel_type" t-value="slide.channel_id.channel_type"/>
<t t-set="can_access_channel" t-value="can_access_channel"/>
<t t-set="comment_count" t-value="slide.comments_count"/>
<t t-set="enroll" t-value="slide.channel_id.enroll"/>
<t t-set="can_comment" t-value="slide.channel_id.can_comment"/>
<t t-set="token" t-value="channel.access_token"/>
<t t-set="hash" t-value="message_post_hash"/>
<t t-set="pid" t-value="message_post_pid"/>
<t t-set="default_message_id" t-value="False"/>
<t t-set="disable_composer" t-value="not (slide.channel_id.can_comment and slide.channel_id.allow_comment)"/>
<t t-set="_link_btn_classes" t-value="'d-inline-block text-white fw-light shadow-none'"/>
<t t-set="icon" t-value="'fa fa-comments'"/>
<t t-set="_text_classes" t-value="'d-none d-md-inline-block'"/>
<t t-set="object" t-value="slide"/>
<t t-set="is_fullscreen" t-value="True"/>
<t t-set="is_comment_fullscreen" t-value="True"/>
</t>
</a>
</a>
</template>
<template id="mx_fullscreen_comment">
<t t-set="display_composer" t-value="not disable_composer and not (request.session.uid and env.user._is_public())"/>
<div class="d-print-none o_comment_popup_composer o_not_editable p-0"
contenteditable="false"
t-att-data-allow_comment="slide.channel_id.allow_comment"
t-att-data-channel_type="slide.channel_id.channel_type"
t-att-data-comments_count="slide.comments_count"
t-att-data-enroll="slide.channel_id.enroll"
t-att-data-can_comment="slide.channel_id.can_comment"
t-att-data-can_access_channel="can_access_channel"
t-att-data-comments="comments"
t-att-data-res_model="object._name"
t-att-data-res_id="object.id"
t-att-data-pid="pid"
t-att-data-hash="hash"
t-att-data-token="token"
t-att-data-partner_id="request.env.user.partner_id.id"
t-att-data-disable_composer="disable_composer"
t-att-data-display_composer="display_composer"
t-att-data-link_btn_classes="_link_btn_classes"
t-att-data-icon="icon"
t-att-data-text_classes="_text_classes"
t-att-data-allow_composer="'0' if disable_composer else '1'"
t-att-data-is_fullscreen="is_fullscreen"
t-att-data-is_comment_fullscreen="is_comment_fullscreen">
<div class="d-flex flex-wrap align-items-center">
<t t-if="not (slide.channel_id.allow_comment and slide.channel_id.channel_type == 'training')">
<button type="button" t-att-class="'o_btn_comment_unable btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
<t t-elif="not slide.comments_count">
<t t-if="not can_access_channel and slide.channel_id.enroll != 'public'">
<button type="button" t-att-class="'o_btn_comment_public btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
<t t-if="not slide.channel_id.can_comment">
<button type="button" t-att-class="'o_btn_no_comment_karma btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
</t>
<t t-else="">
<t t-if="not slide.comments_count and can_access_channel">
<button type="button" t-att-class="'o_btn_comment_karma btn ' + _link_btn_classes or 'btn-primary'">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
</t>
</t>
<button t-if="display_composer" type="button"
t-att-class="'btn ' + _link_btn_classes or 'btn-primary'"
data-bs-toggle="modal" data-bs-target="#commentpopupcomposer">
<i t-if="icon" t-att-class="icon"/>
<span t-attf-class="#{_text_classes}">
<t t-if="is_fullscreen">Comments</t>
<!-- <t t-if="slide.comments_count"> (<t t-out="slide.comments_count"/>)</t> -->
</span>
</button>
<div class="o_comment_popup_composer_modal"/>
</div>
</div>
</template>
<!-- <template id="mx_plus_slide_aside_training_category_inherit" inherit_id="website_slides.slide_aside_training_category">
<div t-att-class="'o_wslides_lesson_aside_list_link d-flex p-1 %s%s' % (('bg-100 active' if aside_slide == slide else ''), 'text-muted' if not can_access else '')" position="attributes">
<attribute name="t-if">not aside_slide.is_hide</attribute>
</div>
<ul class="list-group ps-5 mb-1 list-unstyled" position="attributes">
<attribute name="t-if">(aside_slide._has_additional_resources() or aside_slide.question_ids) and not aside_slide.is_hide</attribute>
</ul>
</template> -->
<template id="mx_plus_slide_fullscreen_sidebar_category_inherit" inherit_id="website_slides.slide_fullscreen_sidebar_category">
<li t-attf-class="o_wslides_fs_sidebar_list_item d-flex py-1 #{'active' if slide.id == current_slide.id else ''}" position="attributes">
<attribute name="t-att-data-allow-comment">slide.channel_id.allow_comment</attribute>
<attribute name="t-att-data-can-vote">slide.channel_id.can_vote</attribute>
<attribute name="t-att-data-user-vote">slide.user_vote if slide.user_vote else 0</attribute>
<attribute name="t-att-data-likes">slide.likes if slide.likes else 0</attribute>
<attribute name="t-att-data-dislikes">slide.dislikes if slide.dislikes else 0</attribute>
<attribute name="t-att-data-channel-type">slide.channel_id.channel_type</attribute>
<attribute name="t-att-data-comments-count">slide.comments_count</attribute>
<attribute name="t-att-data-enroll">slide.channel_id.enroll</attribute>
<attribute name="t-att-data-can-comment">slide.channel_id.can_comment</attribute>
<attribute name="t-att-data-can-access-channel">can_access_channel</attribute>
<attribute name="t-att-data-comments">comments</attribute>
</li>
<!-- <xpath expr="//span[@class='d-block']/div[@class='d-flex']" position="replace">
</xpath>
<a t-if="can_access" class="d-block" href="#" position="replace">
<t t-if="not slide.is_hide">
<a t-if="can_access" class="d-block" href="#">
<div class="d-flex">
<t t-set="icon_class" t-value="'me-2'"/>
<t t-call="website_slides.slide_icon"/>
<div class="o_wslides_fs_slide_name" t-esc="slide.name"/>
</div>
</a>
<span t-else="" class="d-block" href="#">
<div class="d-flex">
<t t-set="icon_class" t-value="'me-2 text-600'"/>
<t t-call="website_slides.slide_icon"/>
<div class="o_wslides_fs_slide_name text-600" t-esc="slide.name"/>
</div>
</span>
</t>
</a>
<ul class="list-unstyled w-100 pt-2 small ps-4" position="attributes">
<attribute name="t-if">(slide._has_additional_resources() and not slide.is_hide) or (slide.question_ids and not slide.slide_category =='quiz' and not slide.is_hide)</attribute>
</ul> -->
</template>
</data></odoo>