Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ node_modules*
/.vscode/*
!/.vscode/launch.json
/database_dumps/
.planning/
Comment thread
damwaingames marked this conversation as resolved.
13 changes: 13 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,18 @@ module.exports = {
ignoreUnits: ['dvh'],
},
],
'property-no-unknown': [
Comment thread
damwaingames marked this conversation as resolved.
true,
{
ignoreProperties: ['container-type'],
},
],
'scss/at-rule-no-unknown': [
true,
{
ignoreAtRules: ['container'],
},
],
'scss/dollar-variable-no-missing-interpolation': null,
},
};
3 changes: 3 additions & 0 deletions tbx/navigation/templatetags/navigation_tags.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django import template

from tbx.sitemap.models import SitemapPage


register = template.Library()

Expand Down Expand Up @@ -73,5 +75,6 @@ def footerlinks(context):
"footerlinks": context["settings"]["navigation"][
"NavigationSettings"
].footer_links,
"sitemap_page": SitemapPage.objects.filter(live=True).first(),
Comment thread
damwaingames marked this conversation as resolved.
Outdated
"request": request,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% load wagtailcore_tags %}
Comment thread
damwaingames marked this conversation as resolved.
<ul class="sitemap__links">
{% for item in items %}
<li class="sitemap__link-item">
<a href="{% pageurl item.page %}" class="sitemap__link">{{ item.page.title }}</a>
{% if item.children %}
{% include "patterns/molecules/sitemap/sitemap_tree.html" with items=item.children %}
{% endif %}
</li>
{% endfor %}
</ul>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
context:
items:
- page:
title: Our Work
children:
- page:
title: Case Study One
children: []
- page:
title: Case Study Two
children: []
- page:
title: Strategy & Design
children: []

tags:
pageurl:
item.page:
raw: '#'
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
</a>
{% endwith %}
{% endfor %}
{% if sitemap_page %}
<a href="/sitemap/" class="footerlinks-nav__link">Sitemap</a>
Comment thread
nickmoreton marked this conversation as resolved.
{% endif %}
</nav>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{# tbx/project_styleguide/templates/patterns/pages/sitemap/sitemap_page.html #}
{% extends "patterns/base_page.html" %}
{% load wagtailcore_tags %}

{% block content %}
<div class="grid grid--spacer-large">
<div class="grid__title">
<h1 class="heading heading--three">{{ page.title }}</h1>
</div>
<div class="sitemap grid__sitemap">
{% for item in sections %}
<section class="sitemap__section">
Comment thread
damwaingames marked this conversation as resolved.
<h2 class="heading heading--four sitemap__section-heading">
Comment thread
helenb marked this conversation as resolved.
<a href="{% pageurl item.section %}" class="sitemap__link">{{ item.section.title }}</a>
</h2>
{% if item.pages %}
{% include "patterns/molecules/sitemap/sitemap_tree.html" with items=item.pages %}
{% endif %}
</section>
{% endfor %}
</div>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
context:
page:
title: Sitemap
get_verbose_name: sitemap page

sections:
- section:
title: Work
pages:
- page:
title: Our Work
children:
- page:
title: Case Study One
children: []
- page:
title: Case Study Two
children: []
- page:
title: Strategy & Design
children: []
- section:
title: Charity
pages:
- page:
title: Digital for charities
children: []
- page:
title: Fundraising technology
children: []
- section:
title: Blog
pages:
- page:
title: All Posts
children: []

tags:
pageurl:
item.section:
raw: '#'
item.page:
raw: '#'
footerlinks:
'':
template_name: 'patterns/navigation/components/footer-links.html'
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ <h2 class="underline mt-8 mb-2">Footer CTA</h2>
{% include "patterns/molecules/footer-cta/footer-cta.html" with value=partners_data %}
</div>

<div>
<h2 class="underline mt-8 mb-2">Sitemap tree</h2>
{% include "patterns/molecules/sitemap/sitemap_tree.html" with items=sitemap_items %}
</div>

<div>
<h2 class="underline mt-8 mb-2">Footer links</h2>
{% footerlinks %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,29 @@ context:
# Markdown block
markdown: '<div class="codehilite"><pre><span></span><code><span class="p">&lt;</span><span class="nt">html</span><span class="p">&gt;</span><span class="p">&lt;</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">"something"</span><span class="p">&gt;</span>test<span class="p">&lt;/</span><span class="nt">a</span><span class="p">&gt;</span><span class="p">&lt;/</span><span</code></pre></div>'

sitemap_items:
- page:
title: Our Work
children:
- page:
title: Case Study One
children: []
- page:
title: Case Study Two
children: []
- page:
title: Strategy & Design
children: []

tags:
pageurl:
# for title-filters.html
item as index:
target_var: index
raw: '#'
# for sitemap_tree.html
item.page:
raw: '#'
# for featured_case_study.html
link:
raw: '#'
Expand Down
1 change: 1 addition & 0 deletions tbx/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"tbx.images",
"tbx.users",
"tbx.services",
"tbx.sitemap",
"wagtail.contrib.forms",
"wagtail.contrib.redirects",
"wagtail.embeds",
Expand Down
5 changes: 5 additions & 0 deletions tbx/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@

# Ignore proxy count in tests
XFF_ALWAYS_PROXY = False

# Use simple static files storage in tests — no manifest required
STORAGES["staticfiles"] = { # noqa: F405
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"
}
Empty file added tbx/sitemap/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions tbx/sitemap/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class SitemapConfig(AppConfig):
default_auto_field = "django.db.models.AutoField"
name = "tbx.sitemap"
10 changes: 10 additions & 0 deletions tbx/sitemap/factories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import wagtail_factories

from tbx.sitemap.models import SitemapPage


class SitemapPageFactory(wagtail_factories.PageFactory):
title = "Sitemap"

class Meta:
model = SitemapPage
102 changes: 102 additions & 0 deletions tbx/sitemap/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Generated by Django 5.2.2 on 2026-04-20 14:58

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


class Migration(migrations.Migration):
initial = True

dependencies = [
("divisions", "0003_remove_divisionpage_label_divisionpage_logo"),
("images", "0002_customimage_description"),
("navigation", "0008_navigationsettings_footer_newsletter_cta"),
("people", "0012_divisionmixin_and_navigationsetmixin"),
("wagtailcore", "0096_referenceindex_referenceindex_source_object_and_more"),
]

operations = [
migrations.CreateModel(
name="SitemapPage",
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",
),
),
(
"navigation_text",
models.CharField(
blank=True,
help_text="\n Text entered here will appear instead of the page title in the navigation menu.\n For top-level menu items do this in the navigaiton settings instead.\n ",
max_length=255,
),
),
("social_text", models.CharField(blank=True, max_length=255)),
(
"theme",
models.CharField(
blank=True,
choices=[
("", "None"),
("theme-coral", "Coral"),
("theme-nebuline", "Nebuline"),
("theme-lagoon", "Lagoon"),
("theme-green", "Green"),
],
max_length=25,
),
),
(
"contact",
models.ForeignKey(
blank=True,
help_text="The contact will be applied to this page's footer and all of its descendants.\nIf no contact is selected, it will be derived from this page's ancestors, eventually falling back to the default contact.",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="people.contact",
),
),
(
"division",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="divisions.divisionpage",
),
),
(
"override_navigation_set",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="navigation.navigationset",
),
),
(
"social_image",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="images.customimage",
),
),
],
options={
"verbose_name": "Sitemap page",
},
bases=("wagtailcore.page", models.Model),
),
]
Empty file.
Loading
Loading