You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 796B

123456789101112131415161718192021222324
  1. {% extends "layout.html" %} {% block content %} {% if logged_in %}
  2. <h1 class="heading">New Post</h1>
  3. <form class="form" method="POST" action="/posts">
  4. <input type="hidden" name="id" />
  5. <input type="hidden" name="date" />
  6. <div class="form__field">
  7. <label for="title" class="form__label">Title</label>
  8. <input class="form__text-field" type="text" name="title" required />
  9. </div>
  10. <div class="form__field">
  11. <label for="body" class="form__label">Body</label>
  12. <textarea class="form__textarea" name="body" required></textarea>
  13. </div>
  14. <div class="form__field">
  15. <input class="btn" type="submit" value="Post" />
  16. </div>
  17. </form>
  18. {% endif %}
  19. <div class="posts">
  20. {% for post in posts %} {{ components::post(post=post, type="index") }} {%
  21. endfor %}
  22. </div>
  23. {% endblock %}