Skip to content

Commit

Permalink
our work page
Browse files Browse the repository at this point in the history
=> 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
  • Loading branch information
luminaryFlowers committed Aug 13, 2024
1 parent 3d7f3a8 commit 2b3d3a3
Show file tree
Hide file tree
Showing 63 changed files with 1,126 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 4.2.7 on 2024-08-07 19:01

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


class Migration(migrations.Migration):

dependencies = [
('wagtailimages', '0025_alter_image_file_alter_rendition_file'),
('core', '0007_partnertype_partner_partner_type'),
]

operations = [
migrations.AddField(
model_name='partnertype',
name='type_description',
field=wagtail.fields.RichTextField(blank=True),
),
migrations.AddField(
model_name='partnertype',
name='type_icon',
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'),
),
]
16 changes: 14 additions & 2 deletions app/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.db import models

from wagtail.models import Page
from wagtail.fields import StreamField
from wagtail.fields import StreamField, RichTextField
from wagtail.blocks import CharBlock, StreamBlock, StructBlock, URLBlock, RichTextBlock, PageChooserBlock
from wagtail.snippets.models import register_snippet
from wagtail.admin.panels import FieldPanel, MultiFieldPanel, InlinePanel
Expand All @@ -11,9 +11,21 @@
@register_snippet
class PartnerType(models.Model):
type_name = models.CharField()
type_icon = models.ForeignKey(
"wagtailimages.Image",
null=True,
on_delete=models.SET_NULL,
related_name="+",
help_text="Icon for the partner type"
)
type_description = RichTextField(blank=True)

panels = [
FieldPanel("type_name")
FieldPanel("type_name"),
MultiFieldPanel([
FieldPanel('type_icon'),
FieldPanel('type_description'),
], heading="These will show in the Partner With Us page - an info block is automatically created for each partner type.")
]

def __str__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,8 @@
</div>

{% comment %} PROJECTS {% endcomment %}
<div class="my-20">
<div class="grid grid-cols-1 md:grid-cols-2 gap-y-4">
<div>
{% include "ui/components/SectionHeadingWithUnderline.html" with title=page.get_parent.specific.projects_title %}
</div>
<p class="md:text-right">
{% include "ui/components/BaseLink.html" with linktext=page.get_parent.specific.view_all_projects_text linkurl=page.view_all_projects_link %}
</p>
</div>
<div class="my-20" id="projects-section">
{% 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" %}
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 mt-10" id="projects-list">
{% for project in projects %}
{% include "ui/components/projects/ProjectPreviewBlockNews.html" with project=project showimage=True %}
Expand Down Expand Up @@ -73,14 +66,7 @@ <h1 class="text-h2 font-bold">
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6 mt-10">
{% for area in other_impact_areas %}
{% if area != page %}
<a href="{{ area.url }}" class="rounded-2xl shadow-md">
<div class="bg-hot-off-white p-6 text-center font-medium text-intro h-full">
{% image area.external_icon fill-200x200 class="px-10" %}
<p>
{{ area.title }}
</p>
</div>
</a>
{% include "ui/components/impact_areas/ImpactAreaPreviewBlockMini.html" %}
{% endif %}
{% endfor %}
</div>
Expand Down
Empty file added app/our_work/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions app/our_work/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/our_work/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class OurWorkConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'app.our_work'
62 changes: 62 additions & 0 deletions app/our_work/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Generated by Django 4.2.7 on 2024-08-06 21:22

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


class Migration(migrations.Migration):

initial = True

dependencies = [
('wagtailimages', '0025_alter_image_file_alter_rendition_file'),
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
]

operations = [
migrations.CreateModel(
name='OurWorkPage',
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')),
('programs_title', models.CharField(default='Highlighted Programs')),
('programs_description', wagtail.fields.RichTextField(blank=True)),
('view_all_programs_text', models.CharField(default='View all programs')),
('view_all_programs_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
('highlighted_programs', wagtail.fields.StreamField([('program', wagtail.blocks.PageChooserBlock(page_type=['programs.IndividualProgramPage']))], blank=True, null=True, use_json_field=True)),
('projects_title', models.CharField(default='Projects')),
('search_keyword_text', models.CharField(default='Search by keyword')),
('sort_new_text', models.CharField(default='Sort by New')),
('sort_old_text', models.CharField(default='Sort by Old')),
('sort_titlea_text', models.CharField(default='Sort by Name Alphabetical')),
('sort_titlez_text', models.CharField(default='Sort by Name Reverse Alphabetical')),
('filters_text', models.CharField(default='Filters')),
('view_grid_text', models.CharField(default='View Grid')),
('view_map_text', models.CharField(default='View Map')),
('f_impact_areas_text', models.CharField(default='Impact Areas')),
('f_open_mapping_hubs_text', models.CharField(default='Open Mapping Hubs')),
('f_projects_by_programme_text', models.CharField(default='Projects by Programme')),
('f_projects_by_type_text', models.CharField(default='Projects by Type')),
('f_project_status_text', models.CharField(default='Project Status')),
('f_project_active_text', models.CharField(default='Active')),
('f_project_complete_text', models.CharField(default='Complete')),
('f_apply_filter_text', models.CharField(default='Apply Filter')),
('f_reset_filters_text', models.CharField(default='Reset Filters')),
('load_more_projects_text', models.CharField(default='Load More Projects')),
('impact_area_title', models.CharField(default='See Projects by Impact Area')),
('open_mapping_hub_title', models.CharField(default='See Projects by Open Mapping Hub')),
('red_box_title', models.CharField(default="See all of HOT's projects")),
('red_box_link_text', models.CharField(default='Explore projects')),
('red_box_link', wagtail.fields.StreamField([('page', wagtail.blocks.PageChooserBlock()), ('url', wagtail.blocks.URLBlock())], blank=True, use_json_field=True)),
('black_box_title', models.CharField(default='See the many ways to get involved with HOT and open mapping')),
('black_box_link_text', models.CharField(default='Get involved')),
('black_box_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',),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.7 on 2024-08-12 16:09

from django.db import migrations


class Migration(migrations.Migration):

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

operations = [
migrations.RemoveField(
model_name='ourworkpage',
name='f_project_active_text',
),
migrations.RemoveField(
model_name='ourworkpage',
name='f_project_complete_text',
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 4.2.7 on 2024-08-12 23:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('our_work', '0002_remove_ourworkpage_f_project_active_text_and_more'),
]

operations = [
migrations.AddField(
model_name='ourworkpage',
name='no_projects_found',
field=models.CharField(default='No projects found with the applied filters.'),
),
migrations.AlterField(
model_name='ourworkpage',
name='black_box_link_text',
field=models.CharField(default='Get Involved with HOT'),
),
migrations.AlterField(
model_name='ourworkpage',
name='black_box_title',
field=models.CharField(default='Check many opportunities to get involved with HOT!'),
),
migrations.AlterField(
model_name='ourworkpage',
name='red_box_link_text',
field=models.CharField(default='View all events'),
),
migrations.AlterField(
model_name='ourworkpage',
name='red_box_title',
field=models.CharField(default='Check our upcoming events!'),
),
]
Empty file.
Loading

0 comments on commit 2b3d3a3

Please sign in to comment.