{#- Admin form to add or edit an event. typed holds what a refused save sent, when the view shows the form again with the reason flashed above it, so the fields keep what was typed instead of what is stored. Without it the fields show the stored event. Slot for features that build on events: events.admin.form.fields called with hook(event), where event is None on create; extra fields after Kind. On a POST the form is a refused save shown again, and a field reads what was sent from request.form. -#} {% extends "base_template.html" %} {%- set typed = typed if typed is defined else none %} {%- macro shown(name, stored) -%} {{ typed.get(name, '') if typed is not none else stored }} {%- endmacro %} {% block title %}{{ 'Edit event' if event else 'Add event' }}{% endblock %} {% block content %}