-
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 #33 from hotosm/feat/working-groups-join-convo-pages
working groups + join our conversation + 404 pages
- Loading branch information
Showing
28 changed files
with
489 additions
and
15 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
Empty file.
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,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
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,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class MiscConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'app.misc' |
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,32 @@ | ||
# Generated by Django 4.2.7 on 2024-07-17 18:08 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('wagtailcore', '0089_log_entry_data_json_null_to_object'), | ||
('wagtailimages', '0025_alter_image_file_alter_rendition_file'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='WorkingGroupsPage', | ||
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, help_text='This is shown in the header.')), | ||
('working_groups', wagtail.fields.StreamField([('working_group', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.RichTextBlock()), ('links', wagtail.blocks.StreamBlock([('link', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock()), ('link', wagtail.blocks.URLBlock(required=False))]))]))]))], blank=True, null=True, use_json_field=True)), | ||
('header_image', models.ForeignKey(blank=True, help_text='Header image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')), | ||
], | ||
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,25 @@ | ||
# Generated by Django 4.2.7 on 2024-07-17 22:31 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0089_log_entry_data_json_null_to_object'), | ||
('misc', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='JoinOurConversationPage', | ||
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')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
] |
68 changes: 68 additions & 0 deletions
68
app/misc/migrations/0003_joinourconversationpage_black_box_link_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,68 @@ | ||
# Generated by Django 4.2.7 on 2024-07-17 22:38 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.blocks | ||
import wagtail.fields | ||
import wagtail.images.blocks | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailimages', '0025_alter_image_file_alter_rendition_file'), | ||
('misc', '0002_joinourconversationpage'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='black_box_link_text', | ||
field=models.CharField(default='Community Contact'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='black_box_title', | ||
field=models.CharField(default='Contact a mapping community'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='code_of_conduct_link_text', | ||
field=models.CharField(default='Code of Conduct'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='code_of_conduct_title', | ||
field=models.CharField(default='Please read our Code of Conduct'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='get_connected_blocks', | ||
field=wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('icon', wagtail.images.blocks.ImageChooserBlock()), ('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.RichTextBlock())]))], blank=True, help_text='Blocks to be shown under the Get Connected section.', null=True, use_json_field=True), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='get_connected_title', | ||
field=models.CharField(default='Get Connected!'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='header_image', | ||
field=models.ForeignKey(blank=True, help_text='Header image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='intro', | ||
field=wagtail.fields.RichTextField(blank=True, help_text='This is shown in the header.'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='red_box_link_text', | ||
field=models.CharField(default='Working Groups'), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='red_box_title', | ||
field=models.CharField(default='Join a working group'), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
app/misc/migrations/0004_joinourconversationpage_code_of_conduct_link_url.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,20 @@ | ||
# Generated by Django 4.2.7 on 2024-07-17 22:41 | ||
|
||
from django.db import migrations | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('misc', '0003_joinourconversationpage_black_box_link_text_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='code_of_conduct_link_url', | ||
field=wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
app/misc/migrations/0005_joinourconversationpage_black_box_link_url_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,25 @@ | ||
# Generated by Django 4.2.7 on 2024-07-17 22:42 | ||
|
||
from django.db import migrations | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('misc', '0004_joinourconversationpage_code_of_conduct_link_url'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='black_box_link_url', | ||
field=wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True), | ||
), | ||
migrations.AddField( | ||
model_name='joinourconversationpage', | ||
name='red_box_link_url', | ||
field=wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True), | ||
), | ||
] |
Empty file.
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,95 @@ | ||
from django.db import models | ||
|
||
from wagtail.admin.panels import FieldPanel, MultiFieldPanel | ||
from wagtail.fields import RichTextField, StreamField | ||
from wagtail.blocks import CharBlock, StreamBlock, StructBlock, URLBlock, RichTextBlock, PageChooserBlock | ||
from wagtail.images.blocks import ImageChooserBlock | ||
from wagtail.models import Page | ||
from app.core.models import LinkOrPageBlock | ||
|
||
|
||
class JoinOurConversationPage(Page): | ||
max_count = 1 | ||
|
||
header_image = models.ForeignKey( | ||
"wagtailimages.Image", | ||
null=True, | ||
blank=True, | ||
on_delete=models.SET_NULL, | ||
related_name="+", | ||
help_text="Header image" | ||
) | ||
intro = RichTextField(blank=True, help_text="This is shown in the header.") | ||
|
||
get_connected_title = models.CharField(default="Get Connected!") | ||
get_connected_blocks = StreamField([ | ||
('blocks', StructBlock([ | ||
('icon', ImageChooserBlock()), | ||
('title', CharBlock()), | ||
('description', RichTextBlock()) | ||
])) | ||
], max_num=3, use_json_field=True, null=True, blank=True, help_text="Blocks to be shown under the Get Connected section.") | ||
|
||
code_of_conduct_title = models.CharField(default="Please read our Code of Conduct") | ||
code_of_conduct_link_text = models.CharField(default="Code of Conduct") | ||
code_of_conduct_link_url = StreamField(LinkOrPageBlock(), use_json_field=True, blank=True) | ||
|
||
red_box_title = models.CharField(default="Join a working group") | ||
red_box_link_text = models.CharField(default="Working Groups") | ||
red_box_link_url = StreamField(LinkOrPageBlock(), use_json_field=True, blank=True) | ||
black_box_title = models.CharField(default="Contact a mapping community") | ||
black_box_link_text = models.CharField(default="Community Contact") | ||
black_box_link_url = StreamField(LinkOrPageBlock(), use_json_field=True, blank=True) | ||
|
||
content_panels = Page.content_panels + [ | ||
FieldPanel('header_image'), | ||
FieldPanel('intro'), | ||
FieldPanel('get_connected_title'), | ||
FieldPanel('get_connected_blocks'), | ||
MultiFieldPanel([ | ||
FieldPanel('code_of_conduct_title'), | ||
FieldPanel('code_of_conduct_link_text'), | ||
FieldPanel('code_of_conduct_link_url'), | ||
], heading="Code of Conduct"), | ||
MultiFieldPanel([ | ||
FieldPanel('red_box_title'), | ||
FieldPanel('red_box_link_text'), | ||
FieldPanel('red_box_link_url'), | ||
FieldPanel('black_box_title'), | ||
FieldPanel('black_box_link_text'), | ||
FieldPanel('black_box_link_url'), | ||
], heading="Dogear Boxes"), | ||
] | ||
|
||
|
||
class WorkingGroupLinkBlock(StructBlock): | ||
text = CharBlock() | ||
link = URLBlock(required=False) | ||
|
||
|
||
class WorkingGroupBlock(StructBlock): | ||
title = CharBlock() | ||
description = RichTextBlock() | ||
links = StreamBlock([('link', WorkingGroupLinkBlock())]) | ||
|
||
|
||
class WorkingGroupsPage(Page): | ||
max_count = 1 | ||
|
||
header_image = models.ForeignKey( | ||
"wagtailimages.Image", | ||
null=True, | ||
blank=True, | ||
on_delete=models.SET_NULL, | ||
related_name="+", | ||
help_text="Header image" | ||
) | ||
intro = RichTextField(blank=True, help_text="This is shown in the header.") | ||
|
||
working_groups = StreamField([('working_group', WorkingGroupBlock())], use_json_field=True, null=True, blank=True) | ||
|
||
content_panels = Page.content_panels + [ | ||
FieldPanel('header_image'), | ||
FieldPanel('intro'), | ||
FieldPanel('working_groups'), | ||
] |
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,46 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% load wagtailcore_tags %} | ||
{% load wagtailimages_tags %} | ||
{% load compress %} | ||
{% block body_class %}template-workinggroupspage{% endblock %} | ||
{% block extra_css %} | ||
{% compress css %} | ||
{% endcompress css %} | ||
{% endblock extra_css %} | ||
|
||
{% block content %} | ||
{% include "ui/components/PageHeaderWithBlur.html" with title=page.title subtitle=page.intro image=page.header_image %} | ||
|
||
<div class="max-w-7xl mx-auto my-10"> | ||
<div class="px-6 md:px-10"> | ||
{% include "ui/components/SectionHeadingWithUnderline.html" with title=page.get_connected_title %} | ||
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-8 mt-6"> | ||
{% for block in page.get_connected_blocks %} | ||
<div class="p-6 bg-hot-off-white"> | ||
{% image block.value.icon original class="h-8 w-8 mt-2" %} | ||
<h1 class="text-h4 font-semibold mt-4"> | ||
{{block.value.title}} | ||
</h1> | ||
<div class="base-article-m"> | ||
{{block.value.description}} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
<div class="text-black mt-20 [&_h1]:text-black [&_a]:text-black"> | ||
{% include "ui/components/dogear_boxes/DogearAnyColourLong.html" with colour="var(--hot-off-white)" title=page.code_of_conduct_title linktext=page.code_of_conduct_link_text linkurl=page.code_of_conduct_link_url %} | ||
</div> | ||
|
||
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 text-white mt-10 mb-20"> | ||
<div> | ||
{% include "ui/components/dogear_boxes/DogearRed.html" with title=page.red_box_title linktext=page.red_box_link_text linkurl=page.red_box_link_url %} | ||
</div> | ||
<div> | ||
{% include "ui/components/dogear_boxes/DogearBlack.html" with title=page.black_box_title linktext=page.black_box_link_text linkurl=page.black_box_link_url %} | ||
</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,24 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% load wagtailcore_tags %} | ||
{% load wagtailimages_tags %} | ||
{% load compress %} | ||
{% block body_class %}template-workinggroupspage{% endblock %} | ||
{% block extra_css %} | ||
{% compress css %} | ||
{% endcompress css %} | ||
{% endblock extra_css %} | ||
|
||
{% block content %} | ||
{% include "ui/components/PageHeaderWithBlur.html" with title=page.title subtitle=page.intro image=page.header_image %} | ||
|
||
<div class="max-w-5xl mx-auto my-10"> | ||
<div class="px-6 md:px-10 grid gap-16"> | ||
{% for group in page.working_groups %} | ||
<div> | ||
{% include "ui/components/sections/LinkListSection.html" with title=group.value.title description=group.value.description links=group.value.links external_style=True %} | ||
</div> | ||
{% endfor %} | ||
</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,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
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,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
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
Oops, something went wrong.