12345678910111213141516171819202122232425262728293031 |
- {% extends "layout.html" %} {% block content %}
- {% if logged_in %}
- <h1 class="heading">New Post</h1>
- <form class="form" method="POST" action="/posts">
- <input type="hidden" name="id" />
- <input type="hidden" name="date" />
- <div class="form__field">
- <label for="title" class="form__label">Title</label>
- <input class="form__text-field" type="text" name="title" required />
- </div>
- <div class="form__field">
- <label for="body" class="form__label">Body</label>
- <textarea class="form__textarea" name="body" required></textarea>
- </div>
- <div class="form__field">
- <input class="form__button" type="submit" value="Post" />
- </div>
- </form>
- {% endif %}
-
- <div class="posts">
- {% for post in posts %}
- <div class="posts__post post">
- <h3 class="post__heading">{{ post.title }} // {{ post.date }}</h3>
- <div class="post__body">
- {{ post.body | safe }}
- </div>
- </div>
- {% endfor %}
- </div>
- {% endblock %}
|