Placeholder child list picture

This commit is contained in:
Isaac Bythewood 2017-11-18 04:32:24 -05:00
parent c7d09823bb
commit 7479cc932f
1 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{% extends 'babybuddy/page.html' %} {% extends 'babybuddy/page.html' %}
{% load widget_tweaks thumbnail %} {% load widget_tweaks static thumbnail %}
{% block title %}Children{% endblock %} {% block title %}Children{% endblock %}
@ -25,8 +25,12 @@
{% for child in object_list %} {% for child in object_list %}
<tr> <tr>
<td> <td>
{% thumbnail child.picture 40x40 upscale crop as thumb %} {% if child.picture %}
<img src="{{ thumb.url }}" class="img-fluid rounded-circle" /> {% thumbnail child.picture 40x40 upscale crop as thumb %}
<img src="{{ thumb.url }}" class="img-fluid rounded-circle" />
{% else %}
<img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" width="40" height="40" class="img-fluid rounded-circle" />
{% endif %}
</td> </td>
<th scope="row" class="align-middle"> <th scope="row" class="align-middle">
<a href="{% url 'child' child.slug %}">{{ child.first_name }}</a> <a href="{% url 'child' child.slug %}">{{ child.first_name }}</a>