Skip to content

Commit 2b3d3a3

Browse files
our work page
=> projects adjusted accordingly with the new fields that have filter options from the our work page => only thing that really remains for this page is mapbox styling but that's done via mapbox's settings if i'm not mistaken; the style in the MapboxScript component will need to be changed to some mapbox style
1 parent 3d7f3a8 commit 2b3d3a3

File tree

63 files changed

+1126
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1126
-92
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.7 on 2024-08-07 19:01
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import wagtail.fields
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('wagtailimages', '0025_alter_image_file_alter_rendition_file'),
12+
('core', '0007_partnertype_partner_partner_type'),
13+
]
14+
15+
operations = [
16+
migrations.AddField(
17+
model_name='partnertype',
18+
name='type_description',
19+
field=wagtail.fields.RichTextField(blank=True),
20+
),
21+
migrations.AddField(
22+
model_name='partnertype',
23+
name='type_icon',
24+
field=models.ForeignKey(help_text='Icon for the partner type', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
25+
),
26+
]

app/core/models.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from django.db import models
33

44
from wagtail.models import Page
5-
from wagtail.fields import StreamField
5+
from wagtail.fields import StreamField, RichTextField
66
from wagtail.blocks import CharBlock, StreamBlock, StructBlock, URLBlock, RichTextBlock, PageChooserBlock
77
from wagtail.snippets.models import register_snippet
88
from wagtail.admin.panels import FieldPanel, MultiFieldPanel, InlinePanel
@@ -11,9 +11,21 @@
1111
@register_snippet
1212
class PartnerType(models.Model):
1313
type_name = models.CharField()
14+
type_icon = models.ForeignKey(
15+
"wagtailimages.Image",
16+
null=True,
17+
on_delete=models.SET_NULL,
18+
related_name="+",
19+
help_text="Icon for the partner type"
20+
)
21+
type_description = RichTextField(blank=True)
1422

1523
panels = [
16-
FieldPanel("type_name")
24+
FieldPanel("type_name"),
25+
MultiFieldPanel([
26+
FieldPanel('type_icon'),
27+
FieldPanel('type_description'),
28+
], heading="These will show in the Partner With Us page - an info block is automatically created for each partner type.")
1729
]
1830

1931
def __str__(self):

app/impact_areas/templates/impact_areas/individual_impact_area_page.html

+3-17
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,8 @@
3333
</div>
3434

3535
{% comment %} PROJECTS {% endcomment %}
36-
<div class="my-20">
37-
<div class="grid grid-cols-1 md:grid-cols-2 gap-y-4">
38-
<div>
39-
{% include "ui/components/SectionHeadingWithUnderline.html" with title=page.get_parent.specific.projects_title %}
40-
</div>
41-
<p class="md:text-right">
42-
{% include "ui/components/BaseLink.html" with linktext=page.get_parent.specific.view_all_projects_text linkurl=page.view_all_projects_link %}
43-
</p>
44-
</div>
36+
<div class="my-20" id="projects-section">
37+
{% include "ui/components/FlexTitleWithLink.html" with title=page.get_parent.specific.projects_title linktext=page.get_parent.specific.view_all_projects_text linkurl=page.view_all_projects_link titleclass="text-h2" %}
4538
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 mt-10" id="projects-list">
4639
{% for project in projects %}
4740
{% include "ui/components/projects/ProjectPreviewBlockNews.html" with project=project showimage=True %}
@@ -73,14 +66,7 @@ <h1 class="text-h2 font-bold">
7366
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6 mt-10">
7467
{% for area in other_impact_areas %}
7568
{% if area != page %}
76-
<a href="{{ area.url }}" class="rounded-2xl shadow-md">
77-
<div class="bg-hot-off-white p-6 text-center font-medium text-intro h-full">
78-
{% image area.external_icon fill-200x200 class="px-10" %}
79-
<p>
80-
{{ area.title }}
81-
</p>
82-
</div>
83-
</a>
69+
{% include "ui/components/impact_areas/ImpactAreaPreviewBlockMini.html" %}
8470
{% endif %}
8571
{% endfor %}
8672
</div>

app/our_work/__init__.py

Whitespace-only changes.

app/our_work/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/our_work/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 OurWorkConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'app.our_work'
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Generated by Django 4.2.7 on 2024-08-06 21:22
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+
('wagtailimages', '0025_alter_image_file_alter_rendition_file'),
15+
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name='OurWorkPage',
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+
('programs_title', models.CharField(default='Highlighted Programs')),
24+
('programs_description', wagtail.fields.RichTextField(blank=True)),
25+
('view_all_programs_text', models.CharField(default='View all programs')),
26+
('view_all_programs_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
27+
('highlighted_programs', wagtail.fields.StreamField([('program', wagtail.blocks.PageChooserBlock(page_type=['programs.IndividualProgramPage']))], blank=True, null=True, use_json_field=True)),
28+
('projects_title', models.CharField(default='Projects')),
29+
('search_keyword_text', models.CharField(default='Search by keyword')),
30+
('sort_new_text', models.CharField(default='Sort by New')),
31+
('sort_old_text', models.CharField(default='Sort by Old')),
32+
('sort_titlea_text', models.CharField(default='Sort by Name Alphabetical')),
33+
('sort_titlez_text', models.CharField(default='Sort by Name Reverse Alphabetical')),
34+
('filters_text', models.CharField(default='Filters')),
35+
('view_grid_text', models.CharField(default='View Grid')),
36+
('view_map_text', models.CharField(default='View Map')),
37+
('f_impact_areas_text', models.CharField(default='Impact Areas')),
38+
('f_open_mapping_hubs_text', models.CharField(default='Open Mapping Hubs')),
39+
('f_projects_by_programme_text', models.CharField(default='Projects by Programme')),
40+
('f_projects_by_type_text', models.CharField(default='Projects by Type')),
41+
('f_project_status_text', models.CharField(default='Project Status')),
42+
('f_project_active_text', models.CharField(default='Active')),
43+
('f_project_complete_text', models.CharField(default='Complete')),
44+
('f_apply_filter_text', models.CharField(default='Apply Filter')),
45+
('f_reset_filters_text', models.CharField(default='Reset Filters')),
46+
('load_more_projects_text', models.CharField(default='Load More Projects')),
47+
('impact_area_title', models.CharField(default='See Projects by Impact Area')),
48+
('open_mapping_hub_title', models.CharField(default='See Projects by Open Mapping Hub')),
49+
('red_box_title', models.CharField(default="See all of HOT's projects")),
50+
('red_box_link_text', models.CharField(default='Explore projects')),
51+
('red_box_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
52+
('black_box_title', models.CharField(default='See the many ways to get involved with HOT and open mapping')),
53+
('black_box_link_text', models.CharField(default='Get involved')),
54+
('black_box_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
55+
('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')),
56+
],
57+
options={
58+
'abstract': False,
59+
},
60+
bases=('wagtailcore.page',),
61+
),
62+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 4.2.7 on 2024-08-12 16:09
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('our_work', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='ourworkpage',
15+
name='f_project_active_text',
16+
),
17+
migrations.RemoveField(
18+
model_name='ourworkpage',
19+
name='f_project_complete_text',
20+
),
21+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Generated by Django 4.2.7 on 2024-08-12 23:35
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('our_work', '0002_remove_ourworkpage_f_project_active_text_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='ourworkpage',
15+
name='no_projects_found',
16+
field=models.CharField(default='No projects found with the applied filters.'),
17+
),
18+
migrations.AlterField(
19+
model_name='ourworkpage',
20+
name='black_box_link_text',
21+
field=models.CharField(default='Get Involved with HOT'),
22+
),
23+
migrations.AlterField(
24+
model_name='ourworkpage',
25+
name='black_box_title',
26+
field=models.CharField(default='Check many opportunities to get involved with HOT!'),
27+
),
28+
migrations.AlterField(
29+
model_name='ourworkpage',
30+
name='red_box_link_text',
31+
field=models.CharField(default='View all events'),
32+
),
33+
migrations.AlterField(
34+
model_name='ourworkpage',
35+
name='red_box_title',
36+
field=models.CharField(default='Check our upcoming events!'),
37+
),
38+
]

app/our_work/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)