|
|
|
|
@ -37,23 +37,27 @@ |
|
|
|
|
{% if has_full_access %} |
|
|
|
|
<a class="btn btn_light-gray" href="{% url 'course_edit' course.id %}">Редактировать</a> |
|
|
|
|
{% endif %} |
|
|
|
|
{% if course.author != request.user and not paid and course.price %} |
|
|
|
|
<div> |
|
|
|
|
<a href="#" |
|
|
|
|
class="btn{% if pending %} btn_gray{% endif %} btn_md" |
|
|
|
|
{% if user.is_authenticated %} |
|
|
|
|
{% if not pending %} |
|
|
|
|
data-course-buy |
|
|
|
|
data-popup=".js-popup-course-buy" |
|
|
|
|
{% endif %} |
|
|
|
|
{% else %} |
|
|
|
|
data-popup=".js-popup-auth" |
|
|
|
|
{% if not is_owner and course.price %} |
|
|
|
|
{% if not paid or can_buy_again %} |
|
|
|
|
<div> |
|
|
|
|
<a href="#" |
|
|
|
|
class="btn{% if pending %} btn_gray{% endif %} btn_md" |
|
|
|
|
{% if user.is_authenticated %} |
|
|
|
|
{% if not pending %} |
|
|
|
|
data-course-buy |
|
|
|
|
data-popup=".js-popup-course-buy" |
|
|
|
|
{% endif %} |
|
|
|
|
{% else %} |
|
|
|
|
data-popup=".js-popup-auth" |
|
|
|
|
{% endif %} |
|
|
|
|
>{% if pending %}ОЖИДАЕТСЯ ПОДТВЕРЖДЕНИЕ ОПЛАТЫ{% else %} |
|
|
|
|
{% if paid and can_buy_again %}ПРОДЛИТЬ ДОСТУП{% else %}КУПИТЬ КУРС{% endif %} |
|
|
|
|
{% endif %}</a> |
|
|
|
|
{% if not paid %} |
|
|
|
|
<a class="main__btn btn btn_stroke-black" href="{% url 'gift-certificates' %}">Подарить другу</a> |
|
|
|
|
{% endif %} |
|
|
|
|
>{% if pending %}ОЖИДАЕТСЯ ПОДТВЕРЖДЕНИЕ ОПЛАТЫ{% else %}КУПИТЬ КУРС{% endif %}</a> |
|
|
|
|
{% if not paid %} |
|
|
|
|
<a class="main__btn btn btn_stroke-black" href="{% url 'gift-certificates' %}">Подарить другу</a> |
|
|
|
|
</div> |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
<div |
|
|
|
|
@ -105,26 +109,41 @@ |
|
|
|
|
</a> |
|
|
|
|
<div class="course__metas"> |
|
|
|
|
<div class="course__meta meta"> |
|
|
|
|
<a class="meta__item" title="Продолжительность курса"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-time"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-time"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title">{{ course.duration | rupluralize:"день,дня,дней" }}</div> |
|
|
|
|
</a> |
|
|
|
|
{% if course.price %} |
|
|
|
|
<div class="meta__item" title="Цена"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-money"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-money"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title"> |
|
|
|
|
{% if course.old_price %}<s>{{ course.old_price|floatformat:"-2" }}₽</s>{% endif %} |
|
|
|
|
{{ course.price|floatformat:"-2" }}₽ |
|
|
|
|
{% if paid %} |
|
|
|
|
<a class="meta__item" title="Осталось {{ access_duration | rupluralize:'день,дня,дней' }} доступа к курсу"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-time"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-time"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title">{{ access_duration | rupluralize:"день,дня,дней" }}</div> |
|
|
|
|
</a> |
|
|
|
|
{% else %} |
|
|
|
|
<a class="meta__item" title="Продолжительность доступа к курсу"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-time"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-time"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title">{{ course.access_duration | rupluralize:"день,дня,дней" }}</div> |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
<div class="meta__item" title="Цена{% if can_buy_again %} повторной покупки{% endif %}"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-money"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-money"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title"> |
|
|
|
|
{% if can_buy_again %} |
|
|
|
|
<s>{{ course.price|floatformat:"-2" }}₽</s> |
|
|
|
|
{% else %} |
|
|
|
|
{% if course.old_price %}<s>{{ course.old_price|floatformat:"-2" }}₽</s>{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
<span {% if can_buy_again or course.old_price %}style="color: red;"{% endif %}>{{ course_price|floatformat:"-2" }}₽</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{% endif %} |
|
|
|
|
<div class="meta__item"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
@ -298,37 +317,64 @@ |
|
|
|
|
</a> |
|
|
|
|
<div class="course__info"> |
|
|
|
|
<div class="course__meta meta meta_white"> |
|
|
|
|
<a class="meta__item" title="Продолжительность курса"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-time"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-time"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title">{{ course.duration | rupluralize:"день,дня,дней" }}</div> |
|
|
|
|
</a> |
|
|
|
|
{% if course.price %} |
|
|
|
|
<div class="meta__item"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-money"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-money"></use> |
|
|
|
|
</svg> |
|
|
|
|
{% if paid %} |
|
|
|
|
<a class="meta__item" title="Осталось {{ access_duration | rupluralize:'день,дня,дней' }} доступа к курсу"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-time"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-time"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title">{{ access_duration | rupluralize:"день,дня,дней" }}</div> |
|
|
|
|
</a> |
|
|
|
|
{% else %} |
|
|
|
|
<a class="meta__item" title="Продолжительность доступа к курсу"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-time"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-time"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title">{{ course.access_duration | rupluralize:"день,дня,дней" }}</div> |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
<div class="meta__item" title="Цена{% if can_buy_again %} повторной покупки{% endif %}"> |
|
|
|
|
<div class="meta__icon"> |
|
|
|
|
<svg class="icon icon-money"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-money"></use> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title"> |
|
|
|
|
{% if can_buy_again %} |
|
|
|
|
<s>{{ course.price|floatformat:"-2" }}₽</s> |
|
|
|
|
{% else %} |
|
|
|
|
{% if course.old_price %}<s>{{ course.old_price|floatformat:"-2" }}₽</s>{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
<span {% if can_buy_again or course.old_price %}style="color: red;"{% endif %}>{{ course_price|floatformat:"-2" }}₽</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta__title">{{ course.price|floatformat:"-2" }}₽</div> |
|
|
|
|
</div> |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
{% if course.author != request.user and not paid and course.price %} |
|
|
|
|
<a href="#" |
|
|
|
|
class="go__btn btn{% if pending %} btn_gray{% endif %} btn_md" |
|
|
|
|
{% if user.is_authenticated %} |
|
|
|
|
{% if not pending %} |
|
|
|
|
data-course-buy |
|
|
|
|
data-popup=".js-popup-course-buy" |
|
|
|
|
{% endif %} |
|
|
|
|
{% else %} |
|
|
|
|
data-popup=".js-popup-auth" |
|
|
|
|
{% if not is_owner and course.price %} |
|
|
|
|
{% if not paid or can_buy_again %} |
|
|
|
|
<div> |
|
|
|
|
<a href="#" |
|
|
|
|
class="btn{% if pending %} btn_gray{% endif %} btn_md" |
|
|
|
|
{% if user.is_authenticated %} |
|
|
|
|
{% if not pending %} |
|
|
|
|
data-course-buy |
|
|
|
|
data-popup=".js-popup-course-buy" |
|
|
|
|
{% endif %} |
|
|
|
|
{% else %} |
|
|
|
|
data-popup=".js-popup-auth" |
|
|
|
|
{% endif %} |
|
|
|
|
>{% if pending %}ОЖИДАЕТСЯ ПОДТВЕРЖДЕНИЕ ОПЛАТЫ{% else %} |
|
|
|
|
{% if paid and can_buy_again %}ПРОДЛИТЬ ДОСТУП{% else %}КУПИТЬ КУРС{% endif %} |
|
|
|
|
{% endif %}</a> |
|
|
|
|
{% if not paid %} |
|
|
|
|
<a class="main__btn btn btn_stroke-black" href="{% url 'gift-certificates' %}">Подарить другу</a> |
|
|
|
|
{% endif %} |
|
|
|
|
>{% if pending %}ОЖИДАЕТСЯ ПОДТВЕРЖДЕНИЕ ОПЛАТЫ{% else %}КУПИТЬ КУРС{% endif %}</a> |
|
|
|
|
</div> |
|
|
|
|
{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -345,3 +391,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{% endblock content %} |
|
|
|
|
|
|
|
|
|
{% block foot %} |
|
|
|
|
{% include "templates/blocks/popup_course_buy.html" %} |
|
|
|
|
{% endblock foot %} |
|
|
|
|
|