Repository navigation
Add prettier-plugin-jinja-template - #3959
Conversation
|
Nice work, Danny! Please check the failing workflow. |
|
Worth noting that I see additional diff if I run Some of these errors (already closed html or tbody) feel off 🤔 |
|
I checked again As @mathjazz pointed out while were discussing this, I think the problem is that there's a macro opening the |
|
@flodolo You're right. The parser works by:
This means it's impossible to have separated opening/closing tags wrapped in a conditional (or macro) statement. It's also impossible to have tags partially generated by jinja (e.g. References: |
It seems like there's just 9 files with errors in total? Some of the errors seem legit, others I'd fix by changing the structure or excluding the lines from formatting. |
Yes, it was a mixed bag of errors (and fixes). I guess we should still file a bug to document the exceptions so ultimately we could fix them in a follow-up patch. It might even be a good-first-bug. |
|
In case, given how large the PR is I think it makes sense to keep those in a separate follow-up PR, as they require more work and better review. |
| } | ||
| </style> | ||
| </head> | ||
| {% block extend_css %}{% endblock %} |
There was a problem hiding this comment.
Actual fix (I think that's correct, and the block should be outside <style>).
| {% set ids = notification.ids %} | ||
| {% set msg = notification.msg %} | ||
| <li><a href="{{ full_url('pontoon.translate', locale.code, project.slug, 'all-resources') }}?list={{ ids }}">{{ | ||
| project.name }} ({{ locale.code }})</a>: {{ msg }}</a></li> |
There was a problem hiding this comment.
Actually, I think the link should be on the first part, not also on message.
| >{{ translation.locale.name }}</span | ||
| > | ||
| <span class="divider">•</span> | ||
| <span class="translation-locale-code">{{ translation.locale.code }}</a> |
|
Unfortunately the UI with this branch is quite broken (projects, teams, contributors, tags within a project). |
|
Heads-up: I'm going to push a fix for the broken templates, so that we can gain a few hours for testing. |
| <div class="total"> | ||
| <span>All strings</span> | ||
| <p>{{ contributor.translations_count|intcomma }}</p> | ||
| </div><div class="approved"> |
| <div | ||
| id="notifications" | ||
| class="notifications select{% if unread_count %}unread{% endif %}" | ||
| class="notifications select {% if unread_count %}unread{% endif %}" |
|
The latest version is deployed on DEV: https://pontoon.allizom.org/ |
Did you mean top right? |
I think we were relying on the lack of space between the two elements, used a negative margin (no clue if there's a better way). I'll push the update to DEV server once the image is available. |
No. Updated the screenshot. |
Thanks. I don't see that on DEV. Do you still see it? |
|
It's fixed now. Translation column in the seach page still breaks into the new line, though: (we should use I tested more (hopefully all) pages now, and these look different than on prod. Mostly it's the alignment of the right-most table header that is different. On the Premissions page entries for all projects are visible (even if not used). https://pontoon.allizom.org/de/bugs/ |
|
Haven't pushed yet to DEV, but the light-bulb in the table header is still broken on pontoon.allizom.org/sl/amo |
|
Not sure why https://pontoon.allizom.org/it/firefox/ looks so broken now (it works fine for me locally) EDIT: that's because I don't have priority set on resources… |
|
I've checked with classes with directives, and couldn't find any more where the space was lost. @mathjazz |
|
Nice work! The only think that's off now is the table header appearing on https://pontoon.allizom.org/search/ even before you search. |
Tested locally, not pushing to DEV again. |
|
Thanks @flodolo for the help! |
|
Currently on DEV, clicking the notification bell in translate view crashes the front-end. What's weird is that it works just fine for me locally. |
|
The crash on DEV is unrelated. |
|
Since I did a bit of back and forth on some parts, I reorganized the commits (@dannycolin work in one, my follow-up in a separate one) and rebased. If we end up having to rebase this again, that should make things a bit easier. |
Signed-off-by: Danny Colin <contact@dannycolin.com>
mathjazz
left a comment
There was a problem hiding this comment.
Thanks for the hard work to both of you.
Especially to @dannycolin for taking this to the finish line and first contribution to Pontoon. Well done! 🥳
|
As agreed with @flodolo, let's merge this and put it to the DEV server for a day or two before shipping to prod. |
|
Thanks @dannycolin, this makes life easier :) |










Add a prettier parser for Pontoon jinja templates.