From 4e153413d967b197d6772eaf082b675114feba95 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Sun, 17 Sep 2017 19:00:11 +0200 Subject: [PATCH] Fix Download button showing when not logged in --- src/templates/nodes/custom/_node_details.pug | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/templates/nodes/custom/_node_details.pug b/src/templates/nodes/custom/_node_details.pug index 75b92065..7eb2560d 100644 --- a/src/templates/nodes/custom/_node_details.pug +++ b/src/templates/nodes/custom/_node_details.pug @@ -36,7 +36,7 @@ span Public | {% endif %} - | {% if node.file %} + | {% if node.file and node.file.link %} li.download | {% if node.properties.content_type == 'video' %} | {% if node.file_variations %} @@ -63,21 +63,23 @@ | {% endfor %} | {% endif %} | {% else %} - a( - title="Download {{ node.properties.content_type | undertitle }}", - href="{{ node.file.link }}", - download="{{ node.file.filename }}") - button.btn(type="button") - i.pi-download - | Download + li.download + a( + title="Download {{ node.properties.content_type | undertitle }}", + href="{{ node.file.link }}", + download="{{ node.file.filename }}") + button.btn(type="button") + i.pi-download + | Download | {% endif %} | {% else %} - a.btn( - title="Login to download {{ node.properties.content_type | undertitle }}", - href="{{ url_for('users.login') }}") - i.pi-lock - | Download + li.download + a.btn( + title="Login to download {{ node.properties.content_type | undertitle }}", + href="{{ url_for('users.login') }}") + i.pi-lock + | Download | {% endif %}