Use empty tag for img thumbs

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent cbfd47c772
commit 4026f04044
  1. 6
      apps/course/templates/course/_items.html

@ -8,13 +8,11 @@
{% if course.is_deferred_start %}data-future-course data-future-course-time={{ course.deferred_start_at.timestamp }}{% endif %}
>
<a class="courses__preview" href="{% if course.status == 0 %}{% url 'course_edit' course.id %}{% else %}{% url 'course' course.id %}?next={{ request.get_full_path }}{% endif %}">
{% if course.cover %}
{% thumbnail course.cover.image "300x170" crop="center" as im %}
<img class="courses__pic" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
{% endthumbnail %}
{% else %}
{% empty %}
<img class="courses__pic" src="{% static 'img/no_cover.png' %}" width="300px" height="170px"/>
{% endif %}
{% endthumbnail %}
<div class="courses__view">Подробнее</div>
{% if course.is_featured %}
<div class="courses__label courses__label_fav"></div>

Loading…
Cancel
Save