Moved out custom settings areas

This commit is contained in:
Oleg Lavrovsky 2017-07-03 13:35:36 +02:00
parent 180c6b0f0b
commit 7f35cc41f5
4 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,4 @@
from .forms import * from .forms import *
from .models import * from .models import *
from .snippets import * from .snippets import *
from .settings import * from .admin import *

View file

@ -7,6 +7,8 @@ from django.core.mail import send_mail
from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.contrib.settings.models import BaseSetting, register_setting
# A simple feedback module built into the site admin
@register_setting @register_setting
class DataletsSettings(BaseSetting): class DataletsSettings(BaseSetting):
feedback_question = models.TextField( feedback_question = models.TextField(
@ -23,7 +25,7 @@ class DataletsSettings(BaseSetting):
feedback_comment = models.TextField( feedback_comment = models.TextField(
help_text='Any general feedback', blank=True) help_text='Any general feedback', blank=True)
class Meta: class Meta:
verbose_name = 'Datalets' verbose_name = 'Get support'
@receiver(pre_save, sender=DataletsSettings) @receiver(pre_save, sender=DataletsSettings)
def handle_save_settings(sender, instance, *args, **kwargs): def handle_save_settings(sender, instance, *args, **kwargs):

View file

@ -230,6 +230,6 @@ class HomePage(Page):
context['newsfeed'] = self.newsfeed context['newsfeed'] = self.newsfeed
return context return context
parent_page_types = [] parent_page_types = ['wagtailcore.Page']
class Meta: class Meta:
verbose_name = "Frontpage" verbose_name = "Frontpage"

View file

@ -23,11 +23,13 @@ BASE_DIR = os.path.dirname(PROJECT_DIR)
INSTALLED_APPS = [ INSTALLED_APPS = [
'publichealth.home', 'publichealth.home',
'publichealth.home.templatetags', 'publichealth.home.templatetags',
'publichealth.feedler',
'publichealth.search', 'publichealth.search',
'wagtail.contrib.wagtailsearchpromotions', 'wagtail.contrib.wagtailsearchpromotions',
'wagtail.contrib.wagtailroutablepage', 'wagtail.contrib.wagtailroutablepage',
'wagtail.contrib.wagtailsitemaps', 'wagtail.contrib.wagtailsitemaps',
'wagtail.contrib.modeladmin',
'wagtail.contrib.settings', 'wagtail.contrib.settings',
'wagtail.wagtailforms', 'wagtail.wagtailforms',
'wagtail.wagtailredirects', 'wagtail.wagtailredirects',