Skip to content

Commit b275136

Browse files
privacy policy and code of conduct pages
1 parent 508c223 commit b275136

7 files changed

+357
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Django 4.2.7 on 2024-07-31 21:16
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import wagtail.blocks
6+
import wagtail.fields
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
13+
('misc', '0007_alter_dataprinciplespage_footer_button_text'),
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name='CodeOfConductPage',
19+
fields=[
20+
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
21+
('intro', wagtail.fields.RichTextField(blank=True)),
22+
('short_version_title', models.CharField(default='Short Version')),
23+
('short_version_body', wagtail.fields.RichTextField(blank=True)),
24+
('full_version_title', models.CharField(default='Full Version')),
25+
('full_version_body', wagtail.fields.RichTextField(blank=True)),
26+
('complaint_handling_title', models.CharField(default='Complaint Handling Process')),
27+
('complaint_handling_body', wagtail.fields.RichTextField(blank=True)),
28+
('our_policies_title', models.CharField(default='Our Policies')),
29+
('our_policies_links', wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock()), ('link', wagtail.blocks.StreamBlock([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())]))]))], blank=True, help_text='Links to be shown under the Our Policies section.', null=True, use_json_field=True)),
30+
('question_block_title', models.CharField(default='Have a question about the code of conduct?')),
31+
('question_block_button_text', models.CharField(default='Contact Community Working Group')),
32+
('question_block_button_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
33+
],
34+
options={
35+
'abstract': False,
36+
},
37+
bases=('wagtailcore.page',),
38+
),
39+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Generated by Django 4.2.7 on 2024-08-01 16:35
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import wagtail.blocks
6+
import wagtail.fields
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
dependencies = [
12+
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
13+
('misc', '0008_codeofconductpage'),
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name='PrivacyPolicyPage',
19+
fields=[
20+
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
21+
('intro', wagtail.fields.RichTextField(blank=True)),
22+
('body_text', wagtail.fields.RichTextField(blank=True)),
23+
('our_policies_title', models.CharField(default='Our Policies')),
24+
('our_policies_links', wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock()), ('link', wagtail.blocks.StreamBlock([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())]))]))], blank=True, help_text='Links to be shown under the Our Policies section.', null=True, use_json_field=True)),
25+
('question_block_title', models.CharField(default='Have a question about the code of conduct?')),
26+
('question_block_button_text', models.CharField(default='Contact Community Working Group')),
27+
('question_block_button_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
28+
],
29+
options={
30+
'abstract': False,
31+
},
32+
bases=('wagtailcore.page',),
33+
),
34+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.7 on 2024-08-01 16:48
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('misc', '0009_privacypolicypage'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='privacypolicypage',
15+
name='question_block_button_text',
16+
field=models.CharField(default='Contact HOT'),
17+
),
18+
migrations.AlterField(
19+
model_name='privacypolicypage',
20+
name='question_block_title',
21+
field=models.CharField(default='Have a question about the privacy policy?'),
22+
),
23+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Generated by Django 4.2.7 on 2024-08-01 18:58
2+
3+
from django.db import migrations, models
4+
import wagtail.blocks
5+
import wagtail.fields
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('misc', '0010_alter_privacypolicypage_question_block_button_text_and_more'),
12+
]
13+
14+
operations = [
15+
migrations.RenameField(
16+
model_name='privacypolicypage',
17+
old_name='body_text',
18+
new_name='brief_body_text',
19+
),
20+
migrations.AddField(
21+
model_name='privacypolicypage',
22+
name='body_sections',
23+
field=wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('body', wagtail.blocks.RichTextBlock())]))], blank=True, help_text='Sections to be shown in the body following the table of contents; these sections will automatically populate the table of contents.', null=True, use_json_field=True),
24+
),
25+
migrations.AddField(
26+
model_name='privacypolicypage',
27+
name='table_of_contents_title',
28+
field=models.CharField(default='This Privacy Policy Contains the Following Sections:'),
29+
),
30+
]

app/misc/models.py

+88
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,94 @@
88
from app.core.models import LinkOrPageBlock
99

1010

