From 1896a8136ebd44336841c8189179d2128522e4cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Tue, 24 Dec 2019 13:31:55 +0100 Subject: [PATCH] Implement optional registration --- .idea/dataSources.xml | 15 +------ .idea/misc.xml | 2 +- bookmarks/styles/{login.scss => auth.scss} | 2 +- bookmarks/styles/index.scss | 2 +- .../registration_complete.html | 16 +++++++ .../registration_form.html | 44 +++++++++++++++++++ bookmarks/templates/registration/login.html | 18 ++++++-- requirements.prod.txt | 1 + requirements.txt | 2 + siteroot/settings/base.py | 3 ++ siteroot/settings/custom.py | 2 + siteroot/urls.py | 8 +++- 12 files changed, 94 insertions(+), 21 deletions(-) rename bookmarks/styles/{login.scss => auth.scss} (84%) create mode 100644 bookmarks/templates/django_registration/registration_complete.html create mode 100644 bookmarks/templates/django_registration/registration_form.html diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 507b0ad..8934729 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -1,22 +1,11 @@ - + sqlite.xerial true org.sqlite.JDBC - jdbc:sqlite:$PROJECT_DIR$/db.sqlite3 - - - - - - file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/sqlite-jdbc-3.25.1.jar - - - file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/license.txt - - + jdbc:sqlite:$PROJECT_DIR$/data/db.sqlite3 \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index ad2d41e..08beb51 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/bookmarks/styles/login.scss b/bookmarks/styles/auth.scss similarity index 84% rename from bookmarks/styles/login.scss rename to bookmarks/styles/auth.scss index e4d04b3..e2ff6b6 100644 --- a/bookmarks/styles/login.scss +++ b/bookmarks/styles/auth.scss @@ -1,4 +1,4 @@ -.login-page { +.auth-page { > .columns { align-items: center; justify-content: center; diff --git a/bookmarks/styles/index.scss b/bookmarks/styles/index.scss index b86c22e..8797384 100644 --- a/bookmarks/styles/index.scss +++ b/bookmarks/styles/index.scss @@ -23,4 +23,4 @@ $alternative-color-dark: darken($alternative-color, 5%); @import "shared"; @import "bookmarks"; @import "settings"; -@import "login"; +@import "auth"; diff --git a/bookmarks/templates/django_registration/registration_complete.html b/bookmarks/templates/django_registration/registration_complete.html new file mode 100644 index 0000000..dfedc89 --- /dev/null +++ b/bookmarks/templates/django_registration/registration_complete.html @@ -0,0 +1,16 @@ +{% extends 'bookmarks/layout.html' %} +{% load widget_tweaks %} + +{% block title %}Registration complete{% endblock %} + +{% block content %} + +
+
+
+

Registration complete. You can now use the application.

+
+
+
+ +{% endblock %} diff --git a/bookmarks/templates/django_registration/registration_form.html b/bookmarks/templates/django_registration/registration_form.html new file mode 100644 index 0000000..d9347da --- /dev/null +++ b/bookmarks/templates/django_registration/registration_form.html @@ -0,0 +1,44 @@ +{% extends 'bookmarks/layout.html' %} +{% load widget_tweaks %} + +{% block title %}Registration{% endblock %} + +{% block content %} + +
+
+
+
+

Register

+
+
+ {% csrf_token %} +
+ + {{ form.username|add_class:'form-input' }} +
{{ form.errors.username }}
+
+
+ + {{ form.email|add_class:'form-input' }} +
{{ form.errors.email }}
+
+
+ + {{ form.password1|add_class:'form-input' }} +
{{ form.errors.password1 }}
+
+
+ + {{ form.password2|add_class:'form-input' }} +
{{ form.errors.password2 }}
+
+ + + +
+
+
+
+ +{% endblock %} diff --git a/bookmarks/templates/registration/login.html b/bookmarks/templates/registration/login.html index 5ea46cd..f188bef 100644 --- a/bookmarks/templates/registration/login.html +++ b/bookmarks/templates/registration/login.html @@ -5,7 +5,7 @@ {% block content %} -