{#- Making an event, or changing one: its title, when it starts and ends (a time is suggested, the day left blank), where, a link to read more, what it is in rich text, its files. -#} {% extends "ads_community.html" %} {% import "forum/_post_fields.html" as fields %} {% set creating = not view.obj.id %} {% set kw = {"community_id": g.community.slug} %} {% block page_title %}{{ _("New event") if creating else view.obj.title }} · {{ _("Calendar") }} · {{ g.community.name }}{% endblock %} {#- The rich-text editor; no stylesheet comes with it. -#} {% block scripts %}{{ vite_asset("src/main.js") }}{{ vite_asset("src/editor.js") }}{% endblock %} {#- A date and a time under one name, as the field reads them back; a time not given yet is `suggested` (office hours), the day left to the person. -#} {% macro moment(field, label, suggested) %} {% set day, _sep, time = field._value().partition(" ") %}
{{ label }}
{{ fields.errors(field) }}
{% endmacro %} {% block content %}
{{ form.csrf_token }}

{{ _("New event") if creating else _("Edit event") }}

{{ fields.errors(form.title) }}
{{ moment(form.start, _("Starts"), "09:00") }} {{ moment(form.end, _("Ends"), "18:00") }}
{{ fields.errors(form.location) }}
{{ fields.errors(form.url) }}
{{ fields.message_field(form.description, _("What it is")) }} {{ m.files_field([] if creating else view.obj.attachments) }}
{{ _("Cancel") }}
{% endblock %}