readthedocs / readthedocs/ext-theme
Replace internal form field tags/filters with django-widget-tweaks
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 12
- Forks
- 6
- Avg merge
- 13h 25m
- Merged PRs (30d)
- 1
Description
I just learned of this package: https://github.com/jazzband/django-widget-tweaks
It is a much more thorough and useful implementation compared to the internal tag/filter template helpers that I put together ^1. I use the internal helpers for altering the form and form fields at display time, for adding data-bind attributes and CSS classes. I've wanted to expand these patterns a little more too, but the widget-tweaks is exactly what I'd want to write.
The main blocker here is that most forms are displayed as {{ form | crispy }}. Using this package would involve rendering each field individually. The pattern I have now alters the field in place, so the rendering call doesn't change. This is probably a minor change, and can likely be a loop over the form fields.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading readthedocsext/theme/templatetags/ext_theme_tags.py at the linked helper implementation, then inspect the templates that currently render forms with {{ form | crispy }}. Trace how the internal helpers alter fields and identify the forms affected by individual field rendering. Done means the internal helpers are replaced with django-widget-tweaks while the existing form behavior remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100