Added mini blogging application as Flask example.
This should become the tutorial.
This commit is contained in:
parent
2d9bb69272
commit
c33675f025
7 changed files with 241 additions and 0 deletions
21
examples/flaskr/templates/show_entries.html
Normal file
21
examples/flaskr/templates/show_entries.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
{% if g.logged_in %}
|
||||
<form action="{{ url_for('add_entry') }}" method=post class=add-entry>
|
||||
<dl>
|
||||
<dt>Title:
|
||||
<dd><input type=text size=30 name=title>
|
||||
<dt>Text:
|
||||
<dd><textarea name=text rows=5 cols=40></textarea>
|
||||
<dd><input type=submit value=Share>
|
||||
</dl>
|
||||
</form>
|
||||
{% endif %}
|
||||
<ul class=entries>
|
||||
{% for entry in entries %}
|
||||
<li><h2>{{ entry.title }}</h2>{{ entry.text|safe }}
|
||||
{% else %}
|
||||
<li><em>Unbelievable. No entries here so far</em>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue