mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
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:
@@ -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>
|
||||
|
Reference in New Issue
Block a user