Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions .bin/install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
set -e

pipenv install
python -m pipenv install
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the pipenv belonging to the python 3.8 install, rather than a detached version in py-utils

yarn

if [ "$SKIP_MIGRATE" != "1" ]; then
pipenv run python manage.py migrate
pipenv run python manage.py preseed_transfer_table auth wagtailcore wagtailimages.image wagtaildocs search stopwatch stopwatch
pipenv run python manage.py createsuperuser
python -m pipenv run python manage.py migrate
python -m pipenv run python manage.py preseed_transfer_table auth wagtailcore wagtailimages.image wagtaildocs search stopwatch stopwatch
python -m pipenv run python manage.py createsuperuser
touch stopwatch/settings/local.py
fi
6 changes: 5 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# Install system dependencies
# Install system dependencies
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmour -o /usr/share/keyrings/yarn-keyring.gpg \
&& sed -i '1s;^deb;deb [signed-by=/usr/share/keyrings/yarn-keyring.gpg];' /etc/apt/sources.list.d/yarn.list

# ensure GDAL is available for Django
RUN apt update && apt install -y --no-install-recommends gdal-bin libgdal-dev
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deals with a problem I was consistently running up against when building the devcontainer

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the devcontainer Dockerfile, apt update && apt install ... doesn’t clean up /var/lib/apt/lists/*, which increases image size and reduces layer cache efficiency. Consider combining update+install in a single RUN and removing apt lists afterward (and typically using apt-get in non-interactive Docker builds).

Suggested change
RUN apt update && apt install -y --no-install-recommends gdal-bin libgdal-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get install -y --no-install-recommends gdal-bin libgdal-dev \
&& rm -rf /var/lib/apt/lists/*

Copilot uses AI. Check for mistakes.

RUN curl https://raw.githubusercontent.com/commonknowledge/do-app-baseimage-django-node/main/.bin/prepare.sh | /bin/bash
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"editor.formatOnSave": true,
"[html]": {
"editor.formatOnSave": false
}
},
"python-envs.defaultEnvManager": "ms-python.python:pipenv"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"react-window": "^1.8.6",
"react-window-infinite-loader": "^1.0.7",
"sass": "^1.69.5"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just pins yarn - was automatically added when I ran yarn

}
1,321 changes: 1,321 additions & 0 deletions projects/migrations/0021_alter_event_body_alter_eventtheme_body_and_more.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion stopwatch/models/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ class Meta:
documents = ListBlock(DocumentChooserBlock())


class ReportBlock(StructBlock):
class Meta:
icon = 'doc-full-inverse'
template = 'stopwatch/components/report.html'

year = CharBlock(required=False)
title = CharBlock()
description = TextBlock(required=False)
cover_image = ImageChooserBlock(required=False)
document = DocumentChooserBlock()


class CtaBlock(StructBlock):
class Meta:
template = 'stopwatch/components/cta.html'
Expand Down Expand Up @@ -317,7 +329,8 @@ class Meta:
('organisation_listing', OrganisationListBlock()),
('alert', AlertBlock()),
('calendar', CalendarBlock()),
('accordion', AccordionStreamBlock())
('accordion', AccordionStreamBlock()),
('report', ReportBlock()),
)

LANDING_MODULES = CONTENT_MODULES + (
Expand Down
27 changes: 20 additions & 7 deletions stopwatch/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@
{{settings.stopwatch.SiteSettings.tagline|richtext}}
<div class="d-none d-md-block">
<a class="btn text-muteddarkgrey" href="/about-stopwatch">About</a>
<a class="btn text-muteddarkgrey" href="https://twitter.com/StopWatchUK" target="_blank" rel="noopener noreferrer">Twitter</a>
<a class="btn text-muteddarkgrey" href="https://www.instagram.com/stopwatch_uk/" target="_blank" rel="noopener noreferrer">Instagram</a>
<a class="btn text-muteddarkgrey" href="https://www.facebook.com/StopWatchUK" target="_blank" rel="noopener noreferrer">Facebook</a>
<a href="{{settings.stopwatch.SiteSettings.donate_page.url}}" class="btn btn-primary">Donate</a>
</div>
</div>
Expand Down Expand Up @@ -173,9 +170,6 @@
<li class="nav-item">
<a class="nav-link px-3 py-2" href="/about-stopwatch">About</a>
</li>
<li class="nav-item">
<a class="nav-link px-3 py-2 " href="https://twitter.com/StopWatchUK" target="_blank" rel="noopener noreferrer">Twitter</a>
</li>
<li class="nav-item bg-primary">
<a href="{{settings.stopwatch.SiteSettings.donate_page.url}}" class="px-3 py-2 nav-link text-white">Donate</a>
</ul>
Expand Down Expand Up @@ -224,6 +218,25 @@
{% endmainmenu %}
</div>

<div class="row mb-4 g-4">
<div class="col-8 col-md-4">
<div class="d-flex gap-3">
<a href="https://www.instagram.com/stopwatch_uk/" target="_blank" rel="noopener noreferrer" class="text-white" aria-label="Instagram">
<i class="bi-instagram fs-5"></i>
</a>
<a href="https://bsky.app/profile/stopwatchuk.bsky.social" target="_blank" rel="noopener noreferrer" class="text-white" aria-label="BlueSky">
<i class="bi-bluesky fs-5"></i>
</a>
<a href="https://www.tiktok.com/@stopwatch_uk" target="_blank" rel="noopener noreferrer" class="text-white" aria-label="TikTok">
<i class="bi-tiktok fs-5"></i>
</a>
<a href="https://www.linkedin.com/company/stopwatchuk/" target="_blank" rel="noopener noreferrer" class="text-white" aria-label="LinkedIn">
<i class="bi-linkedin fs-5"></i>
Comment thread
freemvmt marked this conversation as resolved.
</a>
</div>
</div>
</div>

<div class="row mb-2 g-4">
<div class="col-8 col-md-4 microcopy">
<div class="mb-2">{{site_settings.address}}</div>
Expand Down Expand Up @@ -253,7 +266,7 @@

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.min.js" integrity="sha384-cn7l7gDp0eyniUwwAZgrzD06kc/tftFf19TOAs2zVinnD/C7E91j9yyk5//jjpt/" crossorigin="anonymous"></script>
<script src="https://unpkg.com/infinite-scroll@4/dist/infinite-scroll.pkgd.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.css">
<script src="https://public.flourish.studio/resources/embed.js"></script>
<script src="/static/util.js"></script>

Expand Down
23 changes: 23 additions & 0 deletions stopwatch/templates/stopwatch/components/report.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% load wagtailimages_tags %}

<section class="bg-light">
<div class="d-flex flex-column flex-md-row gap-3">
{% if value.cover_image %}
<div class="order-1 order-md-2 flex-shrink-0">
{% image value.cover_image width-200 class="img-fluid" %}
</div>
{% endif %}
<div class="order-2 order-md-1 flex-grow-1">
{% if value.year %}
<p class="microcopy text-primary mb-2"><strong>{{ value.year }}</strong></p>
{% endif %}
<h2 class="heading-large mb-3">{{ value.title }}</h2>
{% if value.description %}
<p class="mb-3">{{ value.description }}</p>
{% endif %}
<a href="{{ value.document.url }}" download class="btn btn-outline-danger" aria-label="Download {{ value.document.file_extension|upper }}: {{ value.title }}">
Download {{ value.document.file_extension|upper }}
</a>
</div>
</div>
</section>
11 changes: 2 additions & 9 deletions stopwatch/templates/stopwatch/includes/article_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,7 @@ <h3 class="heading-large mb-3">
<section class="{{ class }}">
{% for page in pages %}
<div class="row g-0 link-reset iscroll_item article-listitem">
{% if page.photo %}
<a href="{{ page.url }}" class="col-8 col-md-3 pe-md-0 pt-3 pb-md-3">
<div class="img-list">{% image page.photo width-500 %}</div>
</a>
{% else %}
<div class="col-3 d-none d-md-block"></div>
{% endif %}
<div class="col order-md-first py-3 me-md-3">
<div class="col py-3 me-md-3">
<a href="{{ page.url }}">
<h3 class="heading-medium mb-3 mb-md-4">{{ page.title }}</h3>
{% if page.intro_text %}<div class="mb-3 mb-md-4">{{ page.intro_text|plaintext }}</div>{% endif %}
Expand Down Expand Up @@ -121,4 +114,4 @@ <h3 class="heading-medium mb-3 mb-md-4">{{ page.title }}</h3>
{% endfor %}
</section>
{% endif %}
{% endif %}
{% endif %}
Loading
Loading