diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index ecabb8d7..3784158c 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -75,6 +75,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'bookwyrm.context_processors.site_settings', ], }, }, diff --git a/bookwyrm/templates/about.html b/bookwyrm/templates/about.html index 25caf5e2..aa7426ca 100644 --- a/bookwyrm/templates/about.html +++ b/bookwyrm/templates/about.html @@ -3,13 +3,13 @@
- {% include 'snippets/about.html' with site_settings=site_settings %} + {% include 'snippets/about.html' %}

Code of Conduct

- {{ site_settings.code_of_conduct | safe }} + {{ site.code_of_conduct | safe }}
diff --git a/bookwyrm/templates/invite.html b/bookwyrm/templates/invite.html index 332a5ed2..42f564d6 100644 --- a/bookwyrm/templates/invite.html +++ b/bookwyrm/templates/invite.html @@ -15,7 +15,7 @@
- {% include 'snippets/about.html' with site_settings=site_settings %} + {% include 'snippets/about.html' %}
diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 4ae70a4b..a363debd 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -2,7 +2,7 @@ - {% if title %}{{ title }} | {% endif %}BookWyrm + {% if title %}{{ title }} | {% endif %}{{ site.name }} @@ -11,12 +11,10 @@ - - + + - - @@ -123,6 +121,15 @@ {% endblock %} + + diff --git a/bookwyrm/templates/login.html b/bookwyrm/templates/login.html index 0142d390..ce5d9e41 100644 --- a/bookwyrm/templates/login.html +++ b/bookwyrm/templates/login.html @@ -36,7 +36,7 @@
- {% if site_settings.allow_registration %} + {% if site.allow_registration %}

Create an Account

{% include 'snippets/register_form.html' %} @@ -50,7 +50,7 @@
- {% include 'snippets/about.html' with site_settings=site_settings %} + {% include 'snippets/about.html' %}

More about this site diff --git a/bookwyrm/templates/password_reset.html b/bookwyrm/templates/password_reset.html index ac2ba7bd..99d114e4 100644 --- a/bookwyrm/templates/password_reset.html +++ b/bookwyrm/templates/password_reset.html @@ -34,7 +34,7 @@

- {% include 'snippets/about.html' with site_settings=site_settings %} + {% include 'snippets/about.html' %}
diff --git a/bookwyrm/templates/snippets/about.html b/bookwyrm/templates/snippets/about.html index 35b39f82..9660f521 100644 --- a/bookwyrm/templates/snippets/about.html +++ b/bookwyrm/templates/snippets/about.html @@ -1,7 +1,7 @@ -

About {{ site_settings.name }}

+

About {{ site.name }}

BookWyrm

- {{ site_settings.instance_description }} + {{ site.instance_description }}

diff --git a/bookwyrm/view_actions.py b/bookwyrm/view_actions.py index bb862007..c3b48b3b 100644 --- a/bookwyrm/view_actions.py +++ b/bookwyrm/view_actions.py @@ -42,7 +42,6 @@ def user_login(request): login_form.non_field_errors = 'Username or password are incorrect' register_form = forms.RegisterForm() data = { - 'site_settings': models.SiteSettings.get(), 'login_form': login_form, 'register_form': register_form } @@ -78,7 +77,6 @@ def register(request): if errors: data = { - 'site_settings': models.SiteSettings.get(), 'login_form': forms.LoginForm(), 'register_form': form } diff --git a/bookwyrm/views.py b/bookwyrm/views.py index e0feaee7..ab42557c 100644 --- a/bookwyrm/views.py +++ b/bookwyrm/views.py @@ -235,7 +235,6 @@ def login_page(request): # send user to the login page data = { 'title': 'Login', - 'site_settings': models.SiteSettings.get(), 'login_form': forms.LoginForm(), 'register_form': forms.RegisterForm(), } @@ -247,7 +246,6 @@ def about_page(request): ''' more information about the instance ''' data = { 'title': 'About', - 'site_settings': models.SiteSettings.get(), } return TemplateResponse(request, 'about.html', data) @@ -295,7 +293,6 @@ def invite_page(request, code): data = { 'title': 'Join', - 'site_settings': models.SiteSettings.get(), 'register_form': forms.RegisterForm(), 'invite': invite, }