Skip to content

fix: Render Django 6.1 breadcrumb markup on the alias usage page - #396

Merged
fsbraun merged 3 commits into
masterfrom
fix/395-django-61-breadcrumbs
Aug 27, 2026
Merged

fix: Render Django 6.1 breadcrumb markup on the alias usage page#396
fsbraun merged 3 commits into
masterfrom
fix/395-django-61-breadcrumbs

Conversation

@fsbraun

@fsbraun fsbraun commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary by Sourcery

Support Django 6.1 breadcrumb styling on the alias usage page while maintaining compatibility with earlier Django releases.

Bug Fixes:

  • Render alias usage breadcrumbs with Django 6.1-compatible ordered-list markup while preserving the legacy layout for earlier Django versions.

Enhancements:

  • Add a reusable template tag for Django version comparisons and cover version-dependent breadcrumb rendering with tests.

Build:

  • Add Django 6.1 package support and dependency matrices across supported Python and django-cms combinations.

CI:

  • Expand the tox test environment matrix to run Django 6.1 configurations.

Tests:

  • Add coverage for the Django version comparison tag and alias usage breadcrumb markup across Django versions.

Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM

Related resources

Checklist

Django 6.1 changed the admin breadcrumbs from `<div class="breadcrumbs">`
to `<ol class="breadcrumbs">` with one `<li>` per crumb, and its selectors
in `admin/css/base.css` are element-qualified. The `{% block breadcrumbs %}`
override in `alias_usage.html` still emitted the old markup, so the
breadcrumbs matched no rule at all and rendered unstyled.

The block now switches on the Django version through a new
`{% django_version_gte %}` template tag: on 6.1+ it emits the list markup
with `aria-current="page"` on the last crumb and without the literal
`&rsaquo;` separators (6.1 generates them from `li::after`), and keeps the
old markup on 5.2/6.0.

Fixes #395

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
@sourcery-ai

sourcery-ai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR fixes alias usage breadcrumbs across Django versions by adding a reusable version-checking template tag and conditionally rendering the Django 6.1+ ordered-list breadcrumb structure versus the legacy markup, with tests covering both version logic and generated HTML.

Flow diagram for version-aware alias usage breadcrumbs

flowchart TD
    A[Alias usage page renders breadcrumbs] --> B[django_version_gte 6 1]
    B -->|true| C[Render ol.breadcrumbs with li items]
    B -->|false| D[Render div.breadcrumbs with separators]
    C --> E[Display Usage of alias]
    D --> E
Loading

File-Level Changes

Change Details Files
Add Django-version-aware breadcrumb rendering for the alias usage page.
  • Introduce a template tag that compares the running Django major/minor version.
  • Render Django 6.1+ breadcrumbs as an ordered list with current-page semantics, while retaining legacy div markup and separators for older versions.
djangocms_alias/templates/djangocms_alias/alias_usage.html
djangocms_alias/templatetags/djangocms_alias_tags.py
Add coverage for version detection and rendered breadcrumb markup.
  • Test version comparisons at current, previous, next-minor, and next-major versions.
  • Render the alias usage template directly and assert the appropriate markup and separator behavior for Django before and from 6.1.
tests/test_templatetags.py
tests/test_views.py

Assessment against linked issues

Issue Objective Addressed Explanation
#395 Render Django 6.1-compatible breadcrumbs on the alias usage page using
    with list items, generated separators, and aria-current="page" on the final crumb.
#395 Preserve the existing
markup for Django versions before 6.1 so the page remains compatible with older supported Django releases.
#395 Provide test coverage for the Django-version-dependent breadcrumb markup and the version comparison template tag.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

fsbraun and others added 2 commits August 27, 2026 18:31
Django main requires `asgiref>=3.12.1`, but the djmain lock files still
pinned 3.9.1 / 3.10.0, so `unit-tests-dev` failed to install before it
ever ran a test:

    The conflict is caused by:
        The user requested asgiref==3.9.1
        django 6.2 depends on asgiref>=3.12.1

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
Django 6.1 is released and is what #395 is about, but nothing in the
matrix ran against it - the 6.1 code paths were only exercised by the
`unit-tests-dev` jobs, whose test step is `continue-on-error`.

Adds a `dj61` environment for Python 3.12-3.14 (Django 6.1 needs 3.12+),
the matching lock files, and the trove classifier.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
@fsbraun
fsbraun merged commit 3e0cc76 into master Aug 27, 2026
14 checks passed
fsbraun added a commit that referenced this pull request Aug 27, 2026
#396 and #397 landed upstream in the meantime; #396 was merged before the
matrix was trimmed. Resolved every conflict under tests/requirements/,
tox.ini and compile.py in favour of this branch, so the trimmed matrix
stands: django CMS 5.0 only at py311-dj52 and py314-dj61, django CMS 5.1
across the full Python/Django matrix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwNaBKq7MNLhibbjjiAYHM
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.

Alias usage page renders unstyled breadcrumbs on Django 6.1

1 participant