mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-10 03:14:58 -04:00
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user