From 507078fae01b502089f569a4a126cedd56cbe50d Mon Sep 17 00:00:00 2001 From: "Ayshyama@gmail.com" Date: Fri, 17 Nov 2023 10:52:29 +0100 Subject: [PATCH 1/3] added signin/up html,css,js. Need to customize it more --- app_accounts/models.py | 29 +++ app_accounts/urls.py | 7 + app_accounts/views.py | 4 + eduproject_config/urls.py | 1 + static/css/signin.css | 400 +++++++++++++++++++++++++++++ static/js/signin.js | 11 + templates/app_accounts/signin.html | 112 +++++++- 7 files changed, 558 insertions(+), 6 deletions(-) create mode 100644 app_accounts/urls.py create mode 100644 static/css/signin.css create mode 100644 static/js/signin.js diff --git a/app_accounts/models.py b/app_accounts/models.py index e286c29..21a4112 100644 --- a/app_accounts/models.py +++ b/app_accounts/models.py @@ -42,3 +42,32 @@ def create_user_progress(sender, instance, action, reverse, model, pk_set, **kwa # Connect the signal m2m_changed.connect(create_user_progress, sender=CustomUser.exercises_done.through) + +''' +Signal Receiver: +- The @receiver decorator is used to register the function create_user_progress as +a signal receiver for the m2m_changed signal, specifically for changes to the +exercises_done many-to-many field in the CustomUser model. +- The sender argument specifies the model class that sends the signal, which is the +intermediary model that Django automatically creates to manage the many-to-many +relationship between CustomUser and Exercise. +- The signal is triggered whenever the exercises_done field is changed, which can +happen in a variety of ways, including when a new exercise is added to the set or +when an existing exercise is removed from the set. +- The reverse argument is set to True when the change is made on the reverse side of +the relation, which is the Exercise model in this case. +- The pk_set argument is a set of primary keys for the related objects that were added +to the many-to-many field. +- The **kwargs argument allows the function to accept arbitrary keyword arguments. +- When a CustomUser instance has exercises added to its exercises_done set, the create_user_progress function is triggered. +- If the action is post_add (which occurs after new items have been added to the many-to-many field) and the change is not +happening on the reverse side of the relation, the function iterates over the primary key set of added exercises and +creates a new UserProgress instance for each one, associating the exercise with the user. + +Signal Connection: +- Although the @receiver decorator already connects the create_user_progress function to the m2m_changed signal, +the last line explicitly connects the signal again, which is redundant and not necessary given the use of the decorator. +This setup allows the application to automatically track user progress on exercises without requiring additional code to +manage the creation of UserProgress instances whenever exercises are added to a user's exercises_done set. It leverages +Django's signals framework to hook into the lifecycle of the database operations. +''' \ No newline at end of file diff --git a/app_accounts/urls.py b/app_accounts/urls.py new file mode 100644 index 0000000..fcf7870 --- /dev/null +++ b/app_accounts/urls.py @@ -0,0 +1,7 @@ +from django.urls import path +from . import views + + +urlpatterns = [ + path('login/', views.login, name='login'), + ] \ No newline at end of file diff --git a/app_accounts/views.py b/app_accounts/views.py index c60c790..a486752 100644 --- a/app_accounts/views.py +++ b/app_accounts/views.py @@ -1,3 +1,7 @@ from django.shortcuts import render # Create your views here. + + +def login(request): + return render(request, 'app_accounts/signin.html') \ No newline at end of file diff --git a/eduproject_config/urls.py b/eduproject_config/urls.py index dc40a77..0f035e1 100644 --- a/eduproject_config/urls.py +++ b/eduproject_config/urls.py @@ -5,4 +5,5 @@ urlpatterns = [ path("admin/", admin.site.urls), path("", include("app_base.urls")), + path("user/", include("app_accounts.urls")), ] diff --git a/static/css/signin.css b/static/css/signin.css new file mode 100644 index 0000000..fcd7704 --- /dev/null +++ b/static/css/signin.css @@ -0,0 +1,400 @@ +@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap"); + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body, +input { + font-family: "Poppins", sans-serif; +} + +.container { + position: relative; + width: 100%; + background-color: #fff; + min-height: 100vh; + overflow: hidden; +} + +.forms-container { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; +} + +.signin-signup { + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + left: 75%; + width: 50%; + transition: 1s 0.7s ease-in-out; + display: grid; + grid-template-columns: 1fr; + z-index: 5; +} + +form { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + padding: 0rem 5rem; + transition: all 0.2s 0.7s; + overflow: hidden; + grid-column: 1 / 2; + grid-row: 1 / 2; +} + +form.sign-up-form { + opacity: 0; + z-index: 1; +} + +form.sign-in-form { + z-index: 2; +} + +.title { + font-size: 2.2rem; + color: #444; + margin-bottom: 10px; +} + +.input-field { + max-width: 380px; + width: 100%; + background-color: #f0f0f0; + margin: 10px 0; + height: 55px; + border-radius: 55px; + display: grid; + grid-template-columns: 15% 85%; + padding: 0 0.4rem; + position: relative; +} + +.input-field i { + text-align: center; + line-height: 55px; + color: #acacac; + transition: 0.5s; + font-size: 1.1rem; +} + +.input-field input { + background: none; + outline: none; + border: none; + line-height: 1; + font-weight: 600; + font-size: 1.1rem; + color: #333; +} + +.input-field input::placeholder { + color: #aaa; + font-weight: 500; +} + +.social-text { + padding: 0.7rem 0; + font-size: 1rem; +} + +.social-media { + display: flex; + justify-content: center; +} + +.social-icon { + height: 46px; + width: 46px; + display: flex; + justify-content: center; + align-items: center; + margin: 0 0.45rem; + color: #333; + border-radius: 50%; + border: 1px solid #333; + text-decoration: none; + font-size: 1.1rem; + transition: 0.3s; +} + +.social-icon:hover { + color: #4481eb; + border-color: #4481eb; +} + +.btn { + width: 150px; + background-color: #5995fd; + border: none; + outline: none; + height: 49px; + border-radius: 49px; + color: #fff; + text-transform: uppercase; + font-weight: 600; + margin: 10px 0; + cursor: pointer; + transition: 0.5s; +} + +.btn:hover { + background-color: #4d84e2; +} +.panels-container { + position: absolute; + height: 100%; + width: 100%; + top: 0; + left: 0; + display: grid; + grid-template-columns: repeat(2, 1fr); +} + +.container:before { + content: ""; + position: absolute; + height: 2000px; + width: 2000px; + top: -10%; + right: 48%; + transform: translateY(-50%); + background-image: linear-gradient(-45deg, #4481eb 0%, #04befe 100%); + transition: 1.8s ease-in-out; + border-radius: 50%; + z-index: 6; +} + +.image { + width: 100%; + transition: transform 1.1s ease-in-out; + transition-delay: 0.4s; +} + +.panel { + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: space-around; + text-align: center; + z-index: 6; +} + +.left-panel { + pointer-events: all; + padding: 3rem 17% 2rem 12%; +} + +.right-panel { + pointer-events: none; + padding: 3rem 12% 2rem 17%; +} + +.panel .content { + color: #fff; + transition: transform 0.9s ease-in-out; + transition-delay: 0.6s; +} + +.panel h3 { + font-weight: 600; + line-height: 1; + font-size: 1.5rem; +} + +.panel p { + font-size: 0.95rem; + padding: 0.7rem 0; +} + +.btn.transparent { + margin: 0; + background: none; + border: 2px solid #fff; + width: 130px; + height: 41px; + font-weight: 600; + font-size: 0.8rem; +} + +.right-panel .image, +.right-panel .content { + transform: translateX(800px); +} + +/* ANIMATION */ + +.container.sign-up-mode:before { + transform: translate(100%, -50%); + right: 52%; +} + +.container.sign-up-mode .left-panel .image, +.container.sign-up-mode .left-panel .content { + transform: translateX(-800px); +} + +.container.sign-up-mode .signin-signup { + left: 25%; +} + +.container.sign-up-mode form.sign-up-form { + opacity: 1; + z-index: 2; +} + +.container.sign-up-mode form.sign-in-form { + opacity: 0; + z-index: 1; +} + +.container.sign-up-mode .right-panel .image, +.container.sign-up-mode .right-panel .content { + transform: translateX(0%); +} + +.container.sign-up-mode .left-panel { + pointer-events: none; +} + +.container.sign-up-mode .right-panel { + pointer-events: all; +} + +@media (max-width: 870px) { + .container { + min-height: 800px; + height: 100vh; + } + .signin-signup { + width: 100%; + top: 95%; + transform: translate(-50%, -100%); + transition: 1s 0.8s ease-in-out; + } + + .signin-signup, + .container.sign-up-mode .signin-signup { + left: 50%; + } + + .panels-container { + grid-template-columns: 1fr; + grid-template-rows: 1fr 2fr 1fr; + } + + .panel { + flex-direction: row; + justify-content: space-around; + align-items: center; + padding: 2.5rem 8%; + grid-column: 1 / 2; + } + + .right-panel { + grid-row: 3 / 4; + } + + .left-panel { + grid-row: 1 / 2; + } + + .image { + width: 200px; + transition: transform 0.9s ease-in-out; + transition-delay: 0.6s; + } + + .panel .content { + padding-right: 15%; + transition: transform 0.9s ease-in-out; + transition-delay: 0.8s; + } + + .panel h3 { + font-size: 1.2rem; + } + + .panel p { + font-size: 0.7rem; + padding: 0.5rem 0; + } + + .btn.transparent { + width: 110px; + height: 35px; + font-size: 0.7rem; + } + + .container:before { + width: 1500px; + height: 1500px; + transform: translateX(-50%); + left: 30%; + bottom: 68%; + right: initial; + top: initial; + transition: 2s ease-in-out; + } + + .container.sign-up-mode:before { + transform: translate(-50%, 100%); + bottom: 32%; + right: initial; + } + + .container.sign-up-mode .left-panel .image, + .container.sign-up-mode .left-panel .content { + transform: translateY(-300px); + } + + .container.sign-up-mode .right-panel .image, + .container.sign-up-mode .right-panel .content { + transform: translateY(0px); + } + + .right-panel .image, + .right-panel .content { + transform: translateY(300px); + } + + .container.sign-up-mode .signin-signup { + top: 5%; + transform: translate(-50%, 0); + } +} + +@media (max-width: 570px) { + form { + padding: 0 1.5rem; + } + + .image { + display: none; + } + .panel .content { + padding: 0.5rem 1rem; + } + .container { + padding: 1.5rem; + } + + .container:before { + bottom: 72%; + left: 50%; + } + + .container.sign-up-mode:before { + bottom: 28%; + left: 50%; + } +} \ No newline at end of file diff --git a/static/js/signin.js b/static/js/signin.js new file mode 100644 index 0000000..8d3d624 --- /dev/null +++ b/static/js/signin.js @@ -0,0 +1,11 @@ +const sign_in_btn = document.querySelector("#sign-in-btn"); +const sign_up_btn = document.querySelector("#sign-up-btn"); +const container = document.querySelector(".container"); + +sign_up_btn.addEventListener("click", () => { + container.classList.add("sign-up-mode"); +}); + +sign_in_btn.addEventListener("click", () => { + container.classList.remove("sign-up-mode"); +}); \ No newline at end of file diff --git a/templates/app_accounts/signin.html b/templates/app_accounts/signin.html index 9325721..440aaed 100644 --- a/templates/app_accounts/signin.html +++ b/templates/app_accounts/signin.html @@ -1,10 +1,110 @@ +{% load static %} + - - - Title - - + + + + + + + Sign in & Sign up Form + + +
+
+ +
+ +
+
+
+

New here ?

+

+ Lorem ipsum, dolor sit amet consectetur adipisicing elit. Debitis, + ex ratione. Aliquid! +

+ +
+ +
+
+
+

One of us ?

+

+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum + laboriosam ad deleniti. +

+ +
+ +
+
+
- + + \ No newline at end of file From 334c9d036a65b58fe36e1be01ad2a4d6861860fe Mon Sep 17 00:00:00 2001 From: serg Date: Fri, 24 Nov 2023 14:53:01 +0100 Subject: [PATCH 2/3] installed allauth, created common template for both forms, redefined urls and views for signin and signup --- app_accounts/admin.py | 18 +- app_accounts/urls.py | 6 +- app_accounts/views.py | 25 +- eduproject_config/settings.py | 16 + eduproject_config/urls.py | 4 +- requirements.txt | 2 + static/css/base.css | 384 ++++++++++-------- templates/account/account_inactive.html | 12 + templates/account/base_entrance.html | 1 + templates/account/base_manage.html | 1 + templates/account/base_manage_email.html | 1 + templates/account/base_manage_password.html | 1 + templates/account/email.html | 90 ++++ .../email/account_already_exists_message.txt | 13 + .../email/account_already_exists_subject.txt | 4 + templates/account/email/base_message.txt | 7 + .../email/email_confirmation_message.txt | 7 + .../email_confirmation_signup_message.txt | 1 + .../email_confirmation_signup_subject.txt | 1 + .../email/email_confirmation_subject.txt | 4 + .../email/password_reset_key_message.txt | 9 + .../email/password_reset_key_subject.txt | 4 + .../account/email/unknown_account_message.txt | 12 + .../account/email/unknown_account_subject.txt | 4 + templates/account/email_change.html | 53 +++ templates/account/email_confirm.html | 38 ++ templates/account/login_signup.html | 59 +++ templates/account/logout.html | 27 ++ .../messages/cannot_delete_primary_email.txt | 2 + .../messages/email_confirmation_failed.txt | 2 + .../messages/email_confirmation_sent.txt | 2 + .../account/messages/email_confirmed.txt | 2 + templates/account/messages/email_deleted.txt | 2 + templates/account/messages/logged_in.txt | 4 + templates/account/messages/logged_out.txt | 2 + .../account/messages/password_changed.txt | 2 + templates/account/messages/password_set.txt | 2 + .../account/messages/primary_email_set.txt | 2 + .../messages/unverified_primary_email.txt | 2 + templates/account/password_change.html | 24 ++ templates/account/password_reset.html | 30 ++ templates/account/password_reset_done.html | 18 + .../account/password_reset_from_key.html | 34 ++ .../account/password_reset_from_key_done.html | 12 + templates/account/password_set.html | 24 ++ templates/account/reauthenticate.html | 32 ++ templates/account/signup.html | 32 ++ templates/account/signup_closed.html | 12 + .../account/snippets/already_logged_in.html | 9 + templates/account/snippets/warn_no_email.html | 4 + templates/account/verification_sent.html | 14 + .../account/verified_email_required.html | 25 ++ templates/allauth/elements/alert.html | 6 + templates/allauth/elements/badge.html | 5 + templates/allauth/elements/button.html | 9 + templates/allauth/elements/field.html | 27 ++ templates/allauth/elements/fields.html | 1 + templates/allauth/elements/form.html | 7 + templates/allauth/elements/h1.html | 5 + templates/allauth/elements/h2.html | 5 + templates/allauth/elements/img.html | 2 + templates/allauth/elements/panel.html | 14 + templates/allauth/elements/provider.html | 3 + templates/allauth/elements/provider_list.html | 5 + templates/allauth/layouts/base.html | 50 +++ templates/allauth/layouts/entrance.html | 2 + templates/allauth/layouts/manage.html | 2 + templates/app_base/base.html | 149 ++++--- 68 files changed, 1150 insertions(+), 240 deletions(-) create mode 100644 templates/account/account_inactive.html create mode 100644 templates/account/base_entrance.html create mode 100644 templates/account/base_manage.html create mode 100644 templates/account/base_manage_email.html create mode 100644 templates/account/base_manage_password.html create mode 100644 templates/account/email.html create mode 100644 templates/account/email/account_already_exists_message.txt create mode 100644 templates/account/email/account_already_exists_subject.txt create mode 100644 templates/account/email/base_message.txt create mode 100644 templates/account/email/email_confirmation_message.txt create mode 100644 templates/account/email/email_confirmation_signup_message.txt create mode 100644 templates/account/email/email_confirmation_signup_subject.txt create mode 100644 templates/account/email/email_confirmation_subject.txt create mode 100644 templates/account/email/password_reset_key_message.txt create mode 100644 templates/account/email/password_reset_key_subject.txt create mode 100644 templates/account/email/unknown_account_message.txt create mode 100644 templates/account/email/unknown_account_subject.txt create mode 100644 templates/account/email_change.html create mode 100644 templates/account/email_confirm.html create mode 100644 templates/account/login_signup.html create mode 100644 templates/account/logout.html create mode 100644 templates/account/messages/cannot_delete_primary_email.txt create mode 100644 templates/account/messages/email_confirmation_failed.txt create mode 100644 templates/account/messages/email_confirmation_sent.txt create mode 100644 templates/account/messages/email_confirmed.txt create mode 100644 templates/account/messages/email_deleted.txt create mode 100644 templates/account/messages/logged_in.txt create mode 100644 templates/account/messages/logged_out.txt create mode 100644 templates/account/messages/password_changed.txt create mode 100644 templates/account/messages/password_set.txt create mode 100644 templates/account/messages/primary_email_set.txt create mode 100644 templates/account/messages/unverified_primary_email.txt create mode 100644 templates/account/password_change.html create mode 100644 templates/account/password_reset.html create mode 100644 templates/account/password_reset_done.html create mode 100644 templates/account/password_reset_from_key.html create mode 100644 templates/account/password_reset_from_key_done.html create mode 100644 templates/account/password_set.html create mode 100644 templates/account/reauthenticate.html create mode 100644 templates/account/signup.html create mode 100644 templates/account/signup_closed.html create mode 100644 templates/account/snippets/already_logged_in.html create mode 100644 templates/account/snippets/warn_no_email.html create mode 100644 templates/account/verification_sent.html create mode 100644 templates/account/verified_email_required.html create mode 100644 templates/allauth/elements/alert.html create mode 100644 templates/allauth/elements/badge.html create mode 100644 templates/allauth/elements/button.html create mode 100644 templates/allauth/elements/field.html create mode 100644 templates/allauth/elements/fields.html create mode 100644 templates/allauth/elements/form.html create mode 100644 templates/allauth/elements/h1.html create mode 100644 templates/allauth/elements/h2.html create mode 100644 templates/allauth/elements/img.html create mode 100644 templates/allauth/elements/panel.html create mode 100644 templates/allauth/elements/provider.html create mode 100644 templates/allauth/elements/provider_list.html create mode 100644 templates/allauth/layouts/base.html create mode 100644 templates/allauth/layouts/entrance.html create mode 100644 templates/allauth/layouts/manage.html diff --git a/app_accounts/admin.py b/app_accounts/admin.py index ea5d68b..5519df6 100644 --- a/app_accounts/admin.py +++ b/app_accounts/admin.py @@ -1,3 +1,19 @@ from django.contrib import admin -# Register your models here. +from app_accounts.models import CustomUser + + +@admin.register(CustomUser) +class CustomUserAdmin(admin.ModelAdmin): + list_display = ('email', 'username', 'first_name', 'last_name', 'is_staff', 'is_active') + list_filter = ('is_staff', 'is_active') + search_fields = ('email', 'username', 'first_name', 'last_name') + ordering = ('email',) + readonly_fields = ('date_joined', 'last_login') + fieldsets = ( + (None, {'fields': ('email', 'username', 'password')}), + ('Personal info', {'fields': ('first_name', 'last_name')}), + ('Permissions', + {'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions')}), + ('Important dates', {'fields': ('date_joined', 'last_login')}), + ) \ No newline at end of file diff --git a/app_accounts/urls.py b/app_accounts/urls.py index fcf7870..642580a 100644 --- a/app_accounts/urls.py +++ b/app_accounts/urls.py @@ -1,7 +1,7 @@ from django.urls import path from . import views - urlpatterns = [ - path('login/', views.login, name='login'), - ] \ No newline at end of file + path('loginn/', views.UserLoginView.as_view(), name='account_login'), + path('signupp/', views.UserSignupView.as_view(), name='account_signup'), +] diff --git a/app_accounts/views.py b/app_accounts/views.py index a486752..264e8b6 100644 --- a/app_accounts/views.py +++ b/app_accounts/views.py @@ -1,7 +1,26 @@ from django.shortcuts import render +from allauth.account.views import LoginView, SignupView -# Create your views here. +class UserLoginView(LoginView): + template_name = 'account/login_signup.html' + success_url = '/' -def login(request): - return render(request, 'app_accounts/signin.html') \ No newline at end of file + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['is_login'] = True + context['form_login'] = context.pop('form') + context['form_signup'] = SignupView.form_class() + return context + + +class UserSignupView(SignupView): + template_name = 'account/login_signup.html' + success_url = '/' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['is_login'] = False + context['form_login'] = LoginView.form_class() + context['form_signup'] = context.pop('form') + return context diff --git a/eduproject_config/settings.py b/eduproject_config/settings.py index 0408e8b..a7d1ea7 100644 --- a/eduproject_config/settings.py +++ b/eduproject_config/settings.py @@ -34,6 +34,11 @@ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + # Third party apps + "allauth", + "allauth.account", + "allauth.socialaccount", + # Local apps "app_base", "app_accounts", "app_exercises", @@ -47,6 +52,7 @@ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", + "allauth.account.middleware.AccountMiddleware", ] ROOT_URLCONF = "eduproject_config.urls" @@ -67,6 +73,14 @@ }, ] +AUTHENTICATION_BACKENDS = [ + # Needed to log in by username in Django admin, regardless of `allauth` + 'django.contrib.auth.backends.ModelBackend', + + # `allauth` specific authentication methods, such as login by email + 'allauth.account.auth_backends.AuthenticationBackend', +] + WSGI_APPLICATION = "eduproject_config.wsgi.application" # Database @@ -125,3 +139,5 @@ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" AUTH_USER_MODEL = "app_accounts.CustomUser" + +EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" diff --git a/eduproject_config/urls.py b/eduproject_config/urls.py index 0f035e1..ed8a20f 100644 --- a/eduproject_config/urls.py +++ b/eduproject_config/urls.py @@ -1,9 +1,11 @@ from django.contrib import admin from django.urls import path, include - urlpatterns = [ path("admin/", admin.site.urls), path("", include("app_base.urls")), + + path('user/', include('allauth.urls')), path("user/", include("app_accounts.urls")), ] + diff --git a/requirements.txt b/requirements.txt index 065458b..5c597b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,5 @@ psycopg2-binary==2.9.9 sqlparse==0.4.4 typing_extensions==4.8.0 tzdata==2023.3 + +django-allauth~=0.58.2 \ No newline at end of file diff --git a/static/css/base.css b/static/css/base.css index cd61643..480200a 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -3,68 +3,68 @@ /*=============== VARIABLES CSS ===============*/ :root { - --header-height: 3.5rem; - - /*========== Angle for btn animation ==========*/ - --x: 45deg; - /*========== Colors ==========*/ - /*Color mode HSL(hue, saturation, lightness)*/ - --first-color: hsl(203, 71%, 60%); - --second-color: hsl(277, 56%, 68%); - --text-color: hsl(203, 8%, 98%); - --text-color-light: hsl(203, 8%, 80%); - --body-color: hsl(260, 20%, 18%); - - /*========== Font and typography ==========*/ - /*.5rem = 8px | 1rem = 16px ...*/ - --body-font: 'Oxanium', cursive; - --biggest-font-size: 2.25rem; - --h2-font-size: 1.25rem; - --normal-font-size: .938rem; - --smaller-font-size: .75rem; - - /*========== Font weight ==========*/ - --font-semi-bold: 600; - - /*========== z index ==========*/ - --z-fixed: 100; + --header-height: 3.5rem; + + /*========== Angle for btn animation ==========*/ + --x: 45deg; + /*========== Colors ==========*/ + /*Color mode HSL(hue, saturation, lightness)*/ + --first-color: hsl(203, 71%, 60%); + --second-color: hsl(277, 56%, 68%); + --text-color: hsl(203, 8%, 98%); + --text-color-light: hsl(203, 8%, 80%); + --body-color: hsl(260, 20%, 18%); + + /*========== Font and typography ==========*/ + /*.5rem = 8px | 1rem = 16px ...*/ + --body-font: 'Oxanium', cursive; + --biggest-font-size: 2.25rem; + --h2-font-size: 1.25rem; + --normal-font-size: .938rem; + --smaller-font-size: .75rem; + + /*========== Font weight ==========*/ + --font-semi-bold: 600; + + /*========== z index ==========*/ + --z-fixed: 100; } /* Responsive typography */ @media screen and (min-width: 1024px) { - :root { - --biggest-font-size: 4rem; - --h2-font-size: 1.5rem; - --normal-font-size: 1rem; - --smaller-font-size: .813rem; - } + :root { + --biggest-font-size: 4rem; + --h2-font-size: 1.5rem; + --normal-font-size: 1rem; + --smaller-font-size: .813rem; + } } /*=============== BASE ===============*/ * { - box-sizing: border-box; - padding: 0; - margin: 0; + box-sizing: border-box; + padding: 0; + margin: 0; } body { - font-family: var(--body-font); - font-size: var(--normal-font-size); - background-color: var(--body-color); - color: var(--text-color); + font-family: var(--body-font); + font-size: var(--normal-font-size); + background-color: var(--body-color); + color: var(--text-color); } ul { - list-style: none; + list-style: none; } a { - text-decoration: none; + text-decoration: none; } img { - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; } /*=============== REUSABLE CSS CLASSES ===============*/ @@ -76,51 +76,50 @@ img { } .main { - overflow: hidden; /* For the animations */ + overflow: hidden; /* For the animations */ } - /*=============== HEADER NAVBAR ===============*/ .header { - position: fixed; - width: 100%; - top: 0; - left: 0; - z-index: var(--z-fixed); - transition: backgroung .3s; - padding: 10px; + position: fixed; + width: 100%; + top: 0; + left: 0; + z-index: var(--z-fixed); + transition: backgroung .3s; + padding: 10px; } -.nav{ - height: calc(var(--header-height) + 1.5rem); - position: relative; - display: flex; - justify-content: space-between; - align-items: center; +.nav { + height: calc(var(--header-height) + 1.5rem); + position: relative; + display: flex; + justify-content: space-between; + align-items: center; } .nav__logo, .nav__toggle, .nav__link, -.nav__button{ - color: var(--text-color); +.nav__button { + color: var(--text-color); } .nav__logo { - max-width: 300px; - flex: 1; - text-align: left; - vertical-align: middle; + max-width: 300px; + flex: 1; + text-align: left; + vertical-align: middle; } -.nav__toggle{ - font-size: 1.5rem; - cursor: pointer; - flex: 1; - text-align: center; - margin-top: 0.5rem; +.nav__toggle { + font-size: 1.5rem; + cursor: pointer; + flex: 1; + text-align: center; + margin-top: 0.5rem; } @@ -130,156 +129,181 @@ img { text-align: right; } -.nav__button{ - position: relative; - width: 130px; - height: 46px; - display: inline-block; - border-radius: 5px; - margin-top: 0.5rem; - border: 1px solid var(--first-color); +.nav__button { + position: relative; + width: 130px; + height: 46px; + display: inline-block; + border-radius: 5px; + margin-top: 0.5rem; + border: 1px solid var(--first-color); } -.nav__button:hover{ - box-shadow: 0 8px 48px hsla(203,71%,25%,.5); +.nav__button:hover { + box-shadow: 0 8px 48px hsla(203, 71%, 25%, .5); } -.nav__button i{ - position: absolute; - inset: -1px; - display: block; - border-radius: 5px; +.nav__button i { + position: absolute; + inset: -1px; + display: block; + border-radius: 5px; } .nav__button i, -.nav__button i:nth-child(2){ - background: linear-gradient(var(--x), - var(--second-color), - /*var(--body-color),*/ - var(--first-color)); - /*filter: blur(2px);*/ +.nav__button i:nth-child(2) { + background: linear-gradient(var(--x), + var(--second-color), + /*var(--body-color),*/ var(--first-color)); + /*filter: blur(2px);*/ } -.nav__button span{ - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - display: flex; - justify-content: center; - align-items: center; - border-radius: 3px; - background: rgba(255, 255, 255, 0); +.nav__button span { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + border-radius: 3px; + background: rgba(255, 255, 255, 0); } - - - @media screen and (max-width: 768px) { - .nav__menu { - position: fixed; - background-color: var(--body-color); - width: 100%; - left: 0; - top: -100%; - padding: 4rem 0 3.5rem; - transition: top .4s ease; - box-shadow: 0 2px 4px rgba(0, 0, 0, .1); - overflow: hidden; - } - .nav__button{ - width: 100px; - height: 40px; - } + .nav__menu { + position: fixed; + background-color: var(--body-color); + width: 100%; + left: 0; + top: -100%; + padding: 4rem 0 3.5rem; + transition: top .4s ease; + box-shadow: 0 2px 4px rgba(0, 0, 0, .1); + overflow: hidden; + } + + .nav__button { + width: 100px; + height: 40px; + } } -.nav__list{ - display: flex; - flex-direction: column; - row-gap: 3rem; - text-align: center; +.nav__list { + display: flex; + flex-direction: column; + row-gap: 3rem; + text-align: center; } -.nav__link{ - font-weight: var(--font-semi-bold); - transition: color .4s; +.nav__link { + font-weight: var(--font-semi-bold); + transition: color .4s; } -.nav__link:hover{ - color: var(--first-color); +.nav__link:hover { + color: var(--first-color); } -.nav__close{ - position: absolute; - cursor: pointer; - top: 1rem; - font-size: 1.5rem; - left: 50%; - transform: translateX(-50%); +.nav__close { + position: absolute; + cursor: pointer; + top: 1rem; + font-size: 1.5rem; + left: 50%; + transform: translateX(-50%); } -.show-menu{ - top: 0; +.show-menu { + top: 0; } /*=============== Active Link ===============*/ -.active-link{ - background: linear-gradient(90deg, - var(--second-color) 0%, - var(--first-color) 100%); - -webkit-background-clip: text; - color: transparent; +.active-link { + background: linear-gradient(90deg, + var(--second-color) 0%, + var(--first-color) 100%); + -webkit-background-clip: text; + color: transparent; } /*===============............BREAKPOINTS.............===============*/ /*=============== For small devices ===============*/ @media screen and (max-width: 340px) { - .container { - margin-inline: 1rem; - } + .container { + margin-inline: 1rem; + } } /*=============== For medium devices ===============*/ @media screen and (min-width: 767px) { - .nav__toggle, - .nav__close { - display: none; - } - .nav__list { - flex-direction: row; - column-gap: 4rem; - } - .home__container{ - height: 100vh; - display: grid; - } + .nav__toggle, + .nav__close { + display: none; + } + + .nav__list { + flex-direction: row; + column-gap: 4rem; + } + + .home__container { + height: 100vh; + display: grid; + } } /*=============== For large devices ===============*/ @media screen and (min-width: 1024px) { - .home__title{ - margin-bottom: 3rem; - } - .hero__description{ - font-size: var(--h2-font-size); - } -} - - - - - - - - - - - - - - + .home__title { + margin-bottom: 3rem; + } + .hero__description { + font-size: var(--h2-font-size); + } +} +/*!* Messages styling *!*/ +/*.messages .alert {*/ +/* padding: 10px;*/ +/* margin-bottom: 20px;*/ +/* border: 1px solid transparent;*/ +/* border-radius: 4px;*/ +/* transition: all 0.3s ease-in-out;*/ +/*}*/ + +/*.alert-info {*/ +/* color: #31708f;*/ +/* background-color: #d9edf7;*/ +/* border-color: #bce8f1;*/ +/*}*/ + +/*.alert-success {*/ +/* color: #3c763d;*/ +/* background-color: #dff0d8;*/ +/* border-color: #d6e9c6;*/ +/*}*/ + +/*.alert-warning {*/ +/* color: #8a6d3b;*/ +/* background-color: #fcf8e3;*/ +/* border-color: #faebcc;*/ +/*}*/ + +/*.alert-danger {*/ +/* color: #a94442;*/ +/* background-color: #f2dede;*/ +/* border-color: #ebccd1;*/ +/*}*/ + +/*.alert-dismissible .close {*/ +/* position: relative;*/ +/* top: -2px;*/ +/* right: -21px;*/ +/* color: inherit;*/ +/* cursor: pointer;*/ +/*}*/ diff --git a/templates/account/account_inactive.html b/templates/account/account_inactive.html new file mode 100644 index 0000000..fb5f4b8 --- /dev/null +++ b/templates/account/account_inactive.html @@ -0,0 +1,12 @@ +{% extends "allauth/layouts/entrance.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Account Inactive" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Account Inactive" %} + {% endelement %} +

{% trans "This account is inactive." %}

+{% endblock content %} diff --git a/templates/account/base_entrance.html b/templates/account/base_entrance.html new file mode 100644 index 0000000..0cd8aaa --- /dev/null +++ b/templates/account/base_entrance.html @@ -0,0 +1 @@ +{% extends "allauth/layouts/entrance.html" %} diff --git a/templates/account/base_manage.html b/templates/account/base_manage.html new file mode 100644 index 0000000..ba6316b --- /dev/null +++ b/templates/account/base_manage.html @@ -0,0 +1 @@ +{% extends "allauth/layouts/manage.html" %} diff --git a/templates/account/base_manage_email.html b/templates/account/base_manage_email.html new file mode 100644 index 0000000..b8b2ef3 --- /dev/null +++ b/templates/account/base_manage_email.html @@ -0,0 +1 @@ +{% extends "account/base_manage.html" %} diff --git a/templates/account/base_manage_password.html b/templates/account/base_manage_password.html new file mode 100644 index 0000000..b8b2ef3 --- /dev/null +++ b/templates/account/base_manage_password.html @@ -0,0 +1 @@ +{% extends "account/base_manage.html" %} diff --git a/templates/account/email.html b/templates/account/email.html new file mode 100644 index 0000000..ce9ff0f --- /dev/null +++ b/templates/account/email.html @@ -0,0 +1,90 @@ +{% extends "account/base_manage_email.html" %} +{% load allauth i18n %} +{% block head_title %} + {% trans "Email Addresses" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Email Addresses" %} + {% endelement %} + {% if emailaddresses %} +

{% trans 'The following email addresses are associated with your account:' %}

+ {% url 'account_email' as email_url %} + {% element form form=form action=email_url method="post" %} + {% slot body %} + {% csrf_token %} + {% for radio in emailaddress_radios %} + {% with emailaddress=radio.emailaddress %} + {% element field type="radio" checked=radio.checked name="email" value=emailaddress.email id=radio.id %} + {% slot label %} + {{ emailaddress.email }} + {% if emailaddress.verified %} + {% element badge tags="success,email,verified" %} + {% translate "Verified" %} + {% endelement %} + {% else %} + {% element badge tags="warning,email,unverified" %} + {% translate "Unverified" %} + {% endelement %} + {% endif %} + {% if emailaddress.primary %} + {% element badge tags="email,primary" %} + {% translate "Primary" %} + {% endelement %} + {% endif %} + {% endslot %} + {% endelement %} + {% endwith %} + {% endfor %} + {% endslot %} + {% slot actions %} + {% element button type="submit" name="action_primary" %} + {% trans 'Make Primary' %} + {% endelement %} + {% element button tags="secondary" type="submit" name="action_send" %} + {% trans 'Re-send Verification' %} + {% endelement %} + {% element button tags="danger,delete" type="submit" name="action_remove" %} + {% trans 'Remove' %} + {% endelement %} + {% endslot %} + {% endelement %} + {% else %} + {% include "account/snippets/warn_no_email.html" %} + {% endif %} + {% if can_add_email %} + {% element h2 %} + {% trans "Add Email Address" %} + {% endelement %} + {% url 'account_email' as action_url %} + {% element form form=form method="post" action=action_url %} + Hoi bef bod + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% endslot %} + befac + {% slot actions %} + {% element button name="action_add" type="submit" %} + {% trans "Add Email" %} + {% endelement %} + {% endslot %} + {% endelement %} + {% endif %} +{% endblock content %} +{% block extra_body %} + +{% endblock extra_body %} diff --git a/templates/account/email/account_already_exists_message.txt b/templates/account/email/account_already_exists_message.txt new file mode 100644 index 0000000..7022f42 --- /dev/null +++ b/templates/account/email/account_already_exists_message.txt @@ -0,0 +1,13 @@ +{% extends "account/email/base_message.txt" %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% blocktrans %}You are receiving this email because you or someone else tried to signup for an +account using email address: + +{{ email }} + +However, an account using that email address already exists. In case you have +forgotten about this, please use the password forgotten procedure to recover +your account: + +{{ password_reset_url }}{% endblocktrans %}{% endautoescape %}{% endblock content %} diff --git a/templates/account/email/account_already_exists_subject.txt b/templates/account/email/account_already_exists_subject.txt new file mode 100644 index 0000000..481edb0 --- /dev/null +++ b/templates/account/email/account_already_exists_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Account Already Exists{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/base_message.txt b/templates/account/email/base_message.txt new file mode 100644 index 0000000..7f38c74 --- /dev/null +++ b/templates/account/email/base_message.txt @@ -0,0 +1,7 @@ +{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name %}Hello from {{ site_name }}!{% endblocktrans %} + +{% block content %}{% endblock content %} + +{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you for using {{ site_name }}! +{{ site_domain }}{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/email_confirmation_message.txt b/templates/account/email/email_confirmation_message.txt new file mode 100644 index 0000000..3ee4d2f --- /dev/null +++ b/templates/account/email/email_confirmation_message.txt @@ -0,0 +1,7 @@ +{% extends "account/email/base_message.txt" %} +{% load account %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% user_display user as user_display %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}You're receiving this email because user {{ user_display }} has given your email address to register an account on {{ site_domain }}. + +To confirm this is correct, go to {{ activate_url }}{% endblocktrans %}{% endautoescape %}{% endblock content %} diff --git a/templates/account/email/email_confirmation_signup_message.txt b/templates/account/email/email_confirmation_signup_message.txt new file mode 100644 index 0000000..9996f7e --- /dev/null +++ b/templates/account/email/email_confirmation_signup_message.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_message.txt" %} diff --git a/templates/account/email/email_confirmation_signup_subject.txt b/templates/account/email/email_confirmation_signup_subject.txt new file mode 100644 index 0000000..4c85ebb --- /dev/null +++ b/templates/account/email/email_confirmation_signup_subject.txt @@ -0,0 +1 @@ +{% include "account/email/email_confirmation_subject.txt" %} diff --git a/templates/account/email/email_confirmation_subject.txt b/templates/account/email/email_confirmation_subject.txt new file mode 100644 index 0000000..2e2c052 --- /dev/null +++ b/templates/account/email/email_confirmation_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Please Confirm Your Email Address{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/password_reset_key_message.txt b/templates/account/email/password_reset_key_message.txt new file mode 100644 index 0000000..8e4a290 --- /dev/null +++ b/templates/account/email/password_reset_key_message.txt @@ -0,0 +1,9 @@ +{% extends "account/email/base_message.txt" %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% blocktrans %}You're receiving this email because you or someone else has requested a password reset for your user account. +It can be safely ignored if you did not request a password reset. Click the link below to reset your password.{% endblocktrans %} + +{{ password_reset_url }}{% if username %} + +{% blocktrans %}In case you forgot, your username is {{ username }}.{% endblocktrans %}{% endif %}{% endautoescape %}{% endblock content %} diff --git a/templates/account/email/password_reset_key_subject.txt b/templates/account/email/password_reset_key_subject.txt new file mode 100644 index 0000000..f0fd6b5 --- /dev/null +++ b/templates/account/email/password_reset_key_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Password Reset Email{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email/unknown_account_message.txt b/templates/account/email/unknown_account_message.txt new file mode 100644 index 0000000..56cf9d2 --- /dev/null +++ b/templates/account/email/unknown_account_message.txt @@ -0,0 +1,12 @@ +{% extends "account/email/base_message.txt" %} +{% load i18n %} + +{% block content %}{% autoescape off %}{% blocktrans %}You are receiving this email because you or someone else has requested a +password for your user account. However, we do not have any record of a user +with email {{ email }} in our database. + +This mail can be safely ignored if you did not request a password reset. + +If it was you, you can sign up for an account using the link below.{% endblocktrans %} + +{{ signup_url }}{% endautoescape %}{% endblock content %} diff --git a/templates/account/email/unknown_account_subject.txt b/templates/account/email/unknown_account_subject.txt new file mode 100644 index 0000000..f0fd6b5 --- /dev/null +++ b/templates/account/email/unknown_account_subject.txt @@ -0,0 +1,4 @@ +{% load i18n %} +{% autoescape off %} +{% blocktrans %}Password Reset Email{% endblocktrans %} +{% endautoescape %} diff --git a/templates/account/email_change.html b/templates/account/email_change.html new file mode 100644 index 0000000..7cc4753 --- /dev/null +++ b/templates/account/email_change.html @@ -0,0 +1,53 @@ +{% extends "account/base_manage_email.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Email Address" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Email Address" %} + {% endelement %} + {% if emailaddresses %} + {% if current_emailaddress %} +

+ {% trans 'The following email address is associated with your account:' %} {{ current_emailaddress.email }} +

+ {% endif %} + {% if new_emailaddress %} +

+ {% trans 'Your email address is still pending verification:' %} {{ new_emailaddress.email }} +

+ {% url 'account_email' as action_url %} + {% element form method="post" action=action_url tags="button-only" no_visible_fields=True %} + {% slot body %} + {% csrf_token %} + + {% endslot %} + {% slot actions %} + {% element button type="submit" name="action_send" %} + {% trans 'Re-send Verification' %} + {% endelement %} + {% endslot %} + {% endelement %} + {% endif %} + {% else %} + {% include "account/snippets/warn_no_email.html" %} + {% endif %} + {% element h2 %} + {% trans "Change Email Address" %} + {% endelement %} + {% url 'account_email' as action_url %} + {% element form method="post" action=action_url %} + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% endslot %} + {% slot actions %} + {% element button name="action_add" type="submit" %} + {% trans "Change Email" %} + {% endelement %} + {% endslot %} + {% endelement %} +{% endblock content %} diff --git a/templates/account/email_confirm.html b/templates/account/email_confirm.html new file mode 100644 index 0000000..b341574 --- /dev/null +++ b/templates/account/email_confirm.html @@ -0,0 +1,38 @@ +{% extends "account/base_entrance.html" %} +{% load i18n %} +{% load account %} +{% load allauth %} +{% block head_title %} + {% trans "Confirm Email Address" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Confirm Email Address" %} + {% endelement %} + {% if confirmation %} + {% user_display confirmation.email_address.user as user_display %} + {% if can_confirm %} +

+ {% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an email address for user {{ user_display }}.{% endblocktrans %} +

+ {% url 'account_confirm_email' confirmation.key as action_url %} + {% element form method="post" action=action_url %} + {% slot actions %} + {% csrf_token %} + {% element button type="submit" %} + {% trans 'Confirm' %} + {% endelement %} + {% endslot %} + {% endelement %} + {% else %} +

+ {% blocktrans %}Unable to confirm {{ email }} because it is already confirmed by a different account.{% endblocktrans %} +

+ {% endif %} + {% else %} + {% url 'account_email' as email_url %} +

+ {% blocktrans %}This email confirmation link expired or is invalid. Please issue a new email confirmation request.{% endblocktrans %} +

+ {% endif %} +{% endblock content %} diff --git a/templates/account/login_signup.html b/templates/account/login_signup.html new file mode 100644 index 0000000..db933ac --- /dev/null +++ b/templates/account/login_signup.html @@ -0,0 +1,59 @@ +{% extends "account/base_entrance.html" %} +{% load i18n %} +{% load allauth account socialaccount %} +{% block head_title %} + {% trans "Sign In" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Sign In" %} + {% endelement %} +

+ {% blocktrans %}If you have not created an account yet, then please + sign up first.{% endblocktrans %} +

+ {% url 'account_login' as login_url %} + {% element form form=form method="post" action=login_url tags="entrance,login" %} + {% slot body %} + {% csrf_token %} + {{ form_login.as_p }} + {% if redirect_field_value %} + + {% endif %} + {% endslot %} + {% slot actions %} + {% element button type="submit" tags="prominent,login" %} + {% trans "Sign In" %} + {% endelement %} + {% endslot %} + {% endelement %} + {% include "socialaccount/snippets/login.html" with page_layout="entrance" %} + + {# ------------------------------------------------------------------------------ #} + {% element h1 %} + {% trans "Sign Up" %} + {% endelement %} +

+ {% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %} +

+ {% url 'account_signup' as action_url %} + {% element form form=form method="post" action=action_url tags="entrance,signup" %} + {% slot body %} + {% csrf_token %} + {{ form_signup.as_p }} + {% if redirect_field_value %} + + {% endif %} + {% endslot %} + {% slot actions %} + {% element button tags="prominent,signup" type="submit" %} + {% trans "Sign Up" %} + {% endelement %} + {% endslot %} + {% endelement %} + {% include "socialaccount/snippets/login.html" with page_layout="entrance" %} +{% endblock content %} diff --git a/templates/account/logout.html b/templates/account/logout.html new file mode 100644 index 0000000..7c4adfa --- /dev/null +++ b/templates/account/logout.html @@ -0,0 +1,27 @@ +{% extends "account/base_manage.html" %} +{% load allauth i18n %} +{% block head_title %} + {% trans "Sign Out" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Sign Out" %} + {% endelement %} +

{% trans 'Are you sure you want to sign out?' %}

+ {% url 'account_logout' as action_url %} + {% element form method="post" action=action_url no_visible_fields=True %} + {% slot body %} + {% csrf_token %} + {% if redirect_field_value %} + + {% endif %} + {% endslot %} + {% slot actions %} + {% element button type="submit" %} + {% trans 'Sign Out' %} + {% endelement %} + {% endslot %} + {% endelement %} +{% endblock content %} diff --git a/templates/account/messages/cannot_delete_primary_email.txt b/templates/account/messages/cannot_delete_primary_email.txt new file mode 100644 index 0000000..9c17574 --- /dev/null +++ b/templates/account/messages/cannot_delete_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You cannot remove your primary email address ({{email}}).{% endblocktrans %} diff --git a/templates/account/messages/email_confirmation_failed.txt b/templates/account/messages/email_confirmation_failed.txt new file mode 100644 index 0000000..6930821 --- /dev/null +++ b/templates/account/messages/email_confirmation_failed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Unable to confirm {{email}} because it is already confirmed by a different account.{% endblocktrans %} diff --git a/templates/account/messages/email_confirmation_sent.txt b/templates/account/messages/email_confirmation_sent.txt new file mode 100644 index 0000000..fb30b31 --- /dev/null +++ b/templates/account/messages/email_confirmation_sent.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Confirmation email sent to {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/email_confirmed.txt b/templates/account/messages/email_confirmed.txt new file mode 100644 index 0000000..3427a4d --- /dev/null +++ b/templates/account/messages/email_confirmed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have confirmed {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/email_deleted.txt b/templates/account/messages/email_deleted.txt new file mode 100644 index 0000000..27bb630 --- /dev/null +++ b/templates/account/messages/email_deleted.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Removed email address {{email}}.{% endblocktrans %} diff --git a/templates/account/messages/logged_in.txt b/templates/account/messages/logged_in.txt new file mode 100644 index 0000000..f49248a --- /dev/null +++ b/templates/account/messages/logged_in.txt @@ -0,0 +1,4 @@ +{% load account %} +{% load i18n %} +{% user_display user as name %} +{% blocktrans %}Successfully signed in as {{name}}.{% endblocktrans %} diff --git a/templates/account/messages/logged_out.txt b/templates/account/messages/logged_out.txt new file mode 100644 index 0000000..2cd4627 --- /dev/null +++ b/templates/account/messages/logged_out.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}You have signed out.{% endblocktrans %} diff --git a/templates/account/messages/password_changed.txt b/templates/account/messages/password_changed.txt new file mode 100644 index 0000000..bd5801c --- /dev/null +++ b/templates/account/messages/password_changed.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Password successfully changed.{% endblocktrans %} diff --git a/templates/account/messages/password_set.txt b/templates/account/messages/password_set.txt new file mode 100644 index 0000000..9d224ee --- /dev/null +++ b/templates/account/messages/password_set.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Password successfully set.{% endblocktrans %} diff --git a/templates/account/messages/primary_email_set.txt b/templates/account/messages/primary_email_set.txt new file mode 100644 index 0000000..3ef8561 --- /dev/null +++ b/templates/account/messages/primary_email_set.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Primary email address set.{% endblocktrans %} diff --git a/templates/account/messages/unverified_primary_email.txt b/templates/account/messages/unverified_primary_email.txt new file mode 100644 index 0000000..7d0ef9c --- /dev/null +++ b/templates/account/messages/unverified_primary_email.txt @@ -0,0 +1,2 @@ +{% load i18n %} +{% blocktrans %}Your primary email address must be verified.{% endblocktrans %} diff --git a/templates/account/password_change.html b/templates/account/password_change.html new file mode 100644 index 0000000..9df9e26 --- /dev/null +++ b/templates/account/password_change.html @@ -0,0 +1,24 @@ +{% extends "account/base_manage_password.html" %} +{% load allauth i18n %} +{% block head_title %} + {% trans "Change Password" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Change Password" %} + {% endelement %} + {% url 'account_change_password' as action_url %} + {% element form form=form method="post" action=action_url %} + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% endslot %} + {% slot actions %} + {% element button type="submit" %} + {% trans "Change Password" %} + {% endelement %} + {% trans "Forgot Password?" %} + {% endslot %} + {% endelement %} +{% endblock content %} diff --git a/templates/account/password_reset.html b/templates/account/password_reset.html new file mode 100644 index 0000000..c4ba7ce --- /dev/null +++ b/templates/account/password_reset.html @@ -0,0 +1,30 @@ +{% extends "account/base_entrance.html" %} +{% load i18n allauth account %} +{% block head_title %} + {% trans "Password Reset" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Password Reset" %} + {% endelement %} + {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} +

+ {% trans "Forgotten your password? Enter your email address below, and we'll send you an email allowing you to reset it." %} +

+ {% url 'account_reset_password' as reset_url %} + {% element form form=form method="post" action=reset_url %} + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% endslot %} + {% slot actions %} + {% element button type="submit" %} + {% trans 'Reset My Password' %} + {% endelement %} + {% endslot %} + {% endelement %} +

{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}

+{% endblock content %} diff --git a/templates/account/password_reset_done.html b/templates/account/password_reset_done.html new file mode 100644 index 0000000..847f236 --- /dev/null +++ b/templates/account/password_reset_done.html @@ -0,0 +1,18 @@ +{% extends "account/base_entrance.html" %} +{% load i18n %} +{% load allauth %} +{% load account %} +{% block head_title %} + {% trans "Password Reset" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Password Reset" %} + {% endelement %} + {% if user.is_authenticated %} + {% include "account/snippets/already_logged_in.html" %} + {% endif %} +

+ {% blocktrans %}We have sent you an email. If you have not received it please check your spam folder. Otherwise contact us if you do not receive it in a few minutes.{% endblocktrans %} +

+{% endblock content %} diff --git a/templates/account/password_reset_from_key.html b/templates/account/password_reset_from_key.html new file mode 100644 index 0000000..f8f0d3f --- /dev/null +++ b/templates/account/password_reset_from_key.html @@ -0,0 +1,34 @@ +{% extends "account/base_entrance.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Change Password" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% if token_fail %} + {% trans "Bad Token" %} + {% else %} + {% trans "Change Password" %} + {% endif %} + {% endelement %} + {% if token_fail %} + {% url 'account_reset_password' as passwd_reset_url %} +

+ {% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %} +

+ {% else %} + {% element form method="post" action=action_url %} + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% endslot %} + {% slot actions %} + {% element button type="submit" name="action" %} + {% trans 'Change Password' %} + {% endelement %} + {% endslot %} + {% endelement %} + {% endif %} +{% endblock content %} diff --git a/templates/account/password_reset_from_key_done.html b/templates/account/password_reset_from_key_done.html new file mode 100644 index 0000000..7b02cf5 --- /dev/null +++ b/templates/account/password_reset_from_key_done.html @@ -0,0 +1,12 @@ +{% extends "account/base_entrance.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Change Password" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Change Password" %} + {% endelement %} +

{% trans 'Your password is now changed.' %}

+{% endblock content %} diff --git a/templates/account/password_set.html b/templates/account/password_set.html new file mode 100644 index 0000000..21e2fc8 --- /dev/null +++ b/templates/account/password_set.html @@ -0,0 +1,24 @@ +{% extends "account/base_manage_password.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Set Password" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Set Password" %} + {% endelement %} + {% url 'account_set_password' as action_url %} + {% element form method="post" action=action_url %} + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% endslot %} + {% slot actions %} + {% element button type="submit" name="action" %} + {% trans 'Set Password' %} + {% endelement %} + {% endslot %} + {% endelement %} +{% endblock content %} diff --git a/templates/account/reauthenticate.html b/templates/account/reauthenticate.html new file mode 100644 index 0000000..16ae1fc --- /dev/null +++ b/templates/account/reauthenticate.html @@ -0,0 +1,32 @@ +{% extends "account/base_manage.html" %} +{% load allauth %} +{% load i18n %} +{% block head_title %} + {% trans "Confirm Access" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Confirm Access" %} + {% endelement %} +

+ {% blocktranslate %}To safeguard the security of your account, please enter your password:{% endblocktranslate %} +

+ {% url 'account_reauthenticate' as action_url %} + {% element form form=form method="post" action=action_url %} + {% slot body %} + {% csrf_token %} + {% element fields form=form %} + {% endelement %} + {% if redirect_field_value %} + + {% endif %} + {% endslot %} + {% slot actions %} + {% element button type="submit" %} + {% trans "Confirm" %} + {% endelement %} + {% endslot %} + {% endelement %} +{% endblock content %} diff --git a/templates/account/signup.html b/templates/account/signup.html new file mode 100644 index 0000000..212973a --- /dev/null +++ b/templates/account/signup.html @@ -0,0 +1,32 @@ +{% extends "account/base_entrance.html" %} +{% load allauth i18n socialaccount %} +{% block head_title %} + {% trans "Signup" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Sign Up" %} + {% endelement %} +

+ {% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %} +

+ {% url 'account_signup' as action_url %} + {% element form form=form method="post" action=action_url tags="entrance,signup" %} + {% slot body %} + {% csrf_token %} + {% element fields form=form unlabeled=True %} + {% endelement %} + {% if redirect_field_value %} + + {% endif %} + {% endslot %} + {% slot actions %} + {% element button tags="prominent,signup" type="submit" %} + {% trans "Sign Up" %} + {% endelement %} + {% endslot %} + {% endelement %} + {% include "socialaccount/snippets/login.html" with page_layout="entrance" %} +{% endblock content %} diff --git a/templates/account/signup_closed.html b/templates/account/signup_closed.html new file mode 100644 index 0000000..80b8480 --- /dev/null +++ b/templates/account/signup_closed.html @@ -0,0 +1,12 @@ +{% extends "account/base_entrance.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Sign Up Closed" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Sign Up Closed" %} + {% endelement %} +

{% trans "We are sorry, but the sign up is currently closed." %}

+{% endblock content %} diff --git a/templates/account/snippets/already_logged_in.html b/templates/account/snippets/already_logged_in.html new file mode 100644 index 0000000..f6640da --- /dev/null +++ b/templates/account/snippets/already_logged_in.html @@ -0,0 +1,9 @@ +{% load i18n %} +{% load account %} +{% load allauth %} +{% user_display user as user_display %} +{% element alert %} + {% slot message %} + {% blocktranslate %}Note{% endblocktranslate %}: {% blocktranslate %}You are already logged in as {{ user_display }}.{% endblocktranslate %} + {% endslot %} +{% endelement %} diff --git a/templates/account/snippets/warn_no_email.html b/templates/account/snippets/warn_no_email.html new file mode 100644 index 0000000..bc2c91c --- /dev/null +++ b/templates/account/snippets/warn_no_email.html @@ -0,0 +1,4 @@ +{% load i18n %} +

+ {% trans 'Warning:' %} {% trans "You currently do not have any email address set up. You should really add an email address so you can receive notifications, reset your password, etc." %} +

diff --git a/templates/account/verification_sent.html b/templates/account/verification_sent.html new file mode 100644 index 0000000..0aaf575 --- /dev/null +++ b/templates/account/verification_sent.html @@ -0,0 +1,14 @@ +{% extends "account/base_entrance.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Verify Your Email Address" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Verify Your Email Address" %} + {% endelement %} +

+ {% blocktrans %}We have sent an email to you for verification. Follow the link provided to finalize the signup process. If you do not see the verification email in your main inbox, check your spam folder. Please contact us if you do not receive the verification email within a few minutes.{% endblocktrans %} +

+{% endblock content %} diff --git a/templates/account/verified_email_required.html b/templates/account/verified_email_required.html new file mode 100644 index 0000000..79c8edc --- /dev/null +++ b/templates/account/verified_email_required.html @@ -0,0 +1,25 @@ +{% extends "account/base_manage.html" %} +{% load i18n %} +{% load allauth %} +{% block head_title %} + {% trans "Verify Your Email Address" %} +{% endblock head_title %} +{% block content %} + {% element h1 %} + {% trans "Verify Your Email Address" %} + {% endelement %} + {% url 'account_email' as email_url %} +

+ {% blocktrans %}This part of the site requires us to verify that +you are who you claim to be. For this purpose, we require that you +verify ownership of your email address. {% endblocktrans %} +

+

+ {% blocktrans %}We have sent an email to you for +verification. Please click on the link inside that email. If you do not see the verification email in your main inbox, check your spam folder. Otherwise +contact us if you do not receive it within a few minutes.{% endblocktrans %} +

+

+ {% blocktrans %}Note: you can still change your email address.{% endblocktrans %} +

+{% endblock content %} diff --git a/templates/allauth/elements/alert.html b/templates/allauth/elements/alert.html new file mode 100644 index 0000000..ea7b65a --- /dev/null +++ b/templates/allauth/elements/alert.html @@ -0,0 +1,6 @@ +{% load i18n %} +{% load allauth %} +

+ {% slot message %} + {% endslot %} +

diff --git a/templates/allauth/elements/badge.html b/templates/allauth/elements/badge.html new file mode 100644 index 0000000..8f21300 --- /dev/null +++ b/templates/allauth/elements/badge.html @@ -0,0 +1,5 @@ +{% load allauth %} + + {% slot %} + {% endslot %} + diff --git a/templates/allauth/elements/button.html b/templates/allauth/elements/button.html new file mode 100644 index 0000000..4d86697 --- /dev/null +++ b/templates/allauth/elements/button.html @@ -0,0 +1,9 @@ +{% load allauth %} +{% comment %} djlint:off {% endcomment %} +<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %} +{% if attrs.name %}name="{{ attrs.name }}"{% endif %} +{% if attrs.type %}type="{{ attrs.type }}"{% endif %} +> +{% slot %} +{% endslot %} + diff --git a/templates/allauth/elements/field.html b/templates/allauth/elements/field.html new file mode 100644 index 0000000..9dda1d4 --- /dev/null +++ b/templates/allauth/elements/field.html @@ -0,0 +1,27 @@ +{% load allauth %} +

+ + {% if attrs.type == "textarea" %} + + {% else %} + + {% endif %} + {% if attrs.help_text %}{{ attrs.help_text }}{% endif %} +

diff --git a/templates/allauth/elements/fields.html b/templates/allauth/elements/fields.html new file mode 100644 index 0000000..62797cf --- /dev/null +++ b/templates/allauth/elements/fields.html @@ -0,0 +1 @@ +{{ attrs.form.as_p }} diff --git a/templates/allauth/elements/form.html b/templates/allauth/elements/form.html new file mode 100644 index 0000000..afcbe61 --- /dev/null +++ b/templates/allauth/elements/form.html @@ -0,0 +1,7 @@ +{% load allauth %} +
+ {% slot body %} + {% endslot %} + {% slot actions %} + {% endslot %} +
diff --git a/templates/allauth/elements/h1.html b/templates/allauth/elements/h1.html new file mode 100644 index 0000000..40ebed8 --- /dev/null +++ b/templates/allauth/elements/h1.html @@ -0,0 +1,5 @@ +{% load allauth %} +

+ {% slot default %} + {% endslot %} +

diff --git a/templates/allauth/elements/h2.html b/templates/allauth/elements/h2.html new file mode 100644 index 0000000..e2b412a --- /dev/null +++ b/templates/allauth/elements/h2.html @@ -0,0 +1,5 @@ +{% load allauth %} +

+ {% slot default %} + {% endslot %} +

diff --git a/templates/allauth/elements/img.html b/templates/allauth/elements/img.html new file mode 100644 index 0000000..ae9280a --- /dev/null +++ b/templates/allauth/elements/img.html @@ -0,0 +1,2 @@ + diff --git a/templates/allauth/elements/panel.html b/templates/allauth/elements/panel.html new file mode 100644 index 0000000..82248a3 --- /dev/null +++ b/templates/allauth/elements/panel.html @@ -0,0 +1,14 @@ +{% load allauth %} +
+

+ {% slot title %} + {% endslot %} +

+ {% slot body %} + {% endslot %} + {% if slots.actions %} +
    + {% for action in slots.actions %}
  • {{ action }}
  • {% endfor %} +
+ {% endif %} +
diff --git a/templates/allauth/elements/provider.html b/templates/allauth/elements/provider.html new file mode 100644 index 0000000..2e44483 --- /dev/null +++ b/templates/allauth/elements/provider.html @@ -0,0 +1,3 @@ +
  • + {{ attrs.name }} +
  • diff --git a/templates/allauth/elements/provider_list.html b/templates/allauth/elements/provider_list.html new file mode 100644 index 0000000..041d7bc --- /dev/null +++ b/templates/allauth/elements/provider_list.html @@ -0,0 +1,5 @@ +{% load allauth %} + diff --git a/templates/allauth/layouts/base.html b/templates/allauth/layouts/base.html new file mode 100644 index 0000000..63d2e18 --- /dev/null +++ b/templates/allauth/layouts/base.html @@ -0,0 +1,50 @@ +{% load i18n %} + + + + + + + {% block head_title %} + {% endblock head_title %} + + {% block extra_head %} + {% endblock extra_head %} + + + {% block body %} + {% if messages %} +
    + {% trans "Messages:" %} +
      + {% for message in messages %}
    • {{ message }}
    • {% endfor %} +
    +
    + {% endif %} +
    + {% trans "Menu:" %} + +
    + {% block content %} + {% endblock content %} + {% endblock body %} + {% block extra_body %} + {% endblock extra_body %} + + diff --git a/templates/allauth/layouts/entrance.html b/templates/allauth/layouts/entrance.html new file mode 100644 index 0000000..cce546a --- /dev/null +++ b/templates/allauth/layouts/entrance.html @@ -0,0 +1,2 @@ +{% extends "allauth/layouts/base.html" %} +{% block content %}{% endblock %} diff --git a/templates/allauth/layouts/manage.html b/templates/allauth/layouts/manage.html new file mode 100644 index 0000000..cce546a --- /dev/null +++ b/templates/allauth/layouts/manage.html @@ -0,0 +1,2 @@ +{% extends "allauth/layouts/base.html" %} +{% block content %}{% endblock %} diff --git a/templates/app_base/base.html b/templates/app_base/base.html index f85503d..6adc9b3 100644 --- a/templates/app_base/base.html +++ b/templates/app_base/base.html @@ -18,6 +18,7 @@ "@splinetool/runtime": "https://unpkg.com/@splinetool/runtime@0.9.455/build/runtime.js" } } + @@ -25,72 +26,119 @@ - + +
    + {% if messages %} + {% for message in messages %} +
    + {{ message }} +
    + {% endfor %} + {% endif %} +
    {% block header %} - {% endblock %} {% block hero %} {% endblock %} {% block footer %} -
    -
    - -
    -
    +
    +
    + +
    +
    {% endblock %} @@ -104,8 +152,5 @@ - - - \ No newline at end of file From 872ec9020952edeadcf6cd3d4011bac998bf489e Mon Sep 17 00:00:00 2001 From: serg Date: Fri, 24 Nov 2023 14:55:12 +0100 Subject: [PATCH 3/3] update requirements.txt --- requirements.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5c597b8..c26610c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,21 @@ asgiref==3.7.2 +certifi==2023.11.17 +cffi==1.16.0 +charset-normalizer==3.3.2 +cryptography==41.0.5 +defusedxml==0.7.1 Django==4.2.5 +django-allauth==0.58.2 +idna==3.4 +oauthlib==3.2.2 Pillow==10.1.0 psycopg2-binary==2.9.9 +pycparser==2.21 +PyJWT==2.8.0 +python3-openid==3.2.0 +requests==2.31.0 +requests-oauthlib==1.3.1 sqlparse==0.4.4 typing_extensions==4.8.0 tzdata==2023.3 - -django-allauth~=0.58.2 \ No newline at end of file +urllib3==2.1.0