Files
notifications-admin/app/main/views/styleguide.py
Chris Hill-Scott 4447af3fec Add custom file upload component
The default browser file upload control is difficult to style, but looks totally
out of place.

This commit replaces it with one that has a GOV.UK style button, as a first
step.

Based heavily on this example:
http://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/
2016-02-03 17:16:17 +00:00

26 lines
770 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from flask import render_template
from flask_wtf import Form
from wtforms import StringField, PasswordField, TextAreaField, FileField, validators
from app.main import main
@main.route('/_styleguide')
def styleguide():
class FormExamples(Form):
username = StringField(u'Username')
password = PasswordField(u'Password', [validators.required()])
message = TextAreaField(u'Message')
file_upload = FileField('Upload a CSV file to add your recipients details')
form = FormExamples()
form.message.data = "Your vehicle tax for ((registration number)) is due on ((date)). Renew online at www.gov.uk/vehicle-tax" # noqa
form.validate()
return render_template(
'views/styleguide.html',
form=form
)