Skip to content

Commit 508c223

Browse files
Merge pull request #35 from hotosm/feat/data-principles-tech-stack
data principles, tech product suite, and individual tech stack pages
2 parents 8b46d7d + 11ed91b commit 508c223

22 files changed

+682
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Generated by Django 4.2.7 on 2024-07-29 17:38
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import wagtail.blocks
6+
import wagtail.fields
7+
import wagtail.images.blocks
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
dependencies = [
13+
('wagtailimages', '0025_alter_image_file_alter_rendition_file'),
14+
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
15+
('misc', '0005_joinourconversationpage_black_box_link_url_and_more'),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name='DataPrinciplesPage',
21+
fields=[
22+
('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')),
23+
('intro', wagtail.fields.RichTextField(blank=True)),
24+
('body_text', wagtail.fields.RichTextField(blank=True)),
25+
('info_blocks', wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('icon', wagtail.images.blocks.ImageChooserBlock()), ('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.RichTextBlock())]))], blank=True, null=True, use_json_field=True)),
26+
('footer_text', wagtail.fields.RichTextField(blank=True)),
27+
('footer_button_text', models.CharField(blank=True)),
28+
('footer_button_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
29+
('body_image', models.ForeignKey(blank=True, help_text='Body image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')),
30+
('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')),
31+
],
32+
options={
33+
'abstract': False,
34+
},
35+
bases=('wagtailcore.page',),
36+
),
37+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.7 on 2024-07-29 17:51
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('misc', '0006_dataprinciplespage'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='dataprinciplespage',
15+
name='footer_button_text',
16+
field=models.CharField(default='View the Principles as a Presentation'),
17+
),
18+
]

app/misc/models.py

+52
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,55 @@ class WorkingGroupsPage(Page):
9393
FieldPanel('intro'),
9494
FieldPanel('working_groups'),
9595
]
96+
97+
98+
class DataPrinciplesPage(Page):
99+
max_count = 1
100+
101+
header_image = models.ForeignKey(
102+
"wagtailimages.Image",
103+
null=True,
104+
blank=True,
105+
on_delete=models.SET_NULL,
106+
related_name="+",
107+
help_text="Header image"
108+
)
109+
110+
intro = RichTextField(blank=True)
111+
112+
body_image = models.ForeignKey(
113+
"wagtailimages.Image",
114+
null=True,
115+
blank=True,
116+
on_delete=models.SET_NULL,
117+
related_name="+",
118+
help_text="Body image"
119+
)
120+
body_text = RichTextField(blank=True)
121+
122+
info_blocks = StreamField([
123+
('blocks', StructBlock([
124+
('icon', ImageChooserBlock()),
125+
('title', CharBlock()),
126+
('description', RichTextBlock())
127+
]))
128+
], use_json_field=True, null=True, blank=True)
129+
130+
footer_text = RichTextField(blank=True)
131+
footer_button_text = models.CharField(default="View the Principles as a Presentation")
132+
footer_button_link = StreamField(LinkOrPageBlock(), use_json_field=True, blank=True)
133+
134+
content_panels = Page.content_panels + [
135+
FieldPanel('header_image'),
136+
MultiFieldPanel([
137+
FieldPanel('intro'),
138+
FieldPanel('body_image'),
139+
FieldPanel('body_text'),
140+
FieldPanel('info_blocks'),
141+
], heading="Body"),
142+
MultiFieldPanel([
143+
FieldPanel('footer_text'),
144+
FieldPanel('footer_button_text'),
145+
FieldPanel('footer_button_link'),
146+
], heading="Footer"),
147+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
{% include "ui/components/PageHeaderWithBlur.html" with title=page.title image=page.header_image endinlarge=True full_length=True %}
14+
15+
<div class="max-w-7xl mx-auto my-10">
16+
<div class="px-6 md:px-10">
17+
<div class="lg:grid lg:grid-cols-6 mb-10">
18+
<div class="col-span-5 text-intro font-medium">
19+
{{page.intro|safe}}
20+
</div>
21+
</div>
22+
23+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
24+
<div class="base-article-m">
25+
{{page.body_text|safe}}
26+
</div>
27+
<div class="base-article-m">
28+
{% image page.body_image original %}
29+
</div>
30+
</div>
31+
32+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 my-10">
33+
{% for block in page.info_blocks %}
34+
<div class="bg-hot-off-white p-8">
35+
<h1 class="flex items-center gap-8 text-h3 font-bold pb-4">
36+
{% image block.value.icon original class="inline" %}
37+
<span>
38+
{{block.value.title}}
39+
</span>
40+
</h1>
41+
<div class="base-article-m [&_p]:mb-4">
42+
{{block.value.description}}
43+
</div>
44+
</div>
45+
{% endfor %}
46+
</div>
47+
48+
<div class="lg:grid lg:grid-cols-6 my-20">
49+
<div class="col-span-5">
50+
{{page.footer_text|safe}}
51+
52+
<div class="mt-8">
53+
<a href="{%include 'ui/components/PageOrLinkHrefText.html' with linkurl=page.footer_button_link%}">
54+
{% include "components/branded_elements/button.html" with text=page.footer_button_text %}
55+
</a>
56+
</div>
57+
</div>
58+
</div>
59+
</div>
60+
</div>
61+
{% endblock %}

app/misc/templates/misc/join_our_conversation_page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% load wagtailcore_tags %}
44
{% load wagtailimages_tags %}
55
{% load compress %}
6-
{% block body_class %}template-workinggroupspage{% endblock %}
6+
{% block body_class %}template-joinourconversationpage{% endblock %}
77
{% block extra_css %}
88
{% compress css %}
99
{% endcompress css %}

