A flat-file CMS written in Python and Flask
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

form.html.j2 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  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__fields">
  9. <div class="form__field">
  10. <label class="form__label">{{ form.title.label }}</label>
  11. {{ form.title(class="form__text-field") }}
  12. </div>
  13. <div class="form__field">
  14. <label class="form__label">{{ form.slug.label }}</label>
  15. {{ form.slug(class="form__text-field") }}
  16. </div>
  17. <div class="form__field">
  18. <label class="form__label">{{ form.date.label }}</label>
  19. {{ form.date(class="form__date-field") }}
  20. </div>
  21. <div class="form__field">
  22. <label class="form__label">{{ form.content.label }}</label>
  23. {{ form.content(class="form__textarea", rows=10) }}
  24. </div>
  25. <div class="form__field form__field--submit">
  26. <input type="submit" value="Submit" class="form__submit button">
  27. </div>
  28. </div>
  29. {% if show_markdown_preview %}
  30. <div class="form__preview">
  31. <h3 class="heading">
  32. Preview
  33. </h3>
  34. <iframe src="about:blank" width="100%"></iframe>
  35. </div>
  36. {% endif %}
  37. </form>
  38. {% endblock %}