Add page to create new letter branding

This has a form with 3 fields - the file upload field, logo name, and an
optional logo domain. Logos need to be uploaded in `.svg` format and we
then convert this to `.png` format and upload both file types to S3 as
well as saving the letter branding details in the database.
This commit is contained in:
Katie Smith
2019-01-31 16:56:35 +00:00
parent 446b9ccbb2
commit 529d7df5f5
8 changed files with 545 additions and 4 deletions

View File

@@ -851,6 +851,21 @@ class ServiceUpdateEmailBranding(StripWhitespaceForm):
raise ValidationError('This field is required')
class SVGFileUpload(StripWhitespaceForm):
file = FileField_wtf(
'Upload an SVG logo',
validators=[
FileAllowed(['svg'], 'SVG Images only!'),
DataRequired(message="You need to upload a file to submit")
]
)
class ServiceLetterBrandingDetails(StripWhitespaceForm):
name = StringField('Name of brand', validators=[DataRequired()])
domain = GovernmentDomainField('Domain')
class PDFUploadForm(StripWhitespaceForm):
file = FileField_wtf(
'Upload a letter in PDF format to check if it fits in the printable area',