-
Notifications
You must be signed in to change notification settings - Fork 18
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
Migrate to Bootstrap 4 #12
base: main
Are you sure you want to change the base?
Conversation
|
||
{% block page_content %} | ||
{% extends "base.html" %} {% block title %}Sirius - Admin{% endblock %} {% block | ||
page_content %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This formatting looks a little broken to me.... does Jinja allow a line break in a directive? Also, it would be much preferred to put the extends
directive on a new line, if at all possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jinja allows the line breaks, but Prettier is only parsing/formatting it as HTML. There's a(n open) ticket for Jinja support (prettier/prettier#5754), and a link to a Nunchuks based plugin (which is incomplete).
From what I can tell, any of the Python specific formatters (black, autopep8, yapf) won't touch the HTML part of Jinja, and Prettier won't do much to consider the Python parts (just format them as blobs). Given that there's more HTML than Python here, I'm more inclined to favour getting the HTML readable.
We could manually format the Jinja specific lines and throw in <!-- prettier-ignore -->
, but that might just be more trouble than it's worth?
I'll take a look at the Nunchucks plugin - it might have enough of the simple functionality to at least format the Jinja blocks sequentially, instead of a single line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks pretty good to me!
The ongoing modernisation of the project continues!
In order to bump some of the designs, I figured it made sense to bump us to the latest Bootstrap. Because of Computers™, that means swapping
Flask-Bootstrap
frombootstrap-flask
, and migrating a bunch of styles.I added prettier support for the HTML, though some of the support is a little quirky, because it's Jinja, not HTML. There's an open issue for full support, but I don't think it's a showstopper for now. I'll take "consistent and pretty good" over "perfect" formatting.
I also removed the "face" support in the preview screen since it wasn't actually being used.