Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banners! #1076

Open
wants to merge 11 commits into
base: live
Choose a base branch
from
Open

Banners! #1076

wants to merge 11 commits into from

Conversation

mbarton
Copy link
Member

@mbarton mbarton commented Oct 15, 2024

Fixes #1060
Fixes #1059
Fixes #882

Add banners using the Django admin, targeted to specific pages using a regular expression. Add arbitrary HTML to the banner.

Screenshot 2024-10-15 13 10 13

Screenshot 2024-10-15 12 42 18

Allows us to implement the guidance for the organisational audit in #1060 and #1059 generically. In particular you can target banners at specific users (eg the organisational audit CTA should only be shown to lead clinicians). RCPCH audit team members can always see banners.

Banners are a model in the database but are cached for 10 seconds to avoid introducing another database call on every page load. This might be overkilll though as our pages load from the DB pretty much every time anyway. Although this way at least the unauthenticated homepage doesn't hit the DB every time.

@eatyourpeas do you think a model and the Django admin is the right way to implement this? I'm wondering should the banner definitions just be in the codebase since we have a quick CD pipeline now? At least having it in the DB the team can change banners without raising a PR and being worried they'd break something.

@mbarton mbarton self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant