diff --git a/bookwyrm/migrations/0098_auto_20210918_2238.py b/bookwyrm/migrations/0098_auto_20210918_2238.py new file mode 100644 index 000000000..09fdba317 --- /dev/null +++ b/bookwyrm/migrations/0098_auto_20210918_2238.py @@ -0,0 +1,27 @@ +# Generated by Django 3.2.4 on 2021-09-18 22:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0097_auto_20210917_1858"), + ] + + operations = [ + migrations.AddField( + model_name="sitesettings", + name="invite_request_text", + field=models.TextField( + default="If your request is approved, you will receive an email with a registration link." + ), + ), + migrations.AlterField( + model_name="sitesettings", + name="registration_closed_text", + field=models.TextField( + default='We aren\'t taking new users at this time. You can find an open instance at joinbookwyrm.com/instances.' + ), + ), + ] diff --git a/bookwyrm/models/site.py b/bookwyrm/models/site.py index ee69a507f..052573af1 100644 --- a/bookwyrm/models/site.py +++ b/bookwyrm/models/site.py @@ -24,7 +24,13 @@ class SiteSettings(models.Model): # about page registration_closed_text = models.TextField( - default="Contact an administrator to get an invite" + default="We aren't taking new users at this time. You can find an open " + 'instance at ' + "joinbookwyrm.com/instances." + ) + invite_request_text = models.TextField( + default="If your request is approved, you will receive an email with a " + "registration link." ) code_of_conduct = models.TextField(default="Add a code of conduct here.") privacy_policy = models.TextField(default="Add a privacy policy here.") diff --git a/bookwyrm/templates/invite.html b/bookwyrm/templates/invite.html index 22a3a32ca..fcd379e26 100644 --- a/bookwyrm/templates/invite.html +++ b/bookwyrm/templates/invite.html @@ -5,11 +5,11 @@ {% block content %} +

{% trans "Create an Account" %}

{% if valid %} -

{% trans "Create an Account" %}

@@ -25,7 +25,7 @@
-
+
{% include 'snippets/about.html' %}
diff --git a/bookwyrm/templates/landing/about.html b/bookwyrm/templates/landing/about.html index dd7036c4f..c3b1e84ef 100644 --- a/bookwyrm/templates/landing/about.html +++ b/bookwyrm/templates/landing/about.html @@ -1,4 +1,4 @@ -{% extends 'landing/landing_layout.html' %} +{% extends 'landing/layout.html' %} {% load i18n %} {% block panel %} diff --git a/bookwyrm/templates/landing/landing.html b/bookwyrm/templates/landing/landing.html index 7a30f1617..d13cd582a 100644 --- a/bookwyrm/templates/landing/landing.html +++ b/bookwyrm/templates/landing/landing.html @@ -1,4 +1,4 @@ -{% extends 'landing/landing_layout.html' %} +{% extends 'landing/layout.html' %} {% load i18n %} {% block panel %} diff --git a/bookwyrm/templates/landing/landing_layout.html b/bookwyrm/templates/landing/layout.html similarity index 53% rename from bookwyrm/templates/landing/landing_layout.html rename to bookwyrm/templates/landing/layout.html index 946482cbb..0d6f231c1 100644 --- a/bookwyrm/templates/landing/landing_layout.html +++ b/bookwyrm/templates/landing/layout.html @@ -40,38 +40,41 @@
{% if not request.user.is_authenticated %}
+

+ {% if site.allow_registration %} + {% blocktrans with name=site.name %}Join {{ name }}{% endblocktrans %} + {% elif site.allow_invite_requests %} + {% trans "Request an Invitation" %} + {% else %} + {% blocktrans with name=site.name%}{{ name}} registration is closed{% endblocktrans %} + {% endif %} +

+ {% if site.allow_registration %} -

{% blocktrans with name=site.name %}Join {{ name }}{% endblocktrans %}

- - {% include 'snippets/register_form.html' %} - - +
+ {% include 'snippets/register_form.html' %} +
+ {% elif site.allow_invite_requests %} + {% if request_received %} +

+ {% trans "Thank you! Your request has been received." %} +

+ {% else %} +

{{ site.invite_request_text }}

+
+ {% csrf_token %} +
+ + + {% for error in request_form.email.errors %} +

{{ error|escape }}

+ {% endfor %} +
+ +
+ {% endif %} {% else %} - -

{% trans "This instance is closed" %}

-

{{ site.registration_closed_text|safe}}

- - {% if site.allow_invite_requests %} - {% if request_received %} -

- {% trans "Thank you! Your request has been received." %} -

- {% else %} -

{% trans "Request an Invitation" %}

-
- {% csrf_token %} -
- - - {% for error in request_form.email.errors %} -

{{ error|escape }}

- {% endfor %} -
- -
- {% endif %} - {% endif %} - +

{{ site.registration_closed_text|safe}}

{% endif %}
{% else %} diff --git a/bookwyrm/templates/login.html b/bookwyrm/templates/login.html index 19c103eac..31e9cebb4 100644 --- a/bookwyrm/templates/login.html +++ b/bookwyrm/templates/login.html @@ -4,69 +4,65 @@ {% block title %}{% trans "Login" %}{% endblock %} {% block content %} -
-
-
-

{% trans "Log in" %}

- {% if login_form.non_field_errors %} -

{{ login_form.non_field_errors }}

- {% endif %} +

{% trans "Log in" %}

+
+
+ {% if login_form.non_field_errors %} +

{{ login_form.non_field_errors }}

+ {% endif %} - {% if show_confirmed_email %} -

{% trans "Success! Email address confirmed." %}

- {% endif %} -
- {% csrf_token %} - {% if show_confirmed_email %}{% endif %} -
- -
- {{ login_form.localname }} -
+ {% if show_confirmed_email %} +

{% trans "Success! Email address confirmed." %}

+ {% endif %} + + {% csrf_token %} + {% if show_confirmed_email %}{% endif %} +
+ +
+ {{ login_form.localname }}
-
- -
- {{ login_form.password }} -
- {% for error in login_form.password.errors %} -

{{ error | escape }}

- {% endfor %} +
+
+ +
+ {{ login_form.password }}
-
-
- -
- + {% for error in login_form.password.errors %} +

{{ error | escape }}

+ {% endfor %} +
+
+
+
- -
+ +
+
-
+ {% if site.allow_registration %} +
- {% if site.allow_registration %}

{% trans "Create an Account" %}

{% include 'snippets/register_form.html' %}
- {% else %} -

{% trans "This instance is closed" %}

-

{% trans "Contact an administrator to get an invite" %}

- {% endif %} +
+
+ {% endif %} + +
+
+ {% include 'snippets/about.html' %} + +

+ {% trans "More about this site" %} +

-
-
- {% include 'snippets/about.html' %} - -

- {% trans "More about this site" %} -

-
-
{% endblock %} diff --git a/bookwyrm/templates/settings/site.html b/bookwyrm/templates/settings/site.html index 945e5749b..508954857 100644 --- a/bookwyrm/templates/settings/site.html +++ b/bookwyrm/templates/settings/site.html @@ -107,6 +107,13 @@ {{ site_form.registration_closed_text }}
+
+ + {{ site_form.invite_request_text }} + {% for error in site_form.invite_request_text.errors %} +

{{ error|escape }}

+ {% endfor %} +