Permalink
Browse files

[FIX] website_slides: hide slide download button if not available

Task #1923443

Purpose
=======

The slides on the website showed the 'download' button regardless of the value of the 'download_security' field.
If the value is 'none', meaning that the slides are never downloadable, the button should be hidden.

closes #29904

closes #30051
  • Loading branch information...
awa-odoo committed Jan 8, 2019
1 parent 5f12e24 commit e2bdb65321264322cd94ffa460f0856ca19b5f12
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/website_slides/view/website_slides_embed.xml
@@ -133,7 +133,7 @@
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center"></div>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pull-right text-right">
<a t-if="slide.download_security and not is_embedded" target="_top" t-attf-href="/slides/slide/#{slug(slide)}/download" title="Download" id="download">
<a t-if="slide.download_security != 'none' and not is_embedded" target="_top" t-attf-href="/slides/slide/#{slug(slide)}/download" title="Download" id="download">
<i class="fa fa-download fa-2x"></i>
</a>
<span id="fullscreen" title="View fullscreen">

4 comments on commit e2bdb65

@sswapnesh

This comment has been minimized.

Copy link
Contributor

sswapnesh replied Jan 16, 2019

Are we also checking if option is set to 'Authenticated Users only'?

@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor

tde-banana-odoo replied Jan 17, 2019

Actually we don't need as it will redirect users to login page if they are not logged.

@sswapnesh

This comment has been minimized.

Copy link
Contributor

sswapnesh replied Jan 17, 2019

@sswapnesh

This comment has been minimized.

Copy link
Contributor

sswapnesh replied Jan 17, 2019

Hello @tde-banana-odoo (Cc @awa-odoo As we are already discussing this here #30281 (comment))

Redirect users to login is okay but still It doesn't consider when Download Security is User (Authenticated Users Only)

Eg, Create new Slide and Set Download Security to user

Go to Website --> Open Slide --> Click Download --> Login as Public user and You can download Slide even it is supposed to be downloaded for Authenticated Users Only

Ps: Instead of messing with route to check Login/Public User I will prefer #30281 (else we have to check for Download Security and User type there)

Please sign in to comment.