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

Update bootstrap 5 #1725

Merged
merged 7 commits into from
Dec 19, 2024
Merged

Update bootstrap 5 #1725

merged 7 commits into from
Dec 19, 2024

Conversation

dchiller
Copy link
Contributor

@dchiller dchiller commented Dec 6, 2024

Updates the version of Bootstrap used in CantusDB to Bootstrap 5. Closes #1462.

This PR touches many many files, but most of those changes are cosmetic and/or involve replacing deprecated Bootstrap classes with new ones. I suspect the best way to review is going to be to pull this branch and walk through pages locally. Note: static files must be refreshed!

A few other minor additions to this PR:

  • all custom stylings were moved to a single static .css file
  • all templates were reformatted using djlint
  • the docker-compose-development.yml file was rewritten to not require a pin for debugging with runserver_plus. Since this command is only ever run locally, we don't need the security of a pin.
  • in the course of this upgrade, I observed that many of our tests that involve checking whether some string appears in rendered templates depend on spacing and other html formatting of the django templates. I'm skeptical of these kinds of checks in general, but at the very least, they shouldn't fail if there's an added or removed new line in a django template. To that end, I've written a custom mixin that provides a new assertion, assertParsedContains, that maps closely to Django's assertContains method, but, by parsing the html, is more robust to these types of changes to html that do not impact rendered html. The additional of BeautifulSoup and lxml dev dependencies are used for this assertion; however, no production dependencies are added!

Also closes #1721.

Add test mix-in to support formatted templates.
A request object is not sent to the `BadRequest` exception, so we check whether such an object exists before trying to render the `400.html` template.
@dchiller dchiller marked this pull request as ready for review December 9, 2024 16:17
@lucasmarchd01
Copy link
Contributor

lucasmarchd01 commented Dec 17, 2024

Screenshot 2024-12-17 at 3 56 03 PM

When I pull the branch and collect static pages it looks like this. Is that what you're seeing as well?

@dchiller
Copy link
Contributor Author

dchiller commented Dec 17, 2024

Hmm...that's not what I have. Here's what I get:

image

Try doing a hard refresh of the page?

Edit: When you look at those links on the side in the developer tools, where is the styling coming from? For example, there should be color styles coming from style.css... but those don't seem to be applied here. Is style.css downloaded by your browser?

@lucasmarchd01
Copy link
Contributor

Hard refresh fixed it! Not sure what was going on, but the css styling was fixed as well.

@dchiller dchiller merged commit 8c751fc into DDMAL:develop Dec 19, 2024
1 check passed
@dchiller dchiller deleted the update-bootstrap-5 branch December 19, 2024 15:33
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.

Bootstrap and DAL jqueries conflict Bootstrap 4 is EOL
2 participants