Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Merge 5a45d86 into 02e0cb9
Browse files Browse the repository at this point in the history
  • Loading branch information
Magdalena Noffke authored Jul 24, 2019
2 parents 02e0cb9 + 5a45d86 commit 8b57901
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 2.2.3 on 2019-07-24 11:22

from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.fields


class Migration(migrations.Migration):

dependencies = [
('wagtailcore', '0041_group_collection_permissions_verbose_name_plural'),
('a4_candy_cms_settings', '0003_rename_table_to_default'),
]

operations = [
migrations.CreateModel(
name='SocialMedia',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('facebook', models.URLField(blank=True)),
('twitter', models.URLField(blank=True)),
('github', models.URLField(blank=True)),
('site', models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.Site')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='OrganisationSettings',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('address', wagtail.core.fields.RichTextField()),
('contacts', wagtail.core.fields.RichTextField()),
('site', models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.Site')),
],
options={
'abstract': False,
},
),
]
26 changes: 26 additions & 0 deletions apps/cms/settings/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from django.db import models
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.admin.edit_handlers import PageChooserPanel
from wagtail.contrib.settings.models import BaseSetting
from wagtail.contrib.settings.models import register_setting
from wagtail.core import fields


@register_setting
Expand Down Expand Up @@ -30,3 +32,27 @@ class ImportantPages(BaseSetting):
PageChooserPanel('imprint'),
PageChooserPanel('data_protection_policy')
]


@register_setting
class OrganisationSettings(BaseSetting):
address = fields.RichTextField()
contacts = fields.RichTextField()

panels = [
FieldPanel('address'),
FieldPanel('contacts')
]


@register_setting
class SocialMedia(BaseSetting):
facebook = models.URLField(blank=True)
twitter = models.URLField(blank=True)
github = models.URLField(blank=True)

panels = [
FieldPanel('facebook'),
FieldPanel('twitter'),
FieldPanel('github')
]

0 comments on commit 8b57901

Please sign in to comment.