{#- An event: when and where first, who posted it, then what it is and where to read more, its files; where it is discussed, or starting the discussion; adding it to one's own calendar in sight; copying its link behind ⋮, and changing and deleting it, for who posted it and the community's managers; the other events to come beside it. Drawn in `mockups/templates/event.html`. -#} {% extends "ads_community.html" %} {% import "calendar/_events.html" as ev with context %} {% set kw = {"community_id": g.community.slug} %} {% block page_title %}{{ event.title }} · {{ _("Calendar") }} · {{ g.community.name }}{% endblock %} {% block overlays %} {% if may_change %}
{{ csrf.field() }}

{{ _("Delete “%(title)s”?", title=event.title) }}

{{ _("It goes from the community's calendar. This cannot be undone.") }}
{% endif %} {% endblock %} {% macro copy_link(classes) -%} {%- endmacro %} {% block content %}
{{ ev.date_tile(event.start) }}
  1. {{ _("Calendar") }}

{{ event.title }}

{{ icon("calendar-plus") }}{{ _("Add to my calendar") }} {#- Copying the link shows only where the browser lets a page write the clipboard: beside the other actions for who may change the event, alone for the others, whose menu would otherwise open empty. -#} {% if may_change %}
{{ icon("dots-vertical") }}
{{ copy_link("ads-menu__item") }} {{ icon("pencil") }}{{ _("Edit") }}
{% else %}{{ copy_link("ads-btn ads-btn--ghost") }}{% endif %}
{{ icon("clock") }}{{ _("When") }}
{{ ev.first_up(event.start | dateformat("full", rebase=false)) }}, {{ ev.hours(event) }}
{% if event.location %}
{{ icon("pin") }}{{ _("Where") }}
{{ event.location }}
{% endif %} {% if event.creator %}
{{ icon("user") }}{{ _("Posted by") }}
{{ m.avatar(event.creator, "ads-avatar--xs") }}{{ event.creator.name }}
{% endif %}
{#- Sanitised when saved (`calendar/forms.py`). -#}
{{ event.description | safe }}
{#- A link only to the web: an address typed in may be anything. -#} {% if event.url %}

{{ _("More information") }}: {% if event.url.startswith(("http://", "https://")) %}{{ event.url }}{% else %}{{ event.url }}{% endif %}

{% endif %} {% for attachment in event.attachments %}
{{ file_icon(attachment.name) }}{{ attachment.name }}{{ attachment.content_length | filesize }}
{% endfor %}
{#- Where it is discussed: a thread of the forum, started from here. -#} {% if event.thread %}
{{ icon("message-circle") }}{{ _("Discussed in") }} {{ event.thread.title }}
{% elif discuss_url %} {% endif %}
{% endblock %}