Skip to content

chore (5/8): migrate templates from Bootstrap 3 to Bootstrap 5 - #328

Merged
A-Souhei merged 2 commits into
developmentfrom
chore/ckan-211-pr5-bootstrap-5
May 26, 2026
Merged

A-Souhei merged 2 commits into
developmentfrom
chore/ckan-211-pr5-bootstrap-5

Conversation

@A-Souhei

@A-Souhei A-Souhei commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Single cause: CKAN 2.11 ships Bootstrap 5 (CKAN 2.9 was Bootstrap 3). Every change in this PR is a mechanical Bootstrap 3 → 5 class/attribute rename required for our existing templates to keep rendering correctly. There is no visual redesign, no new layouts, and no colour or spacing changes — only renames of classes/attributes that Bootstrap 5 removed or renamed.

This directly answers the client's question "are these all to do with the bootstrap version changing? If so, that could be 1 PR" — yes, and this is that one PR. Changes for other reasons (CSRF, activity-plugin routes) are split into their own PRs (#329, #330).

Note: the large "new templating" from the original branch (the icon double-encoding rewrite — ~18 template overrides + a custom helpers.py) is deliberately not here. It was investigated and dropped: the underlying bug does not reproduce on CKAN 2.11.4, so those overrides are unnecessary.

What changed (all BS3 → BS5 renames)

  • pull-right / pull-left → float-end / float-start
  • data-toggle / data-target → data-bs-toggle / data-bs-target (dropdowns, modal, collapse, tooltip)
  • data-placement → data-bs-placement
  • text-right → text-end
  • hidden → d-none (incl. the Download All button + its download_all.js toggle, so show/hide works again)
  • col-xs-* → col-*, col-lg-offset-2 → offset-lg-2, order-xs-2 → order-2, hidden-xs hidden-sm → d-none d-md-block
  • label label-info / label-danger → badge bg-info / bg-danger
  • format-chip CSS: added parallel .badge[data-format] selectors alongside the existing .label[data-format] ones so the colour coding still applies under BS5 markup (no colour values changed)

Plus one CKAN-2.11 (not Bootstrap) item that belongs with the homepage template work:

  • New home/index.html shim that includes our home/layout1.html. CKAN 2.11 removed the ckan.homepage_style config that previously loaded our custom homepage; without this shim the homepage silently falls back to core CKAN's.

Completeness

A repo-wide sweep was run for leftover BS3 classes (pull-*, col-xs-*, hidden-*, data-toggle, data-placement, text-right, .hidden, label-*). All functional leftovers are converted. Remaining .label[data-format] selectors are intentional (kept alongside the new .badge[data-format] for backwards compatibility); a .col-xs-* selector list in custom.css is a harmless padding rule (its col-sm/md/lg selectors still apply under BS5).

Test plan

  • Full test suite green (160 passed / 1 skipped)
  • Manual browser smoke: dropdowns open, dataset-transfer modal renders, format chips show in colour, Download All button hides/shows correctly, homepage shows the custom layout

Copilot AI review requested due to automatic review settings May 18, 2026 13:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates UNAIDS CKAN theme templates and format-chip styles toward Bootstrap 5 compatibility for CKAN 2.11, preserving custom homepage behavior and key UI interactions.

Changes:

  • Replaces several Bootstrap 3 data attributes, grid utilities, float helpers, and label classes with Bootstrap 5 equivalents.
  • Adds .badge[data-format] selectors alongside existing .label[data-format] styling.
  • Adds home/index.html to route the CKAN homepage back through the custom home/layout1.html.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ckanext/unaids/theme/templates/user/edit_user_form.html Updates grid and float utilities in the user edit form.
