2018-02-09 14:39:05 -08:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
|
|
|
|
{% block header %}
|
2024-09-17 08:18:19 +01:00
|
|
|
<h1>{% block title %}Today in history{% endblock %}</h1>
|
2018-02-09 14:39:05 -08:00
|
|
|
{% if g.user %}
|
|
|
|
|
<a class="action" href="{{ url_for('blog.create') }}">New</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
{% for post in posts %}
|
|
|
|
|
<article class="post">
|
|
|
|
|
<header>
|
|
|
|
|
<div>
|
|
|
|
|
<h1>{{ post['title'] }}</h1>
|
|
|
|
|
<div class="about">by {{ post['username'] }} on {{ post['created'].strftime('%Y-%m-%d') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% if g.user['id'] == post['author_id'] %}
|
|
|
|
|
<a class="action" href="{{ url_for('blog.update', id=post['id']) }}">Edit</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</header>
|
2024-09-17 07:45:24 +00:00
|
|
|
<p class="body">{{ post['body']|safe }}</p>
|
2018-02-09 14:39:05 -08:00
|
|
|
</article>
|
|
|
|
|
{% if not loop.last %}
|
|
|
|
|
<hr>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% endblock %}
|