Add picture_16x9 attribute for Project

This image can be use as a source for Open Graph tags, as well as for
displaying a project thumbnail with a known (or at least expected)
aspect ratio.
This commit is contained in:
Francesco Siddi 2019-04-19 10:57:46 +02:00
parent 53eb9f30fd
commit 06f5bc8f01
2 changed files with 3 additions and 0 deletions

View File

@ -579,6 +579,8 @@ projects_schema = {
'picture_square': _file_embedded_schema,
# Header
'picture_header': _file_embedded_schema,
# Picture 16x9 (for Open Graph)
'picture_16x9': _file_embedded_schema,
'header_node': dict(
nullable=True,
**_node_embedded_schema

View File

@ -30,6 +30,7 @@ class ProjectForm(FlaskForm):
('deleted', 'Deleted')])
picture_header = FileSelectField('Picture header', file_format='image')
picture_square = FileSelectField('Picture square', file_format='image')
picture_16x9 = FileSelectField('Picture 16x9', file_format='image')
def validate(self):
rv = FlaskForm.validate(self)