Skip to content

Commit 8c05bab

Browse files
author
AJ Griffiths
committed
Merge branch 'BAU/TWE-698-site-map' into staging
2 parents 1da8dc1 + d28f47d commit 8c05bab

26 files changed

Lines changed: 615 additions & 14 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ node_modules*
1818
/.vscode/*
1919
!/.vscode/launch.json
2020
/database_dumps/
21+
.planning/

.stylelintrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,18 @@ module.exports = {
88
ignoreUnits: ['dvh'],
99
},
1010
],
11+
'property-no-unknown': [
12+
true,
13+
{
14+
ignoreProperties: ['container-type'],
15+
},
16+
],
17+
'scss/at-rule-no-unknown': [
18+
true,
19+
{
20+
ignoreAtRules: ['container'],
21+
},
22+
],
23+
'scss/dollar-variable-no-missing-interpolation': null,
1124
},
1225
};

tbx/navigation/templatetags/navigation_tags.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from django import template
22

3+
from tbx.sitemap.models import SitemapPage
4+
35

46
register = template.Library()
57

@@ -73,5 +75,6 @@ def footerlinks(context):
7375
"footerlinks": context["settings"]["navigation"][
7476
"NavigationSettings"
7577
].footer_links,
78+
"sitemap_page": SitemapPage.objects.filter(live=True).first(),
7679
"request": request,
7780
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% load wagtailcore_tags %}
2+
<ul class="sitemap__links">
3+
{% for item in items %}
4+
<li class="sitemap__link-item">
5+
<a href="{% pageurl item.page %}" class="sitemap__link">{{ item.page.title }}</a>
6+
{% if item.children %}
7+
{% include "patterns/molecules/sitemap/sitemap_tree.html" with items=item.children %}
8+
{% endif %}
9+
</li>
10+
{% endfor %}
11+
</ul>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
context:
2+
items:
3+
- page:
4+
title: Our Work
5+
children:
6+
- page:
7+
title: Case Study One
8+
children: []
9+
- page:
10+
title: Case Study Two
11+
children: []
12+
- page:
13+
title: Strategy & Design
14+
children: []
15+
16+
tags:
17+
pageurl:
18+
item.page:
19+
raw: '#'

tbx/project_styleguide/templates/patterns/navigation/components/footer-links.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@
77
</a>
88
{% endwith %}
99
{% endfor %}
10+
{% if sitemap_page %}
11+
<a href="/sitemap/" class="footerlinks-nav__link">Sitemap</a>
12+
{% endif %}
1013
</nav>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{# tbx/project_styleguide/templates/patterns/pages/sitemap/sitemap_page.html #}
2+
{% extends "patterns/base_page.html" %}
3+
{% load wagtailcore_tags %}
4+
5+
{% block content %}
6+
<div class="grid grid--spacer-large">
7+
<div class="grid__title">
8+
<h1 class="heading heading--three">{{ page.title }}</h1>
9+
</div>
10+
<div class="sitemap grid__sitemap">
11+
{% for item in sections %}
12+
<section class="sitemap__section">
13+
<h2 class="heading heading--four sitemap__section-heading">
14+
<a href="{% pageurl item.section %}" class="sitemap__link">{{ item.section.title }}</a>
15+
</h2>
16+
{% if item.pages %}
17+
{% include "patterns/molecules/sitemap/sitemap_tree.html" with items=item.pages %}
18+
{% endif %}
19+
</section>
20+
{% endfor %}
21+
</div>
22+
</div>
23+
{% endblock %}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
context:
2+
page:
3+
title: Sitemap
4+
get_verbose_name: sitemap page
5+
6+
sections:
7+
- section:
8+
title: Work
9+
pages:
10+
- page:
11+
title: Our Work
12+
children:
13+
- page:
14+
title: Case Study One
15+
children: []
16+
- page:
17+
title: Case Study Two
18+
children: []
19+
- page:
20+
title: Strategy & Design
21+
children: []
22+
- section:
23+
title: Charity
24+
pages:
25+
- page:
26+
title: Digital for charities
27+
children: []
28+
- page:
29+
title: Fundraising technology
30+
children: []
31+
- section:
32+
title: Blog
33+
pages:
34+
- page:
35+
title: All Posts
36+
children: []
37+
38+
tags:
39+
pageurl:
40+
item.section:
41+
raw: '#'
42+
item.page:
43+
raw: '#'
44+
footerlinks:
45+
'':
46+
template_name: 'patterns/navigation/components/footer-links.html'

tbx/project_styleguide/templates/patterns/styleguide/components/components.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ <h2 class="underline mt-8 mb-2">Footer CTA</h2>
244244
{% include "patterns/molecules/footer-cta/footer-cta.html" with value=partners_data %}
245245
</div>
246246

247+
<div>
248+
<h2 class="underline mt-8 mb-2">Sitemap tree</h2>
249+
{% include "patterns/molecules/sitemap/sitemap_tree.html" with items=sitemap_items %}
250+
</div>
251+
247252
<div>
248253
<h2 class="underline mt-8 mb-2">Footer links</h2>
249254
{% footerlinks %}

tbx/project_styleguide/templates/patterns/styleguide/components/components.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,29 @@ context:
7474
# Markdown block
7575
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>'
7676

77+
sitemap_items:
78+
- page:
79+
title: Our Work
80+
children:
81+
- page:
82+
title: Case Study One
83+
children: []
84+
- page:
85+
title: Case Study Two
86+
children: []
87+
- page:
88+
title: Strategy & Design
89+
children: []
90+
7791
tags:
7892
pageurl:
7993
# for title-filters.html
8094
item as index:
8195
target_var: index
8296
raw: '#'
97+
# for sitemap_tree.html
98+
item.page:
99+
raw: '#'
83100
# for featured_case_study.html
84101
link:
85102
raw: '#'

0 commit comments

Comments
 (0)