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

Display 2025 methodology #661

Merged
merged 23 commits into from
May 28, 2024
Merged

Display 2025 methodology #661

merged 23 commits into from
May 28, 2024

Conversation

struan
Copy link
Member

@struan struan commented May 2, 2024

This updates the site to allow the display of multiple scorecard years by adding the year to the start of the url.

It defaults to displaying the year set in settings.PLAN_YEAR

Fixes #643
Fixes #608

struan added 5 commits May 2, 2024 14:01
does not attempt any of the scores, so we can import questions to
display on a methodology page
means we can have e.g. /2023/sections/ to split out different years
these now have a different namespace so update the url names
defaults to settings.PLAN_YEAR if no year in the url
mostly updates settings.PLAN_YEAR to self.request.year but also adds a
year param to the appropriate functions where it was missing
@struan struan force-pushed the 2025_methodology branch from 88bb844 to 49d39c8 Compare May 7, 2024 12:37
@struan struan force-pushed the 2025_methodology branch from 2704e66 to 49d39c8 Compare May 28, 2024 16:11
struan and others added 18 commits May 28, 2024 17:19
move most of the content out to per year includes so these can be
updated with new text as appropriate
- New `scoring/base-minimal.html` layout for pages where we don’t want
  the full nav, header, and footer… like the Login and Down pages.
- Update `scoring/login.html` and `scoring/down.html` to use the new
  `scoring/base-minimal.html`. This fixes the previously un-styled look
  of these pages since they’re now using the right header/footer markup.
- Render `scoring/login.html` form with django-bootstrap4 for slightly
  better form input styling.
- Rename `CheckForDownPageMixin` to `PrivateScorecardsAccessMixin` for
  clarity. It’s not checking whether there’s a down page, it’s checking
  whether the scorecards are set to private.
- Fix broken redirect behaviour in PrivateScorecardsAccessMixin and
  LoginView. The custom `get_success_url()` in LoginView was preventing
  Django’s default LoginView/RedirectURLMixin behaviour from picking up
  the `?next=` parameter in the URL, and to make things worse, we were
  also setting the parameter to `?redirect_to=` rather than `?next=`
  so it was never going to work. Stripping out all the customisations in
  PrivateScorecardsAccessMixin and LoginView means we benefit from the
  sensible defaults in Django’s built-in AccessMixin and LoginView.
- Move `LOGIN_URL` config setting out of CheckForDownPageMixin and into
  `settings.py` (again, this is where Django’s AccessMixin expects it).
There are points when we want to display the next year's scorecards
methodology as the default rather than the cuurent years to add a
METHODLOGY_YEAR setting and use that in place of the PLAN_YEAR if we're
not viewing a specific year.
Hard-coded at the moment, based on `question.code`.
@struan struan force-pushed the 2025_methodology branch from 7710bf3 to fc25399 Compare May 28, 2024 16:20
@struan struan merged commit fc25399 into master May 28, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create 2025 Methodology page [scorecards] Enable support of multiple years in scorecards app
3 participants