Skip to content

Commit

Permalink
Update HTML to conditionally show thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbiggs committed Mar 14, 2024
1 parent 1c41bfc commit eb86574
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions templates/search/blocks/search_results__list-card--grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ <h4 class="tna-heading-s">
{% if record.is_digitised %}
{% if record.closure_status not in closure_closed_status %}
<div class="search-results__list-card-delivery-options--grid">
<a href="{% record_url record %}" aria-hidden="true" tabindex="-1" data-link="{{ record.reference_prefixed_summary_title }}" data-link-type="Search result thumbnail link" data-position="{{forloop.counter0}}" search-bucket="{{ buckets.current.label }}">
<img src="{{ record.thumbnail }}" class="search-results__list-card-delivery-options-img search-image-grid" alt="" />
</a>
{% if record.thumbnail %}
<a href="{% record_url record %}" aria-hidden="true" tabindex="-1" data-link="{{ record.reference_prefixed_summary_title }}" data-link-type="Search result thumbnail link" data-position="{{forloop.counter0}}" search-bucket="{{ buckets.current.label }}">
<img src="{{ record.thumbnail }}" class="search-results__list-card-delivery-options-img search-image-grid" alt="" />
</a>
{% endif %}
<a href="{% record_url record %}" class="search-results__list-card-delivery-options-link">
<p class="search-results__list-card-delivery-options-desc search-results-grid">
<span class="sr-only">{{ record.reference_prefixed_summary_title }} is</span>
Expand Down
3 changes: 2 additions & 1 deletion templates/search/blocks/search_results__list-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ <h3 class="tna-heading-m tna-heading--no-link-arrow">
</dl>
</div>

{% if record.is_digitised or apply_teaser_image %}
{% if record.thumbnail or apply_teaser_image %}
<div class="search-results__list-card-image">
{% if record.is_digitised %}
{% if record.closure_status not in closure_closed_status %}
<div class="search-results__list-card-delivery-options">
<a href="{% record_url record %}" class="search-results__list-card-image-anchor" aria-hidden="true" tabindex="-1" data-link="{{ record.reference_prefixed_summary_title }}" data-link-type="Search result thumbnail link" data-position="{{forloop.counter0}}" search-bucket="{{ buckets.current.label }}">
<img src="{{ record.thumbnail }}" class="search-results__list-card-delivery-options-img" alt="" />
</a>

{% comment %} <a href="{% record_url record %}" class="search-results__list-card-delivery-options-link">
<p class="search-results__list-card-delivery-options-desc">
<span class="sr-only">{{ record.reference_prefixed_summary_title }} is</span>
Expand Down

0 comments on commit eb86574

Please sign in to comment.