Skip to content

Bootstrap 5 migration, collectstatic fixes, and project modernization#671

Merged
farridav merged 6 commits intomainfrom
hotfix/fixing_collectstatic
Feb 25, 2026
Merged

Bootstrap 5 migration, collectstatic fixes, and project modernization#671
farridav merged 6 commits intomainfrom
hotfix/fixing_collectstatic

Conversation

@farridav
Copy link
Copy Markdown
Owner

  • Bootstrap 5 migration: Upgraded all templates, CSS, and JS from Bootstrap 4 to Bootstrap 5 (data-toggle → data-bs-toggle, data-dismiss → data-bs-dismiss, etc.)
  • Dark/light mode overhaul: Replaced the old dark_mode_theme (separate Bootswatch theme) with a unified default_theme_mode setting ("light", "dark", or "auto") using Bootstrap 5's
    data-bs-theme attribute — any theme now works in both light and dark
  • New Bootswatch themes: Added brite, morph, quartz, vapor, and zephyr
  • Collectstatic fix: Resolved issues with .map files breaking collectstatic on certain storage backends (Fixes RE: New Bootstrap change: sourceMappingURL=bootstrap.min.css.map to be included in latest release? #651)
  • Tooling migration: Replaced Poetry with uv for dependency management; replaced black with ruff
  • Python/Django support: Dropped Python 3.8/3.9, added Python 3.13 and Django 5.1/5.2/6.0 support
  • New setting: show_theme_chooser — shows a theme switcher dropdown in the top navbar
  • UI fixes: Spacing, sizing, and layout improvements across admin templates
  • Docs updated: All documentation updated for Bootstrap 5, uv, ruff, new themes, and new settings
  • New locale: Added pt_BR (Brazilian Portuguese) translations

Breaking Changes

  • Python 3.8 and 3.9 dropped — minimum is now Python 3.10
  • dark_mode_theme deprecated — if you had dark_mode_theme set in JAZZMIN_UI_TWEAKS, it is now ignored (with a deprecation warning logged). Migrate to "default_theme_mode": "auto" for
    equivalent behavior
  • Bootstrap 4 → 5 — if you have custom CSS/JS targeting Bootstrap 4 classes (e.g. data-toggle, btn-outline-default, ml-/mr-), you'll need to update to Bootstrap 5 equivalents
    (data-bs-toggle, ms-/me-, etc.)
  • Poetry → uv — development setup now uses uv instead of poetry; poetry.lock removed, uv.lock added

Test plan

  • Run make test to verify all tests pass
  • Run make test_app and verify admin UI renders correctly
  • Test light/dark mode switching with default_theme_mode: "auto"
  • Verify collectstatic completes without errors
  • Test with existing JAZZMIN_SETTINGS / JAZZMIN_UI_TWEAKS to confirm backward compatibility
  • Verify dark_mode_theme deprecation warning appears if old setting is present

@farridav farridav force-pushed the hotfix/fixing_collectstatic branch from 8009b26 to faef177 Compare February 25, 2026 15:22
@farridav
Copy link
Copy Markdown
Owner Author

FYI: This is part of a project cleanup and modernisation effort with the help of AI .. next steps involve:

  • looking at JAZZMIN_UI_TWEAKS and rationalising them
  • Clearing up stale/irrelevant github issues, and triaging relevent ones
  • Sifting through pull requests
  • Documenting the plans and approach on 4th party app support e.g:
    • Django JSON Widget
    • django-celery-beat
    • django-constance
    • django-guardian
    • django-import-export
    • django-location-field
    • django-modeltranslation
    • django-money
    • django-simple-history
    • djangoql
  • More features
  • Roadmap

farridav and others added 6 commits February 25, 2026 15:29
This commit completes the AdminLTE v4 & Bootstrap 5 migration and fixes
multiple UI/UX issues across the admin interface.

Bootstrap 5 Migration:
- Fixed all deprecated Bootstrap 4 patterns in 28 templates
- Removed input-group-append/prepend wrappers
- Changed btn-block to d-grid/w-100 patterns
- Updated float-right/left to float-end/start
- Fixed close button markup (class="close" → btn-close)
- Updated data attributes (data-dismiss → data-bs-dismiss, data-toggle → data-bs-toggle)

CSS Cleanup (871 lines → ~460 lines):
- Aggressively removed redundant framework overrides
- Kept only Django-specific fixes and integrations
- Used CSS custom properties for theme-aware styling
- All styles now use Bootstrap 5 and AdminLTE v4 patterns

UI Improvements (15 issues fixed):
- Select2 dark theme support with proper contrast
- User panel spacing aligned with sidebar items
- Submit buttons proper flexbox layout with mobile responsiveness
- Horizontal selectors (permissions) side-by-side layout
- Changelist search inline layout
- Form fields proper spacing on detail pages
- One-to-many field selections visibility in dark theme
- Inlines overflow handling in tabbed views
- Checkbox column width optimization
- Related widget wrapper links spacing
- Select2 styling normalized with form-control
- Add button moved to filters area for better UX
- Detail page buttons responsive layout
- Form elements AdminLTE v3 inspired styling

New Features:
- Added seed_data management command with configurable datasets
- Added comprehensive Bootstrap 5 migration tests (443 test cases)
- Added Makefile targets: seed_data, seed_small, seed_large
- Added README_SEED_DATA.md documentation

Updated Dependencies:
- AdminLTE v4.0.0 (from v3)
- Bootstrap 5.3.3 (from v4)
- All Bootswatch themes updated to v5

All changes maintain backward compatibility with existing configurations
and follow the "Over the Top" philosophy - leveraging framework defaults
rather than fighting them with custom CSS.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Migrate remaining BS4 classes: mr-1→me-1, text-left→text-start, btn-xs→btn-sm
- Use bootstrap.bundle.min.js (includes Popper.js) for dropdown support
- Rewrite bootstrap-show-modal and related-modal.js for native BS5 Modal API
- Fix Django 6.0 compat: mark_safe instead of format_html with no args,
  replace search_var with literal "q" in change_list.html
- Reduce main.css to minimal Django-specific overrides:
  - Set --bs-body-font-size: 0.875rem to match AdminLTE v3 sizing
  - Style bare Django form widgets, calendar/clock popups, selectors
  - Fix related-widget-wrapper layout with flexbox
  - Add Select2 dark mode and border theming
  - Style #jazzy-actions panel and .user-panel alignment
- Fix Select2 init: width 'element'→'100%' for proper BS5 sizing
- Refresh all Bootswatch themes from v5, add brite theme, strip sourceMappingURL
- Fix Makefile download_bootswatch_css shell syntax
- Update submit_line.html for consistent button styling
- Update tests for show_ui_builder=False and CSS size threshold
- Remove p-0 from changelist card-body to prevent AdminLTE first-column padding shift
- Add btn-sm to all submit_line.html buttons for consistent sizing with object-tools
- Add d-flex flex-wrap gap-2 to object-tools div for proper button spacing
- Add mb-3 to dashboard cards for bottom margin between app cards
@farridav farridav force-pushed the hotfix/fixing_collectstatic branch from 0c695db to 86ce0a3 Compare February 25, 2026 15:29
@farridav farridav merged commit e1f6b2e into main Feb 25, 2026
9 of 11 checks passed
@farridav farridav deleted the hotfix/fixing_collectstatic branch February 25, 2026 16:08
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.

RE: New Bootstrap change: sourceMappingURL=bootstrap.min.css.map to be included in latest release?

1 participant