Display image in edit post form

This commit is contained in:
Emmanuelle Helly 2018-10-05 14:27:03 +02:00
parent a86c967ae7
commit 979eb8d972
2 changed files with 3 additions and 2 deletions

View File

@ -118,7 +118,7 @@ def save_post(category, timestamp, admin, form, files):
filename = secure_filename(post_image.filename)
post_image.save(str(post.parent / filename))
element = ElementTree.SubElement(tree, 'image')
element.text = str(post.parent / filename)
element.text = filename
element = ElementTree.SubElement(tree, STATE_PUBLISHED)
element.text = email.utils.formatdate(

View File

@ -30,7 +30,8 @@
<label>Description
<textarea name="summary">{{ post.summary }}</textarea>
</label>
<label>
<label>Image
<img alt="" src="{{ url_for('post_image', path=post._image) }}" />
<input name="image" id="image" type="file" value="{{ post.image }}" />
</label>
<label>Contenu de l'article