diff options
| author | Patrick Hoste <pko@odoo.com> | 2019-12-04 09:10:35 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-06-08 10:43:53 +0000 |
| commit | 786374399ef970e4499a73cef9b48a48be88704e (patch) | |
| tree | 5890af2524a6a1dda9ce1ccbba68c530fb81a240 /addons/website_slides/static/src/xml | |
| parent | ad8c53ac2c5bc25ea94d5cddf8d1aa48efad5928 (diff) | |
[IMP] website_slides: add possibility to request access to private course
PURPOSE
Before this commit, a user could not contact a course responsible to ask him
to join. With this commit he is be able to do it.
SPECIFICATIONS
Change the message 'Contact website administrator' to 'Contact Responsible'.
Add the name of the course responsible in the course description panel. When
clicking on its name it opens a modal to request access to the course. It
creates an activity linked to the customer and assigned to the responsible.
When hovering the 'You're enrolled' button the fa-check icon changes to a
fa-times icon to show that you can unsubscribe when clicking.
LINKS
Task ID : 2127364
PR : #40708
Diffstat (limited to 'addons/website_slides/static/src/xml')
| -rw-r--r-- | addons/website_slides/static/src/xml/activity.xml | 22 | ||||
| -rw-r--r-- | addons/website_slides/static/src/xml/slide_course_join.xml | 6 | ||||
| -rw-r--r-- | addons/website_slides/static/src/xml/slide_quiz.xml | 19 |
3 files changed, 45 insertions, 2 deletions
diff --git a/addons/website_slides/static/src/xml/activity.xml b/addons/website_slides/static/src/xml/activity.xml new file mode 100644 index 00000000000..20c683ab3c4 --- /dev/null +++ b/addons/website_slides/static/src/xml/activity.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<templates xml:space="preserve"> + <t t-extend="mail.activity_items"> + <t t-jquery=".o_thread_message .o_thread_message_core .o_thread_message_tools" t-operation="replace"> + <t t-if="activity.activity_type_id[1] == 'Access Request'"> + <t t-if="activity.user_id[0] === uid"> + <a role="button" class="btn btn-link btn-success text-muted text-success o_activity_link o_activity_action_grant_access" t-att-data-partner-id="activity.request_partner_id[0]"> + <i class="fa fa-check"/> Grant Access + </a> + <a role="button" class="btn btn-link btn-danger text-muted text-danger o_activity_link o_activity_action_refuse_access" t-att-data-partner-id="activity.request_partner_id[0]"> + <i class="fa fa-times"/> Refuse Access + </a> + </t> + </t> + <t t-else=""> + <div class="o_thread_message_tools btn-group"> + <t t-call="mail.activity_thread_message_tools"/> + </div> + </t> + </t> + </t> +</templates>
\ No newline at end of file diff --git a/addons/website_slides/static/src/xml/slide_course_join.xml b/addons/website_slides/static/src/xml/slide_course_join.xml index 5c890cd027d..0241915c190 100644 --- a/addons/website_slides/static/src/xml/slide_course_join.xml +++ b/addons/website_slides/static/src/xml/slide_course_join.xml @@ -15,4 +15,10 @@ </a> </div> </t> + + <t t-name="slide.course.join.request"> + <div> + <p>Do you want to request access to this course ?</p> + </div> + </t> </templates> diff --git a/addons/website_slides/static/src/xml/slide_quiz.xml b/addons/website_slides/static/src/xml/slide_quiz.xml index e64bc96604e..aa7bcc3f835 100644 --- a/addons/website_slides/static/src/xml/slide_quiz.xml +++ b/addons/website_slides/static/src/xml/slide_quiz.xml @@ -47,8 +47,23 @@ <div t-if="!widget.isMember"> <div class="o_wslides_join_course alert alert-info d-flex align-items-center justify-content-between"> <div t-if="widget.channel.channelEnroll == 'invite'"> - <b class="h5 mb-0"> - <b>This course is private. <a href="/contactus" class="font-weight-bold">Contact the website administrator</a> to enroll.</b> + <b>This course is private. + <span t-if="widget.publicUser"> + Please + <a t-att-href="'/web/login?redirect=' + widget.redirectURL" class="font-weight-bold"> + sign in + </a> + to enroll. + </span> + <a t-else="" href="#" class="font-weight-bold o_wslides_js_channel_enroll" + t-att-data-channel-id="widget.channel.channelId"> + <span t-if="widget.channel.channelRequestedAccess" class="text-success"> + Responsible already contacted. + </span> + <span t-else=""> + Contact the responsible to enroll. + </span> + </a> </b> <span class="my-0 h4"> <span title="Succeed and gain karma" aria-label="Succeed and gain karma" class="badge badge-pill badge-warning text-white font-weight-bold ml-3 px-2 py-1"> |
