Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.html 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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="form__button" type="submit" value="Post" />
  16. </div>
  17. </form>
  18. {% endif %}
  19. <div class="posts">
  20. {% for post in posts %}
  21. <div class="posts__post post">
  22. <h3 class="post__heading">
  23. <div class="post__links">
  24. <a class="post__link" href="/posts/{{ post.id }}">view</a>
  25. {% if logged_in %}
  26. <a class="post__link" href="/posts/{{ post.id }}/edit">edit</a>
  27. {% endif %}
  28. </div>
  29. <span class="post__title">
  30. {{ post.title }} :: {{ post.date }}
  31. </span>
  32. </h3>
  33. <div class="post__body">
  34. {{ post.body | safe }}
  35. </div>
  36. </div>
  37. {% endfor %}
  38. </div>
  39. {% endblock %}