Skip to content

Commit f6ab444

Browse files
committed
Merge remote-tracking branch 'upstream/main' into gmt-pinned-versions
* upstream/main: Add v5.2, v6.0, and v6.1 tags to README Add skip-link (wagtail#504) Remove unused dropdown menu code More linting Linting Fix small accessibility and design issues link to virtualenv corrected Add footertext locale migration and remove spurious workflowcontenttype fixture Update Vagrant config to ubuntu/jammy64 use workspace-python-3.12 image Use `actions/checkout@v4` Replace `docker-compose` with `docker compose` in CI Version bump django-basic-auth-ip-whitelist to 0.6.x Drop mentions of Python 3.8/3.9 in docs (Django 5.0 requires 3.10) Upgrade Docker, Heroku, CI to Python 3.12 Bump to Wagtail 6.2, Django 5.0
2 parents 1ade0a2 + d72c386 commit f6ab444

File tree

21 files changed

+94
-116
lines changed

21 files changed

+94
-116
lines changed

.github/workflows/docker.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
build-container:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Build container
17-
run: docker-compose build && docker-compose pull
17+
run: docker compose build && docker compose pull
1818
- name: Run migrations
19-
run: docker-compose run app /venv/bin/python manage.py migrate
19+
run: docker compose run app /venv/bin/python manage.py migrate
2020
- name: Load initial data
21-
run: docker-compose run app /venv/bin/python manage.py load_initial_data
21+
run: docker compose run app /venv/bin/python manage.py load_initial_data
2222
- name: Run tests
23-
run: docker-compose run app /venv/bin/python manage.py test
23+
run: docker compose run app /venv/bin/python manage.py test

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Python
1717
uses: actions/setup-python@v4
1818
with:
19-
python-version: 3.9
19+
python-version: '3.12'
2020
cache: 'pip'
2121
cache-dependency-path: 'requirements/*.txt'
2222
- name: Install dependencies

.gitpod.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gitpod/workspace-full
1+
FROM gitpod/workspace-python-3.12
22
ENV PYTHONUSERBASE=/workspace/.pip-modules
33
ENV PATH=$PYTHONUSERBASE/bin:$PATH
44
ENV PIP_USER=yes

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-slim
1+
FROM python:3.12-slim
22

33
# Install packages needed to run your application (not build deps):
44
# We need to recreate the /usr/share/man/man{1..8} directories first because
@@ -34,9 +34,9 @@ RUN set -ex \
3434
zlib1g-dev \
3535
" \
3636
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
37-
&& python3.10 -m venv ${VIRTUAL_ENV} \
38-
&& pip install -U pip \
39-
&& pip install --no-cache-dir -r /requirements/production.txt \
37+
&& python3.12 -m venv ${VIRTUAL_ENV} \
38+
&& python3.12 -m pip install -U pip \
39+
&& python3.12 -m pip install --no-cache-dir -r /requirements/production.txt \
4040
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
4141
&& rm -rf /var/lib/apt/lists/*
4242

Vagrantfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Vagrant.configure(2) do |config|
1212

1313
# Every Vagrant development environment requires a box. You can search for
1414
# boxes at https://atlas.hashicorp.com/search.
15-
config.vm.box = "wagtail/buster64"
16-
config.vm.box_version = "~> 1.0"
15+
config.vm.box = "ubuntu/jammy64"
16+
config.vm.box_version = "~> 20220810.0.0"
1717

1818
# Disable automatic box update checking. If you disable this, then
1919
# boxes will only be checked for updates when the user runs

bakerydemo/base/fixtures/bakerydemo.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,13 +1516,6 @@
15161516
"workflow": 1
15171517
}
15181518
},
1519-
{
1520-
"model": "wagtailcore.workflowcontenttype",
1521-
"pk": 4,
1522-
"fields": {
1523-
"workflow": 1
1524-
}
1525-
},
15261519
{
15271520
"model": "wagtailcore.workflowtask",
15281521
"pk": 1,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 5.0.8 on 2024-08-15 17:22
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
("base", "0020_alter_footertext_options"),
11+
("wagtailcore", "0094_alter_page_locale"),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name="footertext",
17+
name="locale",
18+
field=models.ForeignKey(
19+
editable=False,
20+
on_delete=django.db.models.deletion.PROTECT,
21+
related_name="+",
22+
to="wagtailcore.locale",
23+
verbose_name="locale",
24+
),
25+
),
26+
]

bakerydemo/base/templatetags/navigation_tags.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ def get_site_root(context):
1515
return Site.find_for_request(context["request"]).root_page
1616

1717

18-
def has_menu_children(page):
19-
# This is used by the top_menu property
20-
# get_children is a Treebeard API thing
21-
# https://tabo.pe/projects/django-treebeard/docs/4.0.1/api.html
22-
return page.get_children().live().in_menu().exists()
23-
24-
2518
def has_children(page):
2619
# Generically allow index pages to list their children
2720
return page.get_children().live().exists()
@@ -33,13 +26,10 @@ def is_active(page, current_page):
3326

3427

3528
# Retrieves the top menu items - the immediate children of the parent page
36-
# The has_menu_children method is necessary because the Foundation menu requires
37-
# a dropdown class to be applied to a parent
3829
@register.inclusion_tag("tags/top_menu.html", takes_context=True)
3930
def top_menu(context, parent, calling_page=None):
4031
menuitems = parent.get_children().live().in_menu()
4132
for menuitem in menuitems:
42-
menuitem.show_dropdown = has_menu_children(menuitem)
4333
# We don't directly check if calling_page is None since the template
4434
# engine can pass an empty string to calling_page
4535
# if the variable passed as calling_page does not exist.
@@ -56,30 +46,6 @@ def top_menu(context, parent, calling_page=None):
5646
}
5747

5848

59-
# Retrieves the children of the top menu items for the drop downs
60-
@register.inclusion_tag("tags/top_menu_children.html", takes_context=True)
61-
def top_menu_children(context, parent, calling_page=None):
62-
menuitems_children = parent.get_children()
63-
menuitems_children = menuitems_children.live().in_menu()
64-
for menuitem in menuitems_children:
65-
menuitem.has_dropdown = has_menu_children(menuitem)
66-
# We don't directly check if calling_page is None since the template
67-
# engine can pass an empty string to calling_page
68-
# if the variable passed as calling_page does not exist.
69-
menuitem.active = (
70-
calling_page.url_path.startswith(menuitem.url_path)
71-
if calling_page
72-
else False
73-
)
74-
menuitem.children = menuitem.get_children().live().in_menu()
75-
return {
76-
"parent": parent,
77-
"menuitems_children": menuitems_children,
78-
# required by the pageurl tag that we want to use within this template
79-
"request": context["request"],
80-
}
81-
82-
8349
@register.inclusion_tag("tags/breadcrumbs.html", takes_context=True)
8450
def breadcrumbs(context):
8551
self = context.get("self")

bakerydemo/static/css/main.css

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ figure img {
252252
height: auto;
253253
}
254254

255+
/* Overriding Bootstrap's default caption styles */
256+
caption {
257+
color: var(--dark);
258+
}
259+
255260
/* Generic detail page styles */
256261
.intro {
257262
font-family: var(--font--secondary);
@@ -402,10 +407,12 @@ blockquote .attribute-name {
402407
color: var(--dark);
403408
}
404409

405-
/* stylelint-disable-next-line selector-class-pattern */
406-
.block-paragraph_block a {
410+
/* stylelint-disable selector-class-pattern */
411+
.block-paragraph_block a,
412+
.block-ingredients_list a {
407413
text-decoration: underline;
408414
}
415+
/* stylelint-enable selector-class-pattern */
409416

410417
/* stylelint-disable-next-line selector-class-pattern */
411418
.block-embed_block iframe {
@@ -448,6 +455,18 @@ blockquote .attribute-name {
448455
z-index: 10;
449456
}
450457

458+
.skip-link {
459+
z-index: 20;
460+
position: absolute;
461+
top: -100%;
462+
padding: 20px;
463+
background-color: var(--white);
464+
}
465+
466+
.skip-link:focus {
467+
top: 0;
468+
}
469+
451470
.index-header__title {
452471
color: var(--dark);
453472
font-weight: 400;
@@ -742,38 +761,6 @@ blockquote .attribute-name {
742761
}
743762
}
744763

745-
.dropdown-menu {
746-
background-color: var(--cream);
747-
border-radius: 0;
748-
border: transparent;
749-
}
750-
751-
.dropdown-menu > li > a {
752-
border-bottom: 1px solid var(--border-grey);
753-
color: var(--dark);
754-
font-family: var(--font--secondary);
755-
padding: 10px 20px;
756-
}
757-
758-
.dropdown-menu > li > a:hover {
759-
text-decoration: underline;
760-
}
761-
762-
/* Menu dropdown hack to allow toggling */
763-
li.has-submenu a.allow-toggle {
764-
float: left;
765-
padding-right: 0;
766-
}
767-
768-
.caret-custom {
769-
float: right;
770-
padding: 10px 10px 15px 5px !important;
771-
}
772-
773-
.caret-custom::after {
774-
content: '▼' !important;
775-
}
776-
777764
/* Mobile menu styling */
778765
@media (max-width: 1150px) {
779766
.nav-pills > .presentation {

bakerydemo/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{% endblock breadcrumbs %}
4242

4343

44-
<main>
44+
<main id="main-content">
4545
{% block messages %}
4646
{% include "includes/messages.html" %}
4747
{% endblock messages %}

0 commit comments

Comments
 (0)