Crls/feat/show manager username and counts in catalog admin - #64
Open
ccantillo wants to merge 6 commits into
Open
Crls/feat/show manager username and counts in catalog admin#64ccantillo wants to merge 6 commits into
ccantillo wants to merge 6 commits into
Conversation
- Merge the separate Courses/Learners count columns into the Add Course/Add Learner columns so each cell displays the count above the action link, reducing column clutter - Update Add Manager column to show active manager usernames above the action link so admins can see at a glance who is managing each catalog - Prefetch catalog_managers__user in the queryset to avoid N+1 queries
…label Replace the count+link stacked cell with a single clickable element: the learner and course counts become the link to add a new item, and the manager username(s) become the link to add a new manager. When no manager is assigned a dash link is shown. Column headers remain 'Add Learner', 'Add Course', 'Add Manager'.
Column headers Add Learner, Add Course and Add Manager are now clickable links pointing to the respective add forms. Row cells show only the plain count (learners, courses) or the active manager usernames, with no extra link in the cell.
Header links go to the general add form; cell links (count for learners/courses, username for managers) go to the add form pre-filled with the catalog. Manager cells without an active manager show a dash link to the add form.
ccantillo
marked this pull request as ready for review
July 3, 2026 17:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Show counts and manager usernames in PartnerCatalog admin list
Summary
Improves the
PartnerCatalogchange list in Django admin so that adminscan see at a glance how many learners and courses each catalog has, and
who is managing it — without leaving the list view.
What changed
Column behaviour
The Add Learner, Add Course, and Add Manager columns now work
on two levels:
Add Learner/Add Course/Add ManagerlinkVisual flow:
or
—if no active manager is assigned.Why a custom admin template was added
Django admin assigns CSS classes to table cells automatically
(
.field-<method_name>for<td>,.column-<method_name>for<th>),but there is no way to set
text-alignon those cells from inside thecell's own HTML. Any inline style placed on the
<a>or wrapper elementinside the cell only affects that inner element — it cannot reach the
<td>or<th>container.To center the column headers and cell values without touching global
admin CSS, we added a minimal template override:
This file extends Django's stock
admin/change_list.htmland injects asmall
<style>block scoped to#result_listthat targets only thethree affected columns:
The template is placed in the app's own
templates/directory and isscoped to the
partnercatalogchange list only, so it has no effect onany other admin view.