mirror of https://github.com/snachodog/mybuddy.git
♻️ puts child thumbnail in a dedicated template
This commit is contained in:
parent
424f9947af
commit
956125afcc
|
@ -32,12 +32,7 @@
|
|||
{% for child in object_list %}
|
||||
<tr>
|
||||
<td class="picture-column">
|
||||
{% if child.picture %}
|
||||
{% thumbnail '40x40' child.picture 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 %}
|
||||
{% include "core/child_thumbnail.html" %}
|
||||
</td>
|
||||
<th scope="row">
|
||||
<a href="{% url 'core:child' child.slug %}">{{ child.first_name }}</a>
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
{% if widget.wrap_label %}
|
||||
<label{% if widget.attrs.id %}
|
||||
for="{{ widget.attrs.id }}"{% endif %}>{% endif %}{% include "django/forms/widgets/input.html" %}
|
||||
{% if widget.wrap_label %}{% if widget.picture %}
|
||||
{% thumbnail '40x40' widget.picture 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 %} {{ widget.label }}</label>{% endif %}
|
||||
{% if widget.wrap_label %}
|
||||
{% include "core/child_thumbnail.html" with child=widget %}
|
||||
{{ widget.label }}</label>{% endif %}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{% load imagekit static %}
|
||||
|
||||
{% if child.picture %}
|
||||
{% thumbnail '40x40' child.picture 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 %}
|
Loading…
Reference in New Issue