A flat-file CMS written in Python and Flask
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.

form.html.j2 1.0KB

12345678910111213141516171819202122232425262728
  1. {% extends 'layout.html.j2' %}
  2. {% block content %}
  3. {% set action = url_for('update_post', post_id = post.id) if post else url_for('create_post') %}
  4. <form method="POST" action="{{ action }}" class="form">
  5. <h3 class="heading">
  6. {{ "edit post" if post else "new post" }}
  7. </h3>
  8. <div class="form__field">
  9. <label class="form__label">{{ form.title.label }}</label>
  10. {{ form.title(class="form__text-field") }}
  11. </div>
  12. <div class="form__field">
  13. <label class="form__label">{{ form.slug.label }}</label>
  14. {{ form.slug(class="form__text-field") }}
  15. </div>
  16. <div class="form__field">
  17. <label class="form__label">{{ form.date.label }}</label>
  18. {{ form.date(class="form__date-field") }}
  19. </div>
  20. <div class="form__field">
  21. <label class="form__label">{{ form.content.label }}</label>
  22. {{ form.content(class="form__textarea", rows=10) }}
  23. </div>
  24. <div class="form__field">
  25. <input type="submit" value="Submit" class="form__submit">
  26. </div>
  27. </form>
  28. {% endblock %}