LIL-319. Fix course preview img

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent f9c96c654c
commit cbfd47c772
  1. 9
      apps/course/templates/course/_items.html

@ -1,3 +1,4 @@
{% load thumbnail %}
{% load static %}
{% load data_liked from data_liked %}
@ -8,9 +9,11 @@
>
<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 %}
<img width="300px" height="170px" class="courses__pic" src="{{ course.cover.image.url }}"/>
{% thumbnail course.cover.image "300x170" crop="center" as im %}
<img class="courses__pic" src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"/>
{% endthumbnail %}
{% else %}
<img width="300px" height="170px" class="courses__pic" src="{% static 'img/no_cover.png' %}"/>
<img class="courses__pic" src="{% static 'img/no_cover.png' %}" width="300px" height="170px"/>
{% endif %}
<div class="courses__view">Подробнее</div>
{% if course.is_featured %}
@ -86,4 +89,4 @@
</div>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save