11+
class CodeOfConductPage(Page):
12+
max_count = 1
13+
14+
intro = RichTextField(blank=True)
15+
16+
short_version_title = models.CharField(default="Short Version")
17+
short_version_body = RichTextField(blank=True)
18+
19+
full_version_title = models.CharField(default="Full Version")
20+
full_version_body = RichTextField(blank=True)
21+
22+
complaint_handling_title = models.CharField(default="Complaint Handling Process")
23+
complaint_handling_body = RichTextField(blank=True)
24+
25+
our_policies_title = models.CharField(default="Our Policies")
26+
our_policies_links = StreamField([
27+
('blocks', StructBlock([
28+
('text', CharBlock()),
29+
('link', LinkOrPageBlock())
30+
]))
31+
], use_json_field=True, null=True, blank=True, help_text="Links to be shown under the Our Policies section.")
32+
33+
question_block_title = models.CharField(default="Have a question about the code of conduct?")
34+
question_block_button_text = models.CharField(default="Contact Community Working Group")
35+
question_block_button_link = StreamField(LinkOrPageBlock(), use_json_field=True, blank=True)
36+
37+
content_panels = Page.content_panels + [
38+
MultiFieldPanel([
39+
FieldPanel('intro'),
40+
FieldPanel('short_version_title'),
41+
FieldPanel('short_version_body'),
42+
FieldPanel('full_version_title'),
43+
FieldPanel('full_version_body'),
44+
FieldPanel('complaint_handling_title'),
45+
FieldPanel('complaint_handling_body'),
46+
], heading="Body"),
47+
MultiFieldPanel([
48+
FieldPanel('our_policies_title'),
49+
FieldPanel('our_policies_links'),
50+
FieldPanel('question_block_title'),
51+
FieldPanel('question_block_button_text'),
52+
FieldPanel('question_block_button_link'),
53+
], heading="Sidebar"),
54+
]
55+
56+
57+
class PrivacyPolicyPage(Page):
58+
max_count = 1
59+
60+
intro = RichTextField(blank=True)
61+
brief_body_text = RichTextField(blank=True)
62+
table_of_contents_title = models.CharField(default="This Privacy Policy Contains the Following Sections:")
63+
body_sections = StreamField([
64+
('blocks', StructBlock([
65+
('title', CharBlock()),
66+
('body', RichTextBlock())
67+
]))
68+
], use_json_field=True, null=True, blank=True, help_text="Sections to be shown in the body following the table of contents; these sections will automatically populate the table of contents.")
69+
70+
our_policies_title = models.CharField(default="Our Policies")
71+
our_policies_links = StreamField([
72+
('blocks', StructBlock([
73+
('text', CharBlock()),
74+
('link', LinkOrPageBlock())
75+
]))
76+
], use_json_field=True, null=True, blank=True, help_text="Links to be shown under the Our Policies section.")
77+
78+
question_block_title = models.CharField(default="Have a question about the privacy policy?")
79+
question_block_button_text = models.CharField(default="Contact HOT")
80+
question_block_button_link = StreamField(LinkOrPageBlock(), use_json_field=True, blank=True)
81+
82+
content_panels = Page.content_panels + [
83+
MultiFieldPanel([
84+
FieldPanel('intro'),
85+
FieldPanel('brief_body_text'),
86+
FieldPanel('table_of_contents_title'),
87+
FieldPanel('body_sections'),
88+
], heading="Body"),
89+
MultiFieldPanel([
90+
FieldPanel('our_policies_title'),
91+
FieldPanel('our_policies_links'),
92+
FieldPanel('question_block_title'),
93+
FieldPanel('question_block_button_text'),
94+
FieldPanel('question_block_button_link'),
95+
], heading="Sidebar"),
96+
]
97+
98+
1199
class JoinOurConversationPage(Page):
12100
max_count = 1
13101

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{% extends "base.html" %}
2+
{% load static %}
3+
{% load wagtailcore_tags %}
4+
{% load wagtailimages_tags %}
5+
{% load compress %}
6+
{% block body_class %}template-dataprinciplespage{% endblock %}
7+
{% block extra_css %}
8+
{% compress css %}
9+
{% endcompress css %}
10+
{% endblock extra_css %}
11+
12+
{% block content %}
13+
<div class="max-w-7xl mx-auto my-10">
14+
<div class="px-6 md:px-10">
15+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
16+
<div class="lg:col-span-2">
17+
<h1 class="font-semibold text-h1">
18+
{{page.title}}
19+
</h1>
20+
<div class="text-intro font-medium">
21+
{{page.intro|safe}}
22+
</div>
23+
24+
<h2 class="font-bold text-h2 mt-8">
25+
{{page.short_version_title}}
26+
</h2>
27+
<div class="base-article-m">
28+
{{page.short_version_body|safe}}
29+
</div>
30+
31+
<h2 class="font-bold text-h2 mt-8">
32+
{{page.full_version_title}}
33+
</h2>
34+
<div class="base-article-m">
35+
{{page.full_version_body|safe}}
36+
</div>
37+
38+
<h2 class="font-bold text-h2 mt-8">
39+
{{page.complaint_handling_title}}
40+
</h2>
41+
<div class="base-article-m">
42+
{{page.complaint_handling_body|safe}}
43+
</div>
44+
</div>
45+
46+
<div>
47+
<h1 class="text-h2 font-bold">
48+
{{page.our_policies_title}}
49+
</h1>
50+
<div class="grid gap-4 mt-4">
51+
{% for policy in page.our_policies_links %}
52+
<p>
53+
{% include "ui/components/BaseLink.html" with linktext=policy.value.text linkurl=policy.value.link %}
54+
</p>
55+
{% endfor %}
56+
</div>
57+
58+
<div class="bg-hot-off-white p-8 mt-16">
59+
<h1 class="font-bold text-h3 mb-8">
60+
{{page.question_block_title}}
61+
</h1>
62+
<a href="{{page.question_block_button_link}}">
63+
{% include "components/branded_elements/button.html" with text=page.question_block_button_text %}
64+
</a>
65+
</div>
66+
</div>
67+
</div>
68+
</div>
69+
</div>
70+
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{% extends "base.html" %}
2+
{% load static %}
3+
{% load wagtailcore_tags %}
4+
{% load wagtailimages_tags %}
5+
{% load compress %}
6+
{% block body_class %}template-dataprinciplespage{% endblock %}
7+
{% block extra_css %}
8+
{% compress css %}
9+
{% endcompress css %}
10+
{% endblock extra_css %}
11+
12+
{% block content %}
13+
<div class="max-w-7xl mx-auto my-10">
14+
<div class="px-6 md:px-10">
15+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
16+
<div class="lg:col-span-2 [&_h2]:mt-6 [&_h2]:mb-4 [&_h3]:mt-6 [&_h3]:mb-4">
17+
<h1 class="font-semibold text-h1">
18+
{{page.title}}
19+
</h1>
20+
<div class="text-intro font-medium">
21+
{{page.intro|safe}}
22+
</div>
23+
24+
<div class="base-article-m">
25+
{{page.brief_body_text|safe}}
26+
27+
<h3>
28+
{{page.table_of_contents_title}}
29+
</h3>
30+
<ol>
31+
{% for section in page.body_sections %}
32+
<a href="#section-{{forloop.counter}}">
33+
<li>
34+
{{section.value.title}}
35+
</li>
36+
</a>
37+
{% endfor %}
38+
</ol>
39+
40+
{% for section in page.body_sections %}
41+
<h2 id="section-{{forloop.counter}}">
42+
{{forloop.counter}}. {{section.value.title}}
43+
</h2>
44+
{{section.value.body|safe}}
45+
{% endfor %}
46+
</div>
47+
</div>
48+
49+
<div>
50+
<h1 class="text-h2 font-bold">
51+
{{page.our_policies_title}}
52+
</h1>
53+
<div class="grid gap-4 mt-4">
54+
{% for policy in page.our_policies_links %}
55+
<p>
56+
{% include "ui/components/BaseLink.html" with linktext=policy.value.text linkurl=policy.value.link %}
57+
</p>
58+
{% endfor %}
59+
</div>
60+
61+
<div class="bg-hot-off-white p-8 mt-16">
62+
<h1 class="font-bold text-h3 mb-8">
63+
{{page.question_block_title}}
64+
</h1>
65+
<a href="{{page.question_block_button_link}}">
66+
{% include "components/branded_elements/button.html" with text=page.question_block_button_text %}
67+
</a>
68+
</div>
69+
</div>
70+
</div>
71+
</div>
72+
</div>
73+
{% endblock %}

0 commit comments

Comments
 (0)