From 025686490499a60445c5050c3ec5fe947e916208 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 17 Jun 2021 22:40:33 +0200 Subject: [PATCH] social auth stuff --- .env.template | 2 +- .../templates/account/password_change.html | 17 +++++++++++++++ cookbook/templates/account/password_set.html | 16 ++++++++++++++ cookbook/templates/socialaccount/signup.html | 21 +++++++++++++++++++ cookbook/views/views.py | 2 +- 5 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 cookbook/templates/account/password_change.html create mode 100644 cookbook/templates/account/password_set.html create mode 100644 cookbook/templates/socialaccount/signup.html diff --git a/.env.template b/.env.template index 97f5604c8..bd0c6c52a 100644 --- a/.env.template +++ b/.env.template @@ -81,7 +81,7 @@ REVERSE_PROXY_AUTH=0 # Default settings for spaces, apply per space and can be changed in the admin view # SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes # SPACE_DEFAULT_MAX_USERS=0 # 0=unlimited users per space -# SPACE_DEFAULT_FILES=1 # 1=can upload files (images, etc.) NOT IMPLEMENTED YET +# SPACE_DEFAULT_MAX_FILES=0 # Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload. # allow people to create accounts on your application instance (without an invite link) # when unset: 0 (false) diff --git a/cookbook/templates/account/password_change.html b/cookbook/templates/account/password_change.html new file mode 100644 index 000000000..a68e7769e --- /dev/null +++ b/cookbook/templates/account/password_change.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% load crispy_forms_filters %} + +{% load i18n %} + +{% block head_title %}{% trans "Change Password" %}{% endblock %} + +{% block content %} +

{% trans "Change Password" %}

+ +
+ {% csrf_token %} + {{ form | crispy }} + + {% trans "Forgot Password?" %} +
+{% endblock %} \ No newline at end of file diff --git a/cookbook/templates/account/password_set.html b/cookbook/templates/account/password_set.html new file mode 100644 index 000000000..d7747a66d --- /dev/null +++ b/cookbook/templates/account/password_set.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} +{% load crispy_forms_filters %} + +{% load i18n %} + +{% block head_title %}{% trans "Set Password" %}{% endblock %} + +{% block content %} +

{% trans "Set Password" %}

+ +
+ {% csrf_token %} + {{ form | crispy }} + +
+{% endblock %} \ No newline at end of file diff --git a/cookbook/templates/socialaccount/signup.html b/cookbook/templates/socialaccount/signup.html new file mode 100644 index 000000000..ca8c1ab2b --- /dev/null +++ b/cookbook/templates/socialaccount/signup.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block head_title %}{% trans "Signup" %}{% endblock %} + +{% block content %} +

{% trans "Sign Up" %}

+ +

{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to +{{site_name}}. As a final step, please complete the following form:{% endblocktrans %}

+ +
+ {% csrf_token %} + {{ form.as_p }} + {% if redirect_field_value %} + + {% endif %} + +
+ +{% endblock %} \ No newline at end of file diff --git a/cookbook/views/views.py b/cookbook/views/views.py index e3ef19501..4dbd5f2f6 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -114,7 +114,7 @@ def no_space(request): created_space = Space.objects.create( name=create_form.cleaned_data['name'], created_by=request.user, - allow_files=settings.SPACE_DEFAULT_FILES, + max_file_storage_mb=settings.SPACE_DEFAULT_FILES, max_recipes=settings.SPACE_DEFAULT_MAX_RECIPES, max_users=settings.SPACE_DEFAULT_MAX_USERS, )