diff --git a/fedireads/models/__init__.py b/fedireads/models/__init__.py index 52cedf62..deb54867 100644 --- a/fedireads/models/__init__.py +++ b/fedireads/models/__init__.py @@ -6,3 +6,4 @@ from .status import Favorite, Boost, Tag, Notification, ReadThrough from .user import User, UserFollows, UserFollowRequest, UserBlocks from .user import FederatedServer from .import_job import ImportJob, ImportItem +from .site import SiteSettings diff --git a/fedireads/models/site.py b/fedireads/models/site.py new file mode 100644 index 00000000..8068e4a1 --- /dev/null +++ b/fedireads/models/site.py @@ -0,0 +1,19 @@ +from django.db import models +from fedireads.settings import DOMAIN + +class SiteSettings(models.Model): + name = models.CharField(default=DOMAIN, max_length=100) + instance_description = models.TextField( + default="This instance has no description.") + code_of_conduct = models.TextField( + default="Add a code of conduct here.") + allow_registration = models.BooleanField(default=True) + + @classmethod + def get(cls): + try: + return cls.objects.get(id=1) + except cls.DoesNotExist: + default_settings = SiteSettings(id=1) + default_settings.save() + return default_settings diff --git a/fedireads/templates/about.html b/fedireads/templates/about.html new file mode 100644 index 00000000..58cc385d --- /dev/null +++ b/fedireads/templates/about.html @@ -0,0 +1,21 @@ +{% extends 'layout.html' %} +{% block content %} +
+ {{ site_settings.instance_description }} +
+ ++ + Login or Create an Account + +
+ ++ {{ site_settings.code_of_conduct }} +
+ ++ {{ site_settings.instance_description }} +
+ ++ + More about this site + +
+@@ -9,6 +22,7 @@ friends here and on any other federated server, like Mastodon and PixelFed.
+ {% if site_settings.allow_registration %}