This commit is contained in:
Punnamaraju Vinayaka Tejas 2023-07-28 19:47:32 +05:30
parent 57df913a2c
commit 00f7c1de33
3 changed files with 34 additions and 4 deletions

View file

@ -12,14 +12,13 @@
<article class="post">
<header>
<div>
<h1>{{ post['title'] }}</h1>
<h1><a href="{{ url_for('blog.post', id=post['id']) }}">{{ post['title'] }}</a></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 %}
<a href="{{ url_for('blog.update', id=post['id']) }}">Edit</a>
{% endif %}
</header>
<p class="body">{{ post['body']|safe }}</p>
</article>
{% if not loop.last %}
<hr>

View file

@ -0,0 +1,20 @@
{% extends 'base.html' %}
{% block header %}
<h1>{% block title %}{{ post['title']}}{% endblock %}</h1>
{% endblock %}
{% block content %}
<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>
<p class="body">{{ post['body']|safe }}</p>
</article>
{% endblock %}