app/tech/__init__.py

Whitespace-only changes.

app/tech/admin.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

app/tech/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class TechConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'app.tech'

app/tech/migrations/0001_initial.py

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Generated by Django 4.2.7 on 2024-07-30 19:04
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+
initial = True
12+
13+
dependencies = [
14+
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
15+
('wagtailimages', '0025_alter_image_file_alter_rendition_file'),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name='TechProductSuitePage',
21+
fields=[
22+
('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')),
23+
('intro', wagtail.fields.RichTextField(blank=True)),
24+
('tech_principles_title', models.CharField(default='Tech Principles')),
25+
('tech_principle_blocks', wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.RichTextBlock())]))], blank=True, help_text='Blocks to be shown under the Tech Principles section.', null=True, use_json_field=True)),
26+
('product_suite_title', models.CharField(default='Product Suite')),
27+
('red_box_title', models.CharField(default='Join a working group')),
28+
('red_box_link_text', models.CharField(default='Working Groups')),
29+
('red_box_link_url', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
30+
('black_box_title', models.CharField(default='Contact a mapping community')),
31+
('black_box_link_text', models.CharField(default='Community Contact')),
32+
('black_box_link_url', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
33+
('go_back_text', models.CharField(default='Go Back to Tools & Resources')),
34+
('go_back_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
35+
('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')),
36+
],
37+
options={
38+
'abstract': False,
39+
},
40+
bases=('wagtailcore.page',),
41+
),
42+
migrations.CreateModel(
43+
name='IndividualTechStackPage',
44+
fields=[
45+
('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')),
46+
('intro', wagtail.fields.RichTextField(blank=True)),
47+
('body_text', wagtail.fields.RichTextField(blank=True)),
48+
('info_blocks', wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('description', wagtail.blocks.RichTextBlock())]))], blank=True, null=True, use_json_field=True)),
49+
('section_title', models.CharField(blank=True)),
50+
('section_intro', wagtail.fields.RichTextField(blank=True)),
51+
('section_description', wagtail.fields.RichTextField(blank=True)),
52+
('links_title', models.CharField(default='Link')),
53+
('link_blocks', wagtail.fields.StreamField([('blocks', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('linktext', wagtail.blocks.CharBlock()), ('linkurl', wagtail.blocks.StreamBlock([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())]))]))], blank=True, null=True, use_json_field=True)),
54+
('cta_title', models.CharField(blank=True)),
55+
('cta_description', wagtail.fields.RichTextField(blank=True)),
56+
('cta_button_link_text', models.CharField(blank=True)),
57+
('cta_button_link_url', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
58+
('go_back_text', models.CharField(default='Go Back to Tech Stack')),
59+
('go_back_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
60+
('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')),
61+
('section_image', models.ForeignKey(blank=True, help_text='Header image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')),
62+
],
63+
options={
64+
'abstract': False,
65+
},
66+
bases=('wagtailcore.page',),
67+
),
68+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Generated by Django 4.2.7 on 2024-07-30 22:21
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+
('tech', '0001_initial'),
12+
]
13+
14+
operations = [
15+
migrations.RemoveField(
16+
model_name='individualtechstackpage',
17+
name='cta_button_link_text',
18+
),
19+
migrations.RemoveField(
20+
model_name='individualtechstackpage',
21+
name='cta_button_link_url',
22+
),
23+
migrations.RemoveField(
24+
model_name='individualtechstackpage',
25+
name='cta_description',
26+
),
27+
migrations.RemoveField(
28+
model_name='individualtechstackpage',
29+
name='cta_title',
30+
),
31+
migrations.RemoveField(
32+
model_name='individualtechstackpage',
33+
name='go_back_link',
34+
),
35+
migrations.RemoveField(
36+
model_name='individualtechstackpage',
37+
name='go_back_text',
38+
),
39+
migrations.RemoveField(
40+
model_name='individualtechstackpage',
41+
name='links_title',
42+
),
43+
migrations.AddField(
44+
model_name='techproductsuitepage',
45+
name='tech_stack_cta_button_link_text',
46+
field=models.CharField(blank=True),
47+
),
48+
migrations.AddField(
49+
model_name='techproductsuitepage',
50+
name='tech_stack_cta_button_link_url',
51+
field=wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True),
52+
),
53+
migrations.AddField(
54+
model_name='techproductsuitepage',
55+
name='tech_stack_cta_description',
56+
field=wagtail.fields.RichTextField(blank=True),
57+
),
58+
migrations.AddField(
59+
model_name='techproductsuitepage',
60+
name='tech_stack_cta_title',
61+
field=models.CharField(blank=True),
62+
),
63+
migrations.AddField(
64+
model_name='techproductsuitepage',
65+
name='tech_stack_go_back_text',
66+
field=models.CharField(default='Go Back to'),
67+
),
68+
migrations.AddField(
69+
model_name='techproductsuitepage',
70+
name='tech_stack_links_title',
71+
field=models.CharField(default='Links'),
72+
),
73+
migrations.AlterField(
74+
model_name='techproductsuitepage',
75+
name='black_box_link_text',
76+
field=models.CharField(default='View tech news'),
77+
),
78+
migrations.AlterField(
79+
model_name='techproductsuitepage',
80+
name='black_box_title',
81+
field=models.CharField(default='Tech News'),
82+
),
83+
migrations.AlterField(
84+
model_name='techproductsuitepage',
85+
name='red_box_link_text',
86+
field=models.CharField(default="View HOT's GitHub"),
87+
),
88+
migrations.AlterField(
89+
model_name='techproductsuitepage',
90+
name='red_box_title',
91+
field=models.CharField(default='HOT GitHub'),
92+
),
93+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.7 on 2024-07-31 17:21
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('tech', '0002_remove_individualtechstackpage_cta_button_link_text_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='techproductsuitepage',
15+
name='product_suite_learn_more_text',
16+
field=models.CharField(default='Learn more about', help_text="Prefix text to be shown in page previews for the product suite section; if the page being previewed is named 'Tasking Manager', and this field is 'Learn more about', they would combine to be 'Learn more about Tasking Manager'."),
17+
),
18+
migrations.AlterField(
19+
model_name='techproductsuitepage',
20+
name='tech_stack_go_back_text',
21+
field=models.CharField(default='Go Back to', help_text="Prefix text to be shown at the bottom of page for going back; this will always refer to the parent page, so if the parent page is 'Tools & Resources', and this field is 'Go Back to', they would combine to be 'Go Back to Tools & Resources'."),
22+
),
23+
]

app/tech/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)