aboutsummaryrefslogtreecommitdiffstats
path: root/templates/news/add.html
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2012-11-08 01:34:02 +0100
committerThibaut Horel <thibaut.horel@gmail.com>2012-11-08 01:34:02 +0100
commit101f820153cdb047d13166672d3f46cfef31677d (patch)
treecf1806735201f39a1b6b88d179ed16ce1b97ea4f /templates/news/add.html
parent9ab593bcd52fcbe87f1be463ca5f09a757d1128f (diff)
downloadfamille-flask-101f820153cdb047d13166672d3f46cfef31677d.tar.gz
Keep both rst and html rendered content in the database. News edit feature
Diffstat (limited to 'templates/news/add.html')
-rw-r--r--templates/news/add.html8
1 files changed, 6 insertions, 2 deletions
diff --git a/templates/news/add.html b/templates/news/add.html
index c2bc018..53fb682 100644
--- a/templates/news/add.html
+++ b/templates/news/add.html
@@ -1,9 +1,13 @@
{% extends 'layout.html' %}
{% block content %}
+{% if news %}
+<form action="{{ url_for('edit_news', news_id=news.id)}}" method="post">
+{% else %}
<form action="{{ url_for('add_news')}}" method="post">
- <input type=text size=80 name=title /><br/>
- <textarea name=content rows=20 cols=80></textarea>
+{% endif %}
+ <input type=text size=80 name=title value="{% if news %}{{news.title}}{% endif %}"/><br/>
+ <textarea name=content rows=20 cols=80>{% if news %}{{news.content}}{% endif %}</textarea>
<input type="submit" value="Submit" />
</form>
{% endblock %}