From aafcd1790afce94a56d7d32370ea8d091480e58f Mon Sep 17 00:00:00 2001 From: gzbender Date: Fri, 21 Sep 2018 23:31:20 +0500 Subject: [PATCH] LIL-670 --- api/v1/views.py | 3 +- .../templates/content/blocks/video.html | 26 ------------- apps/course/templates/course/course.html | 37 ++----------------- .../templates/course/course_only_lessons.html | 28 +------------- apps/course/templates/course/lesson.html | 4 +- web/src/components/Comments.vue | 2 +- web/src/js/modules/api.js | 3 -- web/src/sass/_common.sass | 18 +++++++++ 8 files changed, 27 insertions(+), 94 deletions(-) diff --git a/api/v1/views.py b/api/v1/views.py index 04e2beb5..e93075c4 100644 --- a/api/v1/views.py +++ b/api/v1/views.py @@ -1,7 +1,7 @@ from django.contrib.auth import get_user_model from rest_framework import status, views, viewsets, generics -from rest_framework.decorators import detail_route, list_route, action, permission_classes +from rest_framework.decorators import detail_route, list_route, action, permission_classes, authentication_classes from rest_framework.response import Response from . import ExtendedModelViewSet @@ -514,6 +514,7 @@ class ObjectCommentsViewSet(ExtendedModelViewSet): print(e) instance.delete() + @authentication_classes([]) def list(self, request, *args, **kwargs): queryset = self.filter_queryset(self.get_queryset()).filter(parent__isnull=True) serializer = self.get_serializer(queryset, many=True) diff --git a/apps/content/templates/content/blocks/video.html b/apps/content/templates/content/blocks/video.html index 791920b1..8c707388 100644 --- a/apps/content/templates/content/blocks/video.html +++ b/apps/content/templates/content/blocks/video.html @@ -15,29 +15,3 @@ - - diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index c3a35c4f..e031fe23 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -70,7 +70,7 @@
{{ course.title }}
-
{{ course.short_description | linebreaks }}
+
{{ course.short_description | safe | linebreaks }}
{% if course.author.photo %} @@ -270,7 +270,7 @@
{{ course.title }}
-
{{ course.short_description | linebreaks }}
+
{{ course.short_description | safe | linebreaks }}
{% if course.author.photo %} @@ -340,38 +340,7 @@
Задавайте вопросы:
-
- {% if request.user.is_authenticated %} -
- -
- -
-
-
- {% else %} -
Только зарегистрированные пользователи могут оставлять комментарии.
- {% endif %} -
- {% include "templates/blocks/comments.html" with object=course %} -
-
+
diff --git a/apps/course/templates/course/course_only_lessons.html b/apps/course/templates/course/course_only_lessons.html index 9efe873c..f68414b4 100644 --- a/apps/course/templates/course/course_only_lessons.html +++ b/apps/course/templates/course/course_only_lessons.html @@ -68,7 +68,7 @@
{{ course.title }}
-
{{ course.short_description }}
+
{{ course.short_description | safe | linebreaks }}
{% if course.author.photo %} @@ -204,31 +204,7 @@
Задавайте вопросы:
-
- {% if user.is_authenticated %} -
- -
- -
-
-
- {% else %} -
Только зарегистрированные пользователи могут оставлять комментарии.
- {% endif %} -
- {% include "templates/blocks/comments.html" with object=course %} -
-
+
diff --git a/apps/course/templates/course/lesson.html b/apps/course/templates/course/lesson.html index d36219f7..990f4e35 100644 --- a/apps/course/templates/course/lesson.html +++ b/apps/course/templates/course/lesson.html @@ -117,9 +117,7 @@
Задавайте вопросы:
-
- -
+
diff --git a/web/src/components/Comments.vue b/web/src/components/Comments.vue index ad7e88d1..2fd5bbb4 100644 --- a/web/src/components/Comments.vue +++ b/web/src/components/Comments.vue @@ -1,5 +1,5 @@