{% load mailarchive_extra %}
{% load intranet_common %}
{% with message.get_parts as parts %}
{% with message.get_attachments as attachments%}
{% with parts|first as first_part %}
{% with first_part.subtype as subtype %}
{% include "mailarchive/message/attachments.html" %}
{% if message.is_translated %}
{% setvar "content" message.translated_content %}
{% else %}
{% setvar "content" first_part.content %}
{% endif %}
{% if subtype == "plain" or subtype == "calendar" %}
{{ content|text_quote|replace_links_text }}
{% else %}
{% with content|replace_links_html|sanitize as semiclean_content %}
{% replace_cids semiclean_content message.maillist.name message.mid attachments %}
{% endwith %}
{% endif %}