ckanext/unaids/theme/templates/snippets/dataset_selector.html Updates dropdown trigger attribute.
ckanext/unaids/theme/templates/scheming/form_snippets/org_to_allow_transfer_to.html Updates collapse trigger attribute.
ckanext/unaids/theme/templates/request/show.html Updates float utility on approval action.
ckanext/unaids/theme/templates/package/snippets/package_form.html Updates float utilities in danger-zone actions.
ckanext/unaids/theme/templates/package/snippets/bulk_file_uploader.html Updates modal trigger attributes.
ckanext/unaids/theme/templates/package/releases/list.html Updates dropdown and grid utilities in release list.
ckanext/unaids/theme/templates/package/releases/base.html Updates offset utility in release modal layout.
ckanext/unaids/theme/templates/package/read.html Updates float utility on download-all button.
ckanext/unaids/theme/templates/package/read_base.html Updates tooltip toggle attribute.
ckanext/unaids/theme/templates/package/collaborators/collaborator_new.html Updates float utility on collaborator delete action.
ckanext/unaids/theme/templates/organization/members.html Updates float utility in member action group.
ckanext/unaids/theme/templates/organization/member_new.html Updates float utility on member delete action.
ckanext/unaids/theme/templates/organization/bulk_process.html Updates float utility and converts labels to Bootstrap 5 badges.
ckanext/unaids/theme/templates/home/layout1.html Updates homepage grid, ordering, visibility, and float utilities.
ckanext/unaids/theme/templates/home/index.html Adds homepage shim that includes the custom layout.
ckanext/unaids/assets/custom.css Adds Bootstrap 5 badge format-chip selectors.
ckanext/unaids/assets/css/ckanext-geoview.css Adds Bootstrap 5 badge selectors for geospatial formats.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ckanext/unaids/theme/templates/package/read.html Outdated
Comment thread ckanext/unaids/theme/templates/package/read_base.html Outdated
Comment thread ckanext/unaids/theme/templates/user/edit_user_form.html Outdated
@A-Souhei A-Souhei changed the title chore: migrate templates from Bootstrap 3 to Bootstrap 5 chore (5/7): migrate templates from Bootstrap 3 to Bootstrap 5 May 19, 2026
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr4-test-bodies branch from 7dad432 to 4702c86 Compare May 20, 2026 11:07
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr5-bootstrap-5 branch from 3ce2fd2 to 966587d Compare May 20, 2026 11:07
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr4-test-bodies branch from 4702c86 to 14307a5 Compare May 20, 2026 11:34
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr5-bootstrap-5 branch from 966587d to c9a3a3c Compare May 20, 2026 11:34
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr4-test-bodies branch from 14307a5 to 078885e Compare May 20, 2026 13:17
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr5-bootstrap-5 branch from c9a3a3c to 19976a5 Compare May 20, 2026 13:18
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr4-test-bodies branch from 078885e to 1b13721 Compare May 21, 2026 06:14
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr5-bootstrap-5 branch 2 times, most recently from 03248ff to 2f86950 Compare May 21, 2026 06:58
@A-Souhei A-Souhei changed the title chore (5/7): migrate templates from Bootstrap 3 to Bootstrap 5 chore (5/8): migrate templates from Bootstrap 3 to Bootstrap 5 May 21, 2026
@A-Souhei
A-Souhei requested a review from ChasNelson1990 May 21, 2026 16:08

@ChasNelson1990 ChasNelson1990 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr4-test-bodies branch from 3e1167a to 25b8879 Compare May 26, 2026 10:47
Base automatically changed from chore/ckan-211-pr4-test-bodies to development May 26, 2026 14:17
Test User added 2 commits May 26, 2026 17:20
CKAN 2.11 ships Bootstrap 5 (was BS3 in 2.9). Templates and CSS need
matching syntax updates so dropdowns, modals, tooltips, columns and
helpers keep working under the new framework.

- data-toggle / data-target -> data-bs-toggle / data-bs-target across
  5 templates (dropdowns, modals, tooltips).
- pull-right / pull-left -> float-end / float-start across the
  templates that used them (the third-party bootstrap-table.css is
  left untouched).
- col-xs-* -> col-*, col-{sm,md,lg}-offset-N -> offset-{sm,md,lg}-N,
  order-xs-N -> order-N, and hidden-{xs,sm} -> d-* responsive utilities
  in home/layout1.html, user/edit_user_form.html, and the release-list
  rows.
- label label-info / label-danger -> badge bg-info / bg-danger in the
  org bulk_process row. The format-color rules in assets/custom.css
  and assets/css/ckanext-geoview.css gain parallel .badge[data-format]
  selectors next to the existing .label[data-format] ones so the
  format chips keep their colours under both BS3-rendered and
  BS5-rendered markup (no colour changes here — cosmetic adjustments
  are out of scope).
- Add ckanext/unaids/theme/templates/home/index.html that delegates
  to home/layout1.html. CKAN 2.11 removed the ckan.homepage_style
  config that previously selected layout1; without this shim the
  homepage falls back to core CKAN's layout and our custom homepage
  vanishes.
Completes the BS3->5 migration by converting classes/attributes the
first pass missed (3 flagged by review, 3 found by a follow-up sweep):

- read.html + download_all.js: `hidden` -> `d-none` for the Download
  All button, in both the template and the JS module that toggles it
  (BS5 dropped `.hidden`, so the button never hid/showed correctly).
- read_base.html: tooltip `data-placement` -> `data-bs-placement`.
- edit_user_form.html: `text-right` -> `text-end`; `hidden` -> `d-none`
  on the hidden-inputs wrapper.
- text_template.html: `hidden` -> `d-none` on the value-carrying input
  (would otherwise render visibly under BS5).
- releases/restore_or_delete.html: `text-right` -> `text-end`.
@A-Souhei
A-Souhei force-pushed the chore/ckan-211-pr5-bootstrap-5 branch from 7492053 to 9f66143 Compare May 26, 2026 14:21
@A-Souhei
A-Souhei merged commit 256d4de into development May 26, 2026
3 checks passed
@A-Souhei
A-Souhei deleted the chore/ckan-211-pr5-bootstrap-5 branch May 26, 2026 14:32
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.

3 participants