mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-21 13:43:14 -04:00
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/
26 lines
770 B
Python
26 lines
770 B
Python
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
|
||
)
|