Password protection of admin pages, publish-switch and small fixes

This commit is contained in:
2017-05-24 12:09:02 +02:00
parent 149a5d4b24
commit c3b0ce9537
8 changed files with 67 additions and 30 deletions

View File

@@ -10,11 +10,13 @@ class PageForm(FlaskForm):
title = StringField('Title', validators=[DataRequired()])
description = TextAreaField('Beskrivning')
endpoint = BooleanField('Produkt')
published = BooleanField('Publicerad')
thumbnail = QuerySelectField('Bild', get_label=lambda p: '{} ({})'.format(p.alt, p.id))
photos = QuerySelectMultipleField('Galleri',
option_widget=widgets.CheckboxInput(),
widget=widgets.ListWidget(prefix_label=False),
get_label = lambda p: '<img src="/thumbnail/{}">'.format(p.id))
parent = QuerySelectField('Kategori', get_label = lambda p: '{} - {}'.format(p.permalink, p.title))
submit = SubmitField('Ok')
class PhotoForm(FlaskForm):