From 69c7e591addb995465a33738ece81023dcbb91c7 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 08:34:53 +0300 Subject: [PATCH 01/10] Limit comment only for authenticated users --- apps/course/templates/course/lesson.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/course/templates/course/lesson.html b/apps/course/templates/course/lesson.html index 5a76111d..27148452 100644 --- a/apps/course/templates/course/lesson.html +++ b/apps/course/templates/course/lesson.html @@ -87,10 +87,14 @@
+ {% if user.is_authenticated %}
+ {% else %} +
Только зарегистрированные пользователи могут оставлять комментарии.
+ {% endif %}
From 296a4c3383857bb2829fdb84a5d806ef6ed25c27 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 09:55:18 +0300 Subject: [PATCH 02/10] Add success verification view --- apps/auth/urls.py | 1 + apps/auth/views.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/auth/urls.py b/apps/auth/urls.py index e4278014..8adfed45 100644 --- a/apps/auth/urls.py +++ b/apps/auth/urls.py @@ -7,6 +7,7 @@ urlpatterns = [ path('logout/', views.LogoutView.as_view(), name="logout"), path('login/', views.LoginView.as_view(), name="login"), path('verification-email//', views.VerificationEmailView.as_view(), name="verification-email"), + path('success-verification-email/', views.SuccessVerificationEmailView.as_view(), name="success-verification-email"), path('facebook_login/', views.FacebookLoginOrRegistration.as_view(), name="facebook_login"), path('password_reset/', views.PasswordResetView.as_view(), name="password_reset"), diff --git a/apps/auth/views.py b/apps/auth/views.py index 9dccdbe9..0c0d248c 100644 --- a/apps/auth/views.py +++ b/apps/auth/views.py @@ -9,7 +9,7 @@ from django.http import JsonResponse from django.urls import reverse_lazy from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt -from django.views.generic import FormView, View +from django.views.generic import FormView, View, TemplateView from django.views.generic.edit import BaseFormView from django.shortcuts import redirect @@ -83,11 +83,16 @@ class VerificationEmailView(View): if is_valid_token: request.user.is_email_proved = True request.user.save() - return JsonResponse({"success": True}) + login(request, request.user) + return redirect(reverse_lazy('lilcity:success-verification-email')) else: return JsonResponse({"success": False}, status=400) +class SuccessVerificationEmailView(TemplateView): + template_name = 'auth/success-verification.html' + + class PasswordResetView(views.PasswordContextMixin, BaseFormView): email_template_name = "auth/password_reset.html" subject_template_name = "auth/password_reset_subject.txt" From 01d051cfe817dafc4207073845bcd39ae128cde6 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 09:55:34 +0300 Subject: [PATCH 03/10] Add success verification template --- .../templates/auth/success-verification.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 apps/auth/templates/auth/success-verification.html diff --git a/apps/auth/templates/auth/success-verification.html b/apps/auth/templates/auth/success-verification.html new file mode 100644 index 00000000..f030b83c --- /dev/null +++ b/apps/auth/templates/auth/success-verification.html @@ -0,0 +1,18 @@ +{% extends "templates/lilcity/index.html" %} + +{% block content %} +
+
+
+
Email подтверждён!
+
+

Через несколько секунд Вас перенаправят на главную страницу.

+

Или нажмите кнопку ниже.

+
+ +
+
+
+{% endblock content %} From 3a07f0433e653875d469ca1e631881e505d7c681 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 11:31:18 +0300 Subject: [PATCH 04/10] Add sunday saturday --- project/templates/lilcity/main.html | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/project/templates/lilcity/main.html b/project/templates/lilcity/main.html index 582ae596..70cd6eaf 100644 --- a/project/templates/lilcity/main.html +++ b/project/templates/lilcity/main.html @@ -418,6 +418,40 @@
+
+
Суббота
+
+
Персонаж.
+
Учимся создавать персонажей из простых форм. Изучаем характеры и эмоции.
+
+ +
Cамое главное - иметь альбом или блокнот с пустыми страницами (без линий и клеток) плотной гладкой бумагой, формат + А4. Рисовать будем цветными карандашами, а также простым, мягкостью B2. Иногда пригодятся вырезки из журналов + и клей-карандаш.
+
+
+
+
+
Воскресенье
+
+
Персонаж.
+
Учимся создавать персонажей из простых форм. Изучаем характеры и эмоции.
+
+ +
Cамое главное - иметь альбом или блокнот с пустыми страницами (без линий и клеток) плотной гладкой бумагой, формат + А4. Рисовать будем цветными карандашами, а также простым, мягкостью B2. Иногда пригодятся вырезки из журналов + и клей-карандаш.
+
+
+
Распечатать расписание чтобы не забыть
From 1ac7578cdd843651bece869e7c227962452a9c3a Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 11:57:51 +0300 Subject: [PATCH 05/10] Update main menu --- project/templates/lilcity/index.html | 23 +++++++++++++---------- project/templates/lilcity/main.html | 4 +++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/project/templates/lilcity/index.html b/project/templates/lilcity/index.html index be860361..6cc905d7 100644 --- a/project/templates/lilcity/index.html +++ b/project/templates/lilcity/index.html @@ -85,9 +85,9 @@
О школе
- + {% comment %}
Процесс
-
+ {% endcomment %}
Преимущества
@@ -97,21 +97,24 @@
Галерея
+ +
Преподаватели
+
Расписание
- -
Преподаватели
+
+
Партнеры
- + {% comment %}
Частые вопросы
-
- + {% endcomment %} + {% comment %}
Оплата
-
- + {% endcomment %} + {% comment %}
Контакты
-
+ {% endcomment %}
ВИДЕО-КУРСЫ diff --git a/project/templates/lilcity/main.html b/project/templates/lilcity/main.html index 70cd6eaf..eb2fff43 100644 --- a/project/templates/lilcity/main.html +++ b/project/templates/lilcity/main.html @@ -593,7 +593,9 @@
- + From 8bd94f9a9be313f3cdba2fc036771b95dea24524 Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 1 Feb 2018 12:15:12 +0300 Subject: [PATCH 07/10] Main page subscription text fix --- project/templates/lilcity/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/templates/lilcity/main.html b/project/templates/lilcity/main.html index eb2fff43..be8d39ef 100644 --- a/project/templates/lilcity/main.html +++ b/project/templates/lilcity/main.html @@ -5,7 +5,7 @@
Первая онлайн-школа креативного мышления для детей! 5+
- КУПИТЬ ДОСУП ЗА 2000р. в мес. + КУПИТЬ ДОСТУП ОТ 2000р. в мес.
From afda31a8eb9935fcfd21166ef1af65c1821ae8a7 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 12:20:50 +0300 Subject: [PATCH 08/10] Fix links to author page --- apps/course/templates/course/_items.html | 4 +- apps/course/templates/course/course.html | 64 +++++++++++++----------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/apps/course/templates/course/_items.html b/apps/course/templates/course/_items.html index c76a936b..af350f5c 100644 --- a/apps/course/templates/course/_items.html +++ b/apps/course/templates/course/_items.html @@ -42,7 +42,9 @@ {% endif %}
-
{{ course.author.get_full_name }}
+ +
{{ course.author.get_full_name }}
+
{{ course.created_at_humanize }}
{% data_liked user course as liked %} diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index 3a92f596..783dec81 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -55,23 +55,25 @@
{{ course.title }}
{{ course.short_description }}
-
- {% if course.author.photo %} -
- -
- {% else %} -
- -
- {% endif %} -
-
{{ course.author.get_full_name }}
- +
@@ -316,23 +318,25 @@
Как просто научиться рисовать простых персонажей.
Этот курс поможет детям узнать о том как из простых форм создавать веселый и харизматичных персонажей.
-
- {% if course.author.photo %} -
- -
- {% else %} -
- -
- {% endif %} -
-
{{ course.author.get_full_name }}
- +
From b238f86716cbea48854ae112b2edbf1da45914ae Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 12:41:42 +0300 Subject: [PATCH 09/10] Fix comment block for not authenticated --- apps/course/templates/course/course.html | 6 +++--- apps/course/templates/course/lesson.html | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index 783dec81..6ea6e48b 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -380,13 +380,13 @@
Задавайте вопросы:
+ {% if user.is_authenticated %}
- {% if user.is_authenticated %}
В ответ на этот комментарий. Отменить @@ -395,11 +395,11 @@
+
+
{% else %}
Только зарегистрированные пользователи могут оставлять комментарии.
{% endif %} -
-
{% include "./blocks/comments.html" with object=course %}
diff --git a/apps/course/templates/course/lesson.html b/apps/course/templates/course/lesson.html index 27148452..19b11558 100644 --- a/apps/course/templates/course/lesson.html +++ b/apps/course/templates/course/lesson.html @@ -82,21 +82,21 @@
Задавайте вопросы:
+ {% if user.is_authenticated %}
- {% if user.is_authenticated %}
- {% else %} -
Только зарегистрированные пользователи могут оставлять комментарии.
- {% endif %}
+ {% else %} +
Только зарегистрированные пользователи могут оставлять комментарии.
+ {% endif %}
{% include "./blocks/comments.html" with object=lesson %}
From 0d801d95105012e1f1f1ee5b00a8dcb9301bf7bf Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Thu, 1 Feb 2018 12:42:55 +0300 Subject: [PATCH 10/10] Add auth popup to lesson button for not authenticated --- apps/course/templates/course/course.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/course/templates/course/course.html b/apps/course/templates/course/course.html index 6ea6e48b..cf994653 100644 --- a/apps/course/templates/course/course.html +++ b/apps/course/templates/course/course.html @@ -122,7 +122,10 @@
-
{% endif %}
+{% if user.is_authenticated %}
@@ -247,6 +251,7 @@
+{% endif %}
Галерея итогов обучения
@@ -397,9 +402,9 @@
- {% else %} -
Только зарегистрированные пользователи могут оставлять комментарии.
- {% endif %} + {% else %} +
Только зарегистрированные пользователи могут оставлять комментарии.
+ {% endif %}
{% include "./blocks/comments.html" with object=course %}