From 0f4a30324ebf6f58f205f81e889ebf30fd67791d Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 4 Jan 2021 12:58:31 -0800 Subject: [PATCH] Makes more about instance text customizable --- .../migrations/0032_auto_20210104_2055.py | 23 +++++++++++++++++++ bookwyrm/models/site.py | 12 ++++++---- bookwyrm/templates/discover.html | 4 ++-- bookwyrm/templates/layout.html | 4 ++-- 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 bookwyrm/migrations/0032_auto_20210104_2055.py diff --git a/bookwyrm/migrations/0032_auto_20210104_2055.py b/bookwyrm/migrations/0032_auto_20210104_2055.py new file mode 100644 index 000000000..692cd581f --- /dev/null +++ b/bookwyrm/migrations/0032_auto_20210104_2055.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.7 on 2021-01-04 20:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0031_auto_20210104_2040'), + ] + + operations = [ + migrations.AddField( + model_name='sitesettings', + name='instance_tagline', + field=models.CharField(default='Social Reading and Reviewing', max_length=150), + ), + migrations.AddField( + model_name='sitesettings', + name='registration_closed_text', + field=models.TextField(default='Contact an administrator to get an invite'), + ), + ] diff --git a/bookwyrm/models/site.py b/bookwyrm/models/site.py index f20be7ba4..f31e84949 100644 --- a/bookwyrm/models/site.py +++ b/bookwyrm/models/site.py @@ -12,10 +12,14 @@ from .user import User class SiteSettings(models.Model): ''' customized settings for this instance ''' name = models.CharField(default='BookWyrm', max_length=100) + instance_tagline = models.CharField( + max_length=150, default='Social Reading and Reviewing') instance_description = models.TextField( - default="This instance has no description.") + default='This instance has no description.') + registration_closed_text = models.TextField( + default='Contact an administrator to get an invite') code_of_conduct = models.TextField( - default="Add a code of conduct here.") + default='Add a code of conduct here.') allow_registration = models.BooleanField(default=True) logo = models.ImageField( upload_to='logos/', null=True, blank=True @@ -61,7 +65,7 @@ class SiteInvite(models.Model): @property def link(self): ''' formats the invite link ''' - return "https://{}/invite/{}".format(DOMAIN, self.code) + return 'https://{}/invite/{}'.format(DOMAIN, self.code) def get_passowrd_reset_expiry(): @@ -83,4 +87,4 @@ class PasswordReset(models.Model): @property def link(self): ''' formats the invite link ''' - return "https://{}/password-reset/{}".format(DOMAIN, self.code) + return 'https://{}/password-reset/{}'.format(DOMAIN, self.code) diff --git a/bookwyrm/templates/discover.html b/bookwyrm/templates/discover.html index a28a67bd2..ee531f17b 100644 --- a/bookwyrm/templates/discover.html +++ b/bookwyrm/templates/discover.html @@ -3,7 +3,7 @@ {% if not request.user.is_authenticated %}
-

{{ site.name }}: Social Reading and Reviewing

+

{{ site.name }}: {{ site.instance_tagline }}

@@ -21,7 +21,7 @@ {% else %}

This instance is closed

-

Contact an administrator to get an invite

+

{{ site.registration_closed_text }}

{% endif %} diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index b11ed7feb..fe448585d 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -13,8 +13,8 @@ - - + +