Add a default card image when no custom one exists (#23)

* Add a default card image when no custom one exists
* Add coming_soon.png source
* Use directly the svg source instead of the png raster
This commit is contained in:
2023-10-01 16:36:30 +02:00
committed by GitHub
parent a189646aa5
commit f4023f105f
6 changed files with 76 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load static %}
{% block header %}
<p class="lead text-muted">Results found: {{ matches }}</p>
@@ -9,9 +10,11 @@
{% for d in data %}
<div class="col">
<div class="card shadow-sm">
{% for i in d.image.all %}
{% if forloop.first %}<a href="{{d.get_absolute_url}}"><img class="card-img-top" src="{{ i.image.url }}" alt="Card image cap"></a>{% endif %}
{% endfor %}
{% if d.image.count > 0 %}
<a href="{{d.get_absolute_url}}"><img class="card-img-top" src="{{ d.image.first.image.url }}" alt="{{ d }}"></a>
{% else %}
<a href="{{d.get_absolute_url}}"><img class="card-img-top" src="{% static DEFAULT_CARD_IMAGE %}" alt="{{ d }}"></a>
{% endif %}
<div class="card-body">
<p class="card-text" style="position: relative;">
<strong>{{ d }}</strong>