|
|
|
|
@ -9,7 +9,7 @@ |
|
|
|
|
{% block ogtitle %}{{ course.title }} - {{ block.super }}{% endblock ogtitle %} |
|
|
|
|
{% block ogurl %}{{ request.build_absolute_uri }}{% endblock ogurl %} |
|
|
|
|
{% if course.cover and course.cover.image %} |
|
|
|
|
{% block ogimage %}http://{{request.META.HTTP_HOST}}{{ course.cover.image.url }}{% endblock ogimage %} |
|
|
|
|
{% block ogimage %}http://{{request.META.HTTP_HOST}}{% if course.cover %}{{ course.cover.image.url }}{% else %}{% static 'img/og_courses.jpg' %}{% endif %}{% endblock ogimage %} |
|
|
|
|
{% endif %} |
|
|
|
|
{% block ogdescription %}{{ course.short_description }}{% endblock ogdescription %} |
|
|
|
|
|
|
|
|
|
@ -141,37 +141,45 @@ |
|
|
|
|
<div class="course__actions"> |
|
|
|
|
<a href="{% url 'course' course.id %}" class="course__action btn btn_lg{% if not only_lessons %} btn_stroke{% else %} btn_gray{% endif %}">Описание курса</a> |
|
|
|
|
{% if request.user.is_authenticated %} |
|
|
|
|
{% if course.author == request.user and request.user.role >= request.user.AUTHOR_ROLE %} |
|
|
|
|
<a |
|
|
|
|
href="{% url 'course-only-lessons' course.id %}" |
|
|
|
|
class="course__action btn btn_lg{% if only_lessons %} btn_stroke{% else %} btn_gray{% endif %}" |
|
|
|
|
{% if not user.is_authenticated %}data-popup=".js-popup-auth"{% endif %} |
|
|
|
|
>УРОКИ |
|
|
|
|
</a> |
|
|
|
|
{% elif request.user.role == request.user.ADMIN_ROLE %} |
|
|
|
|
<a |
|
|
|
|
href="{% url 'course-only-lessons' course.id %}" |
|
|
|
|
class="course__action btn btn_lg{% if only_lessons %} btn_stroke{% else %} btn_gray{% endif %}" |
|
|
|
|
{% if not user.is_authenticated %}data-popup=".js-popup-auth"{% endif %} |
|
|
|
|
>УРОКИ |
|
|
|
|
</a> |
|
|
|
|
{% if course.author == request.user and request.user.role >= request.user.AUTHOR_ROLE %} |
|
|
|
|
<a |
|
|
|
|
href="{% url 'course-only-lessons' course.id %}" |
|
|
|
|
class="course__action btn btn_lg{% if only_lessons %} btn_stroke{% else %} btn_gray{% endif %}" |
|
|
|
|
{% if not user.is_authenticated %}data-popup=".js-popup-auth"{% endif %} |
|
|
|
|
>УРОКИ |
|
|
|
|
</a> |
|
|
|
|
{% elif request.user.role == request.user.ADMIN_ROLE %} |
|
|
|
|
<a |
|
|
|
|
href="{% url 'course-only-lessons' course.id %}" |
|
|
|
|
class="course__action btn btn_lg{% if only_lessons %} btn_stroke{% else %} btn_gray{% endif %}" |
|
|
|
|
{% if not user.is_authenticated %}data-popup=".js-popup-auth"{% endif %} |
|
|
|
|
>УРОКИ |
|
|
|
|
</a> |
|
|
|
|
{% else %} |
|
|
|
|
<a |
|
|
|
|
class="course__action btn btn_lg{% if only_lessons %} btn_stroke{% else %} btn_gray{% endif %}" |
|
|
|
|
{% if paid %} |
|
|
|
|
href="{% url 'course-only-lessons' course.id %}" |
|
|
|
|
{% else %} |
|
|
|
|
data-popup=".js-popup-course-lock" |
|
|
|
|
{% endif %} |
|
|
|
|
>УРОКИ |
|
|
|
|
{% if not paid %} |
|
|
|
|
<svg class="icon icon-lock"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-lock"></use> |
|
|
|
|
</svg> |
|
|
|
|
{% endif %} |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
{% else %} |
|
|
|
|
<a |
|
|
|
|
class="course__action btn btn_lg{% if only_lessons %} btn_stroke{% else %} btn_gray{% endif %}" |
|
|
|
|
{% if paid %} |
|
|
|
|
href="{% url 'course-only-lessons' course.id %}" |
|
|
|
|
{% else %} |
|
|
|
|
data-popup=".js-popup-course-lock" |
|
|
|
|
{% endif %} |
|
|
|
|
>УРОКИ |
|
|
|
|
{% if not paid %} |
|
|
|
|
data-popup=".js-popup-auth">УРОКИ |
|
|
|
|
<svg class="icon icon-lock"> |
|
|
|
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-lock"></use> |
|
|
|
|
</svg> |
|
|
|
|
{% endif %} |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
<a class="course__video video" href="#"> |
|
|
|
|
{% if course.cover %} |
|
|
|
|
|