Skip to content

Commit

Permalink
apps/cms: add setting for sample project and platform info
Browse files Browse the repository at this point in the history
  • Loading branch information
philli-m committed Feb 27, 2023
1 parent 54051eb commit 27b6aec
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.14 on 2022-08-05 15:10

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('wagtailcore', '0069_log_entry_jsonfield'),
('a4_candy_cms_settings', '0006_add_helptexts_to_organisation_pages'),
]

operations = [
migrations.AddField(
model_name='importantpages',
name='platform_information',
field=models.ForeignKey(blank=True, help_text='If set, a link to this page will added to the userdashboard.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='platform_information', to='wagtailcore.page'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.14 on 2022-08-05 16:43

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('a4_candy_cms_settings', '0007_importantpages_platform_information'),
]

operations = [
migrations.AddField(
model_name='organisationsettings',
name='sample_project_slug',
field=models.SlugField(blank=True, help_text='Slug of the sample project of this platform. Every new user will automatically follow this project.', max_length=255),
),
]
28 changes: 27 additions & 1 deletion apps/cms/settings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ class ImportantPages(BaseSetting):
related_name="important_page_contact",
null=True,
blank=True,
on_delete=models.SET_NULL,
on_delete=models.SET_NULL
)
platform_information = models.ForeignKey(
'wagtailcore.Page',
related_name='platform_information',
null=True,
blank=True,
on_delete=models.SET_NULL,
help_text='If set, a link to this page will added to the userdashboard.')
donate_link = models.URLField(blank=True)
manual_link = models.URLField(blank=True)
github_repo_link = models.URLField(blank=True)
Expand Down Expand Up @@ -106,6 +113,17 @@ class ImportantPages(BaseSetting):
"a4_candy_cms_use_cases.UseCasePage",
],
),
PageChooserPanel(
'platform_information',
[
'a4_candy_cms_pages.SimplePage',
'a4_candy_cms_contacts.FormPage',
'a4_candy_cms_news.NewsIndexPage',
'a4_candy_cms_news.NewsPage',
'a4_candy_cms_use_cases.UseCaseIndexPage',
'a4_candy_cms_use_cases.UseCasePage'
],
),
FieldPanel("donate_link"),
FieldPanel("manual_link"),
FieldPanel("github_repo_link"),
Expand All @@ -131,6 +149,13 @@ class OrganisationSettings(BaseSetting):
contacts = fields.RichTextField(
help_text="The contacts are published on the contact form."
)
sample_project_slug = models.SlugField(
max_length=255,
blank=True,
help_text=(
"Slug of the sample project of this platform. Every new user will automatically follow this project."
)
)

class Meta:
verbose_name = "Platform settings"
Expand All @@ -139,6 +164,7 @@ class Meta:
FieldPanel("platform_name"),
FieldPanel("address"),
FieldPanel("contacts"),
FieldPanel('sample_project_slug')
]


Expand Down

0 comments on commit 27b6aec

Please sign in to comment.