Skip to content

Commit

Permalink
Merge pull request #35 from hotosm/feat/data-principles-tech-stack
Browse files Browse the repository at this point in the history
data principles, tech product suite, and individual tech stack pages
  • Loading branch information
luminaryFlowers authored Jul 31, 2024
2 parents 8b46d7d + 11ed91b commit 508c223
Show file tree
Hide file tree
Showing 22 changed files with 682 additions and 4 deletions.
37 changes: 37 additions & 0 deletions app/misc/migrations/0006_dataprinciplespage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generated by Django 4.2.7 on 2024-07-29 17: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'),
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
('misc', '0005_joinourconversationpage_black_box_link_url_and_more'),
]

operations = [
migrations.CreateModel(
name='DataPrinciplesPage',
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)),
('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)),
('footer_text', wagtail.fields.RichTextField(blank=True)),
('footer_button_text', models.CharField(blank=True)),
('footer_button_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
('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')),
('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',),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-07-29 17:51

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('misc', '0006_dataprinciplespage'),
]

operations = [
migrations.AlterField(
model_name='dataprinciplespage',
name='footer_button_text',
field=models.CharField(default='View the Principles as a Presentation'),
),
]
52 changes: 52 additions & 0 deletions app/misc/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,55 @@ class WorkingGroupsPage(Page):
FieldPanel('intro'),
FieldPanel('working_groups'),
]


class DataPrinciplesPage(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)

body_image = models.ForeignKey(
"wagtailimages.Image",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
help_text="Body image"
)
body_text = RichTextField(blank=True)

info_blocks = StreamField([
('blocks', StructBlock([
('icon', ImageChooserBlock()),
('title', CharBlock()),
('description', RichTextBlock())
]))
], use_json_field=True, null=True, blank=True)

footer_text = RichTextField(blank=True)
footer_button_text = models.CharField(default="View the Principles as a Presentation")
footer_button_link = StreamField(LinkOrPageBlock(), use_json_field=True, blank=True)

content_panels = Page.content_panels + [
FieldPanel('header_image'),
MultiFieldPanel([
FieldPanel('intro'),
FieldPanel('body_image'),
FieldPanel('body_text'),
FieldPanel('info_blocks'),
], heading="Body"),
MultiFieldPanel([
FieldPanel('footer_text'),
FieldPanel('footer_button_text'),
FieldPanel('footer_button_link'),
], heading="Footer"),
]
61 changes: 61 additions & 0 deletions app/misc/templates/misc/data_principles_page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{% 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 %}
{% include "ui/components/PageHeaderWithBlur.html" with title=page.title image=page.header_image endinlarge=True full_length=True %}

<div class="max-w-7xl mx-auto my-10">
<div class="px-6 md:px-10">
<div class="lg:grid lg:grid-cols-6 mb-10">
<div class="col-span-5 text-intro font-medium">
{{page.intro|safe}}
</div>
</div>

<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<div class="base-article-m">
{{page.body_text|safe}}
</div>
<div class="base-article-m">
{% image page.body_image original %}
</div>
</div>

<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 my-10">
{% for block in page.info_blocks %}
<div class="bg-hot-off-white p-8">
<h1 class="flex items-center gap-8 text-h3 font-bold pb-4">
{% image block.value.icon original class="inline" %}
<span>
{{block.value.title}}
</span>
</h1>
<div class="base-article-m [&_p]:mb-4">
{{block.value.description}}
</div>
</div>
{% endfor %}
</div>

<div class="lg:grid lg:grid-cols-6 my-20">
<div class="col-span-5">
{{page.footer_text|safe}}

