123456789101112131415161718192021222324252627282930313233343536373839 |
- {% extends 'layout.html.j2' %}
- {% block content %}
- {% set action = url_for('update_post', post_id = post.id) if post else url_for('create_post') %}
- <form method="POST" action="{{ action }}" class="form">
- <h3 class="heading">
- {{ "edit post" if post else "new post" }}
- </h3>
- <div class="form__fields">
- <div class="form__field">
- <label class="form__label">{{ form.title.label }}</label>
- {{ form.title(class="form__text-field") }}
- </div>
- <div class="form__field">
- <label class="form__label">{{ form.slug.label }}</label>
- {{ form.slug(class="form__text-field") }}
- </div>
- <div class="form__field">
- <label class="form__label">{{ form.date.label }}</label>
- {{ form.date(class="form__date-field") }}
- </div>
- <div class="form__field">
- <label class="form__label">{{ form.content.label }}</label>
- {{ form.content(class="form__textarea", rows=10) }}
- </div>
- <div class="form__field form__field--submit">
- <input type="submit" value="Submit" class="form__submit button">
- </div>
- </div>
-
- {% if show_markdown_preview %}
- <div class="form__preview">
- <h3 class="heading">
- Preview
- </h3>
- <iframe src="about:blank" width="100%"></iframe>
- </div>
- {% endif %}
- </form>
- {% endblock %}
|