Files
notifications-admin/app/main/views/styleguide.py
Chris Hill-Scott 0d86be0feb Don’t show styleguide on live environment
Its audience is people working on the product, not the end users.
2016-02-15 11:48:04 +00:00

30 lines
901 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, current_app, abort
from flask_wtf import Form
from wtforms import StringField, PasswordField, TextAreaField, FileField, validators
from app.main import main
@main.route('/_styleguide')
def styleguide():
if not current_app.config['SHOW_STYLEGUIDE']:
abort(404)
class FormExamples(Form):
username = StringField(u'Username')
password = PasswordField(u'Password', [validators.required()])
code = StringField('Enter code')
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
)