From 366858bd42c63079b107c7c0790412e992b48ac2 Mon Sep 17 00:00:00 2001 From: gzbender Date: Mon, 10 Sep 2018 17:56:05 +0500 Subject: [PATCH] =?UTF-8?q?LIL-601=20=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D1=8C=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=20=D0=BA?= =?UTF-8?q?=D1=83=D1=80=D1=81=D0=B0=20=D0=92=D0=BE=D0=B7=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D0=BD=D0=B0=D1=8F=20=D0=BA=D0=B0=D1=82=D0=B5=D0=B3=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D1=8F=20=D0=B2=20=D0=BA=D1=83=D1=80=D1=81=D0=B5=20?= =?UTF-8?q?=D0=A4=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D0=BF=D0=BE=20=D0=B2?= =?UTF-8?q?=D0=BE=D0=B7=D1=80=D0=B0=D1=81=D1=82=D1=83=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D1=83=D1=80=D1=81=D0=B0=D1=85=20=D0=91=D0=BB=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=BF=D0=BE=D0=B4=D0=B0=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D0=B8=20=D0=A1=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=D1=85?= =?UTF-8?q?=20=D1=83=D1=80=D0=BE=D0=BA=D0=B0,=20=D0=BA=D1=83=D1=80=D1=81?= =?UTF-8?q?=D0=B0=20=D0=B8=20=D1=82=D0=B4=20=D0=95=D1=89=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=BC=D0=B5=D0=BB=D0=BE=D1=87=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/course/templates/course/course.html | 3 ++ .../templates/course/course_only_lessons.html | 5 --- apps/course/templates/course/courses.html | 4 +- .../course/inclusion/category_items.html | 6 +-- apps/course/views.py | 5 +-- .../templates/school/livelesson_detail.html | 2 +- .../templates/school/livelessons_list.html | 2 +- web/src/js/modules/courses.js | 40 +++++++++---------- 8 files changed, 30 insertions(+), 37 deletions(-) diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index f5697f3b..e9bda69a 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -25,6 +25,9 @@
Вернуться
+ {% if has_full_access %} + Редактировать + {% endif %} {% if course.author != request.user and not paid and course.price %} Перейти к уроку -
- {% if course.author == request.user or request.user.role >= request.user.TEACHER_ROLE or paid %} - Перейти к уроку - {% endif %} -
{% endfor %} diff --git a/apps/course/templates/course/courses.html b/apps/course/templates/course/courses.html index 2f47675a..f56279f6 100644 --- a/apps/course/templates/course/courses.html +++ b/apps/course/templates/course/courses.html @@ -20,8 +20,8 @@
-
-
{% if category.0 %}{{ category.0 }}{% else %}Категории{% endif %}
+
+
Категории
Все категории
diff --git a/apps/course/templates/course/inclusion/category_items.html b/apps/course/templates/course/inclusion/category_items.html index 66fb771b..9ebd98ed 100644 --- a/apps/course/templates/course/inclusion/category_items.html +++ b/apps/course/templates/course/inclusion/category_items.html @@ -1,6 +1,6 @@ {% for cat in category_items %} -
+
{{ cat.title }}
-{% endfor %} \ No newline at end of file +{% endfor %} diff --git a/apps/course/views.py b/apps/course/views.py index fa2aecc6..6b578923 100644 --- a/apps/course/views.py +++ b/apps/course/views.py @@ -167,9 +167,8 @@ class CourseEditView(TemplateView): self.object = Course.objects.create( author=request.user, ) - #TODO - #if (request.user != self.object.author and request.user.role < User.AUTHOR_ROLE) or request.user.role != User.ADMIN_ROLE: - # raise Http404 + if request.user != self.object.author and request.user.role != User.ADMIN_ROLE: + raise Http404 return super().get(request) def get_context_data(self): diff --git a/apps/school/templates/school/livelesson_detail.html b/apps/school/templates/school/livelesson_detail.html index cfa77ba3..f553f447 100644 --- a/apps/school/templates/school/livelesson_detail.html +++ b/apps/school/templates/school/livelesson_detail.html @@ -7,7 +7,7 @@
{{ livelesson.title }}
-
{{ livelesson.short_description | linebreaks }}
+
{{ livelesson.short_description | safe | linebreaks }}
{% if livelesson.stream_index %}