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

Adds datefield support with flatpickr #88

Merged
merged 4 commits into from
Mar 7, 2020

Conversation

saschalalala
Copy link

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. :)

Copy link
Owner

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! In order to fix the translation, you can launch the tests locally with python manage.py test. It launches a normalized makemessages that you could launch yourself and that is probably defined somewhere in the readme.md. Then you use git add survey/ -p and add everything except the changed date in the .po file. (The changed date is nice in theory, but in reality always just make the rebase nastier)

Copy link
Owner

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good work, thank you !

@Pierre-Sassoulas Pierre-Sassoulas merged commit 6b42a1a into Pierre-Sassoulas:master Mar 7, 2020
@saschalalala saschalalala deleted the date-field branch March 7, 2020 22:10
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.

User needs to be able to submit a date
2 participants