Skip to content

Commit

Permalink
documents: fix thumbnail without external URL
Browse files Browse the repository at this point in the history
* Shows thumbnail if no external URL is set, even if organisation is configured to point to external files.

Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
  • Loading branch information
Sébastien Délèze committed Oct 19, 2020
1 parent b3d016c commit dc5947b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sonar/theme/templates/sonar/macros/macro.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
<div class="text-center {{ class }}">
{% set restricted = file | is_file_restricted(record) %}
{% if not restricted.restricted %}
{% if externalUrl %}
{% if file.external_url %}
{% if externalUrl and file.external_url %}
<a href="{{ file.external_url }}" target="_blank">
<img src="/{{ resource_type }}/{{ record.pid }}/files/{{ thumbnail.key }}" class="img-thumbnail img-fluid"
alt="{{ file_title }}">
</a>
{% endif %}
{% else %}
<a href="/{{ resource_type }}/{{ record.pid }}/preview/{{ file.key }}" data-title="{{ file_title }}"
class="previewLink">
Expand All @@ -38,7 +36,7 @@
</a>
{% endif %}
<p class="my-1 small">{{ file_title }}</p>
{% if not externalUrl %}
{% if not externalUrl or not file.external_url %}
<p class="m-0">
<a href="/{{ resource_type }}/{{ record.pid }}/preview/{{ file.key }}" data-title="{{ file_title }}"
class="previewLink"><i class="fa fa-eye mr-2"></i></a>
Expand Down

0 comments on commit dc5947b

Please sign in to comment.