From 7f35cc41f5f5db918fc8801a41bec0ecad92ef50 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 3 Jul 2017 13:35:36 +0200 Subject: [PATCH] Moved out custom settings areas --- publichealth/home/models/__init__.py | 2 +- publichealth/home/models/{settings.py => admin.py} | 4 +++- publichealth/home/models/models.py | 2 +- publichealth/settings/base.py | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) rename publichealth/home/models/{settings.py => admin.py} (93%) diff --git a/publichealth/home/models/__init__.py b/publichealth/home/models/__init__.py index 472bee0..52e04bb 100644 --- a/publichealth/home/models/__init__.py +++ b/publichealth/home/models/__init__.py @@ -1,4 +1,4 @@ from .forms import * from .models import * from .snippets import * -from .settings import * +from .admin import * diff --git a/publichealth/home/models/settings.py b/publichealth/home/models/admin.py similarity index 93% rename from publichealth/home/models/settings.py rename to publichealth/home/models/admin.py index 8dfaa0a..8cf4eec 100644 --- a/publichealth/home/models/settings.py +++ b/publichealth/home/models/admin.py @@ -7,6 +7,8 @@ from django.core.mail import send_mail from wagtail.contrib.settings.models import BaseSetting, register_setting +# A simple feedback module built into the site admin + @register_setting class DataletsSettings(BaseSetting): feedback_question = models.TextField( @@ -23,7 +25,7 @@ class DataletsSettings(BaseSetting): feedback_comment = models.TextField( help_text='Any general feedback', blank=True) class Meta: - verbose_name = 'Datalets' + verbose_name = 'Get support' @receiver(pre_save, sender=DataletsSettings) def handle_save_settings(sender, instance, *args, **kwargs): diff --git a/publichealth/home/models/models.py b/publichealth/home/models/models.py index 852df91..19681db 100644 --- a/publichealth/home/models/models.py +++ b/publichealth/home/models/models.py @@ -230,6 +230,6 @@ class HomePage(Page): context['newsfeed'] = self.newsfeed return context - parent_page_types = [] + parent_page_types = ['wagtailcore.Page'] class Meta: verbose_name = "Frontpage" diff --git a/publichealth/settings/base.py b/publichealth/settings/base.py index 0aa5702..8c2aff4 100644 --- a/publichealth/settings/base.py +++ b/publichealth/settings/base.py @@ -23,11 +23,13 @@ BASE_DIR = os.path.dirname(PROJECT_DIR) INSTALLED_APPS = [ 'publichealth.home', 'publichealth.home.templatetags', + 'publichealth.feedler', 'publichealth.search', 'wagtail.contrib.wagtailsearchpromotions', 'wagtail.contrib.wagtailroutablepage', 'wagtail.contrib.wagtailsitemaps', + 'wagtail.contrib.modeladmin', 'wagtail.contrib.settings', 'wagtail.wagtailforms', 'wagtail.wagtailredirects',