Adds datefield support with flatpickr #88
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #72
I should have commited more …
Well, I'll quickly explain what this PR does.
forms.py
Same as in #86 but with an additional css class for date questions. This is required for the javascript library to run on the respective input fields.
question.py
Same as in #86.
survey_detaily.py
I didn't want to do these checks inside the template(s), so I introduced a new context variable that can be used to control asset loading, because I think, it is a nice feature to only load flatpickr js and css if it is really required on the current page.
Templates
Asset loading and some indentation fixes.
Note that I also added two new static files. In order to commit them, I had to disable the pre-commit hook, but I ran the tests and flake before.
Also, the same "problem" as in #86 regarding the translation exists, because I didn't understand yet, what you did there. :)