<div class="mt-8">
<a href="{%include 'ui/components/PageOrLinkHrefText.html' with linkurl=page.footer_button_link%}">
{% include "components/branded_elements/button.html" with text=page.footer_button_text %}
</a>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion app/misc/templates/misc/join_our_conversation_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load compress %}
{% block body_class %}template-workinggroupspage{% endblock %}
{% block body_class %}template-joinourconversationpage{% endblock %}
{% block extra_css %}
{% compress css %}
{% endcompress css %}
Expand Down
Empty file added app/tech/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions app/tech/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions app/tech/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class TechConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'app.tech'
68 changes: 68 additions & 0 deletions app/tech/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Generated by Django 4.2.7 on 2024-07-30 19:04

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='TechProductSuitePage',
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)),
('tech_principles_title', models.CharField(default='Tech Principles')),
('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)),
('product_suite_title', models.CharField(default='Product Suite')),
('red_box_title', models.CharField(default='Join a working group')),
('red_box_link_text', models.CharField(default='Working Groups')),
('red_box_link_url', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
('black_box_title', models.CharField(default='Contact a mapping community')),
('black_box_link_text', models.CharField(default='Community Contact')),
('black_box_link_url', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
('go_back_text', models.CharField(default='Go Back to Tools & Resources')),
('go_back_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=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',),
),
migrations.CreateModel(
name='IndividualTechStackPage',
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)),
('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)),
('section_title', models.CharField(blank=True)),
('section_intro', wagtail.fields.RichTextField(blank=True)),
('section_description', wagtail.fields.RichTextField(blank=True)),
('links_title', models.CharField(default='Link')),
('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)),
('cta_title', models.CharField(blank=True)),
('cta_description', wagtail.fields.RichTextField(blank=True)),
('cta_button_link_text', models.CharField(blank=True)),
('cta_button_link_url', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
('go_back_text', models.CharField(default='Go Back to Tech Stack')),
('go_back_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=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')),
('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')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Generated by Django 4.2.7 on 2024-07-30 22:21

from django.db import migrations, models
import wagtail.blocks
import wagtail.fields


class Migration(migrations.Migration):

dependencies = [
('tech', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='individualtechstackpage',
name='cta_button_link_text',
),
migrations.RemoveField(
model_name='individualtechstackpage',
name='cta_button_link_url',
),
migrations.RemoveField(
model_name='individualtechstackpage',
name='cta_description',
),
migrations.RemoveField(
model_name='individualtechstackpage',
name='cta_title',
),
migrations.RemoveField(
model_name='individualtechstackpage',
name='go_back_link',
),
migrations.RemoveField(
model_name='individualtechstackpage',
name='go_back_text',
),
migrations.RemoveField(
model_name='individualtechstackpage',
name='links_title',
),
migrations.AddField(
model_name='techproductsuitepage',
name='tech_stack_cta_button_link_text',
field=models.CharField(blank=True),
),
migrations.AddField(
model_name='techproductsuitepage',
name='tech_stack_cta_button_link_url',
field=wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True),
),
migrations.AddField(
model_name='techproductsuitepage',
name='tech_stack_cta_description',
field=wagtail.fields.RichTextField(blank=True),
),
migrations.AddField(
model_name='techproductsuitepage',
name='tech_stack_cta_title',
field=models.CharField(blank=True),
),
migrations.AddField(
model_name='techproductsuitepage',
name='tech_stack_go_back_text',
field=models.CharField(default='Go Back to'),
),
migrations.AddField(
model_name='techproductsuitepage',
name='tech_stack_links_title',
field=models.CharField(default='Links'),
),
migrations.AlterField(
model_name='techproductsuitepage',
name='black_box_link_text',
field=models.CharField(default='View tech news'),
),
migrations.AlterField(
model_name='techproductsuitepage',
name='black_box_title',
field=models.CharField(default='Tech News'),
),
migrations.AlterField(
model_name='techproductsuitepage',
name='red_box_link_text',
field=models.CharField(default="View HOT's GitHub"),
),
migrations.AlterField(
model_name='techproductsuitepage',
name='red_box_title',
field=models.CharField(default='HOT GitHub'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.7 on 2024-07-31 17:21

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('tech', '0002_remove_individualtechstackpage_cta_button_link_text_and_more'),
]

operations = [
migrations.AddField(
model_name='techproductsuitepage',
name='product_suite_learn_more_text',
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'."),
),
migrations.AlterField(
model_name='techproductsuitepage',
name='tech_stack_go_back_text',
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'."),
),
]
Empty file added app/tech/migrations/__init__.py
Empty file.
Loading

0 comments on commit 508c223

Please sign in to comment.