summaryrefslogtreecommitdiff
path: root/addons/website_slides_survey
diff options
context:
space:
mode:
authorstd-odoo <std@odoo.com>2020-09-16 11:54:45 +0000
committerstd-odoo <std@odoo.com>2020-10-08 15:47:20 +0000
commit524b9acb4582321d4d9ee8d21b700a10837cf836 (patch)
treed97a882aeb881ad80ca4b2e337e63a8c1adb55cd /addons/website_slides_survey
parented06aab626cb51b86b4178705b45bbcbfbf2c0f2 (diff)
[FIX] website_slides_survey: fix certification share button
Bug === In the user profile view, we can see the certifications of the current user. If we click on the share button, we are redirected to the course instead of opening the share modal. Technical ========= Since 1f52435966edeb1d57ef8bccce7f82eb0b08a2ae we use an on-lick event to redirect the user when he click on the card. We use the JS event instead of an standard anchor because nested anchors are forbidden in HTML. That cause an issue if we click on a child anchor and if we stay on the same page (which is the case when we open a bootstrap modal) because the on-click event will be triggered. We can not just stop the click propagation otherwise the modal won't be opened. Also, as the bootstrap modal element (`website_slides.slide_share_modal`) is inside the element with the on-click event, so, if we click anywhere on the modal, we will be redirected... So, the solution is to open manually the modal, to stop the click propagation and to move the modal element. Task-2337693 closes odoo/odoo#59542 X-original-commit: 2a63f98bd359907169d14539feaa99a1d83263f0 Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com> Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_slides_survey')
-rw-r--r--addons/website_slides_survey/views/website_profile.xml10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/website_slides_survey/views/website_profile.xml b/addons/website_slides_survey/views/website_profile.xml
index 0679be859de..8d52bb0f189 100644
--- a/addons/website_slides_survey/views/website_profile.xml
+++ b/addons/website_slides_survey/views/website_profile.xml
@@ -26,18 +26,18 @@
<a role="button" class="float-right" t-att-href="'/survey/%s/get_certification' % certificate.survey_id.id">
<i class="fa fa-download" aria-label="Download certification" title="Download Certification"/>
</a>
- <a role="button" class="mr-2" href="#" data-toggle="modal"
- t-att-data-target="'#slideChannelShareModal_%s' % certificate.slide_id.channel_id.id">
+ <a role="button" class="mr-2" href="#"
+ t-attf-onclick="event.stopPropagation(); $('#slideChannelShareModal_#{certificate.slide_id.channel_id.id}').modal('show');">
<i class="fa fa-share-alt" aria-label="Share" title="Share"/>
</a>
</div>
</div>
</div>
- <t t-call="website_slides.slide_share_modal">
- <t t-set="record" t-value="certificate.slide_id.channel_id"/>
- </t>
</div>
</div>
+ <t t-call="website_slides.slide_share_modal">
+ <t t-set="record" t-value="certificate.slide_id.channel_id"/>
+ </t>
</div>
</div>
</t>