{% extends "gmail/email_view.html" if in_view else "base.html" %} {% from "icons.html" import icon %} {% set subject = messages[-1].subject if messages else "Email" %} {% block title %}{{ subject }} · {{ assistant }}{% endblock %} {% block main_class %}form{% endblock %} {% block content %} {# Over the details, forms answer with the email again rather than taking the page away. #} {% macro view_form(path) %}{% if in_view %} hx-post="{{ path }}" hx-target="#page-view"{% endif %}{% endmacro %} {# The subject and what to do with the email stay at the top while it scrolls. #}
Email · {{ account.email }}

{{ subject }}

{% if in_view %}{% else %}{% endif %}
{% if can_mark_read and messages | selectattr("unread") | list %}
{% endif %} {% if can_draft and messages %} {% endif %} {# Open in Gmail, Unsubscribe (when the email's text has such a link) and Show images: in the row on a wide screen, behind ⋮ on a phone so the buttons keep to one line (welcome.css hides the one not in use). Unsubscribe hides where it comes from with referrerpolicy, not rel=noreferrer: with that, an installed app on iOS first opens a blank page Safari calls an invalid address. #} {% macro more() %} {{ icon("external", 14) }}Open in Gmail {% if unsubscribe %}{{ icon("unsubscribe", 14) }}Unsubscribe{% endif %} {% if blocked_domains %}
{% for domain in blocked_domains %}{% endfor %}
{% elif not images and messages | selectattr("html") | rejectattr("images") | list %} {{ icon("image", 14) }}Show images {% endif %} {% endmacro %}
{% if marked_read %}
✓ DONEMarked as read.
{% endif %} {% if error %}{% endif %}
{% if not can_mark_read %}

To mark emails as read, draft replies or forward emails from myOrb, connect this Google account again in Integrations and allow it.

{% endif %} {% if invitation %} {# An invitation, as in Gmail: answered in the calendar it is in; Google tells the organizer. #}
{% if invitation.when %}
{{ invitation.when }}
{% endif %}
{{ invitation.title }}
{% if invitation.organizer %}
{{ invitation.organizer }} · Organizer
{% endif %} {% if invitation.guests %}
{{ invitation.guests | join(", ") }}{% if invitation.more_guests %} and {{ invitation.more_guests }} more{% endif %}
{% endif %}
{% if invitation.cancelled %}

This event was cancelled.

{% endif %} {% if invitation.clashes %}

▲ At the same time in your calendar: {{ invitation.clashes | join(", ") }}

{% endif %} {% if invitation.can_answer or invitation.url %}
{% if invitation.can_answer %} Going? {% for value, label in [("accepted", "Yes"), ("declined", "No"), ("tentative", "Maybe")] %} {% endfor %} {% endif %} {% if invitation.url %}{{ icon("external", 14) }}Open in Calendar{% endif %}
{% endif %} {% if invitation.needs_permission %}

To answer from myOrb, connect this Google account again in Integrations and allow changing the calendar.

{% endif %}
{% endif %} {% for message in messages %} {# The newest message is open; earlier ones of the conversation are folded, as in Gmail. #}
{{ message.sender }}{% if message.address and message.address != message.sender %} <{{ message.address }}>{% endif %} To {{ message.to }}{% if message.cc %} · Cc {{ message.cc }}{% endif %} {% if message.html %} {# No scripts; same origin only so the page can size the frame to its content. #} {% else %}
{{ message.text }}
{% endif %} {% if message.attachments %} {% endif %}
{% endfor %} {# Images are the last thing to decide on, after reading: below the conversation. #} {% if blocked_domains %} {# Remembered for the sender's domain: its next emails show their images too. #}
{% for domain in blocked_domains %}{% endfor %}
{% elif not images and messages | selectattr("html") | rejectattr("images") | list %}
Show images
{% endif %} {% if allowed_domains and not images %}
{% for domain in allowed_domains %}{% endfor %} Images from {{ allowed_domains | join(", ") }} are shown.
{% endif %} {% endblock %}