-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from hotosm/feat/code-of-conduct-privacy-policy
privacy policy and code of conduct pages
- Loading branch information
Showing
7 changed files
with
357 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Generated by Django 4.2.7 on 2024-07-31 21:16 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0089_log_entry_data_json_null_to_object'), | ||
('misc', '0007_alter_dataprinciplespage_footer_button_text'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='CodeOfConductPage', | ||
fields=[ | ||
('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')), | ||
('intro', wagtail.fields.RichTextField(blank=True)), | ||
('short_version_title', models.CharField(default='Short Version')), | ||
('short_version_body', wagtail.fields.RichTextField(blank=True)), | ||
('full_version_title', models.CharField(default='Full Version')), | ||
('full_version_body', wagtail.fields.RichTextField(blank=True)), | ||
('complaint_handling_title', models.CharField(default='Complaint Handling Process')), | ||
('complaint_handling_body', wagtail.fields.RichTextField(blank=True)), | ||
('our_policies_title', models.CharField(default='Our Policies')), | ||
('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)), | ||
('question_block_title', models.CharField(default='Have a question about the code of conduct?')), | ||
('question_block_button_text', models.CharField(default='Contact Community Working Group')), | ||
('question_block_button_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by Django 4.2.7 on 2024-08-01 16:35 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0089_log_entry_data_json_null_to_object'), | ||
('misc', '0008_codeofconductpage'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='PrivacyPolicyPage', | ||
fields=[ | ||
('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')), | ||
('intro', wagtail.fields.RichTextField(blank=True)), | ||
('body_text', wagtail.fields.RichTextField(blank=True)), | ||
('our_policies_title', models.CharField(default='Our Policies')), | ||
('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)), | ||
('question_block_title', models.CharField(default='Have a question about the code of conduct?')), | ||
('question_block_button_text', models.CharField(default='Contact Community Working Group')), | ||
('question_block_button_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
app/misc/migrations/0010_alter_privacypolicypage_question_block_button_text_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.2.7 on 2024-08-01 16:48 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('misc', '0009_privacypolicypage'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='privacypolicypage', | ||
name='question_block_button_text', | ||
field=models.CharField(default='Contact HOT'), | ||
), | ||
migrations.AlterField( | ||
model_name='privacypolicypage', | ||
name='question_block_title', | ||
field=models.CharField(default='Have a question about the privacy policy?'), | ||
), | ||
] |
30 changes: 30 additions & 0 deletions
30
app/misc/migrations/0011_rename_body_text_privacypolicypage_brief_body_text_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 4.2.7 on 2024-08-01 18:58 | ||
|
||
from django.db import migrations, models | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('misc', '0010_alter_privacypolicypage_question_block_button_text_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='privacypolicypage', | ||
old_name='body_text', | ||
new_name='brief_body_text', | ||
), | ||
migrations.AddField( | ||
model_name='privacypolicypage', | ||
name='body_sections', | ||
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), | ||
), | ||
migrations.AddField( | ||
model_name='privacypolicypage', | ||
name='table_of_contents_title', | ||
field=models.CharField(default='This Privacy Policy Contains the Following Sections:'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% load wagtailcore_tags %} | ||
{% load wagtailimages_tags %} | ||
{% load compress %} | ||
{% block body_class %}template-dataprinciplespage{% endblock %} | ||
{% block extra_css %} | ||
{% compress css %} | ||
{% endcompress css %} | ||
{% endblock extra_css %} | ||
|
||
{% block content %} | ||
<div class="max-w-7xl mx-auto my-10"> | ||
<div class="px-6 md:px-10"> | ||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> | ||
<div class="lg:col-span-2"> | ||
<h1 class="font-semibold text-h1"> | ||
{{page.title}} | ||
</h1> | ||
<div class="text-intro font-medium"> | ||
{{page.intro|safe}} | ||
</div> | ||
|
||
<h2 class="font-bold text-h2 mt-8"> | ||
{{page.short_version_title}} | ||
</h2> | ||
<div class="base-article-m"> | ||
{{page.short_version_body|safe}} | ||
</div> | ||
|
||
<h2 class="font-bold text-h2 mt-8"> | ||
{{page.full_version_title}} | ||
</h2> | ||
<div class="base-article-m"> | ||
{{page.full_version_body|safe}} | ||
</div> | ||
|
||
<h2 class="font-bold text-h2 mt-8"> | ||
{{page.complaint_handling_title}} | ||
</h2> | ||
<div class="base-article-m"> | ||
{{page.complaint_handling_body|safe}} | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<h1 class="text-h2 font-bold"> | ||
{{page.our_policies_title}} | ||
</h1> | ||
<div class="grid gap-4 mt-4"> | ||
{% for policy in page.our_policies_links %} | ||
<p> | ||
{% include "ui/components/BaseLink.html" with linktext=policy.value.text linkurl=policy.value.link %} | ||
</p> | ||
{% endfor %} | ||
</div> | ||
|
||
<div class="bg-hot-off-white p-8 mt-16"> | ||
<h1 class="font-bold text-h3 mb-8"> | ||
{{page.question_block_title}} | ||
</h1> | ||
<a href="{{page.question_block_button_link}}"> | ||
{% include "components/branded_elements/button.html" with text=page.question_block_button_text %} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% load wagtailcore_tags %} | ||
{% load wagtailimages_tags %} | ||
{% load compress %} | ||
{% block body_class %}template-dataprinciplespage{% endblock %} | ||
{% block extra_css %} | ||
{% compress css %} | ||
{% endcompress css %} | ||
{% endblock extra_css %} | ||
|
||
{% block content %} | ||
<div class="max-w-7xl mx-auto my-10"> | ||
<div class="px-6 md:px-10"> | ||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> | ||
<div class="lg:col-span-2 [&_h2]:mt-6 [&_h2]:mb-4 [&_h3]:mt-6 [&_h3]:mb-4"> | ||
<h1 class="font-semibold text-h1"> | ||
{{page.title}} | ||
</h1> | ||
<div class="text-intro font-medium"> | ||
{{page.intro|safe}} | ||
</div> | ||
|
||
<div class="base-article-m"> | ||
{{page.brief_body_text|safe}} | ||
|
||
<h3> | ||
{{page.table_of_contents_title}} | ||
</h3> | ||
<ol> | ||
{% for section in page.body_sections %} | ||
<a href="#section-{{forloop.counter}}"> | ||
<li> | ||
{{section.value.title}} | ||
</li> | ||
</a> | ||
{% endfor %} | ||
</ol> | ||
|
||
{% for section in page.body_sections %} | ||
<h2 id="section-{{forloop.counter}}"> | ||
{{forloop.counter}}. {{section.value.title}} | ||
</h2> | ||
{{section.value.body|safe}} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<h1 class="text-h2 font-bold"> | ||
{{page.our_policies_title}} | ||
</h1> | ||
<div class="grid gap-4 mt-4"> | ||
{% for policy in page.our_policies_links %} | ||
<p> | ||
{% include "ui/components/BaseLink.html" with linktext=policy.value.text linkurl=policy.value.link %} | ||
</p> | ||
{% endfor %} | ||
</div> | ||
|
||
<div class="bg-hot-off-white p-8 mt-16"> | ||
<h1 class="font-bold text-h3 mb-8"> | ||
{{page.question_block_title}} | ||
</h1> | ||
<a href="{{page.question_block_button_link}}"> | ||
{% include "components/branded_elements/button.html" with text=page.question_block_button_text %} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |