{% extends 'messages/master.twig' %} {% from 'macros.twig' import avatar, container_title %} {% from '_layout/input.twig' import input_hidden, input_text, input_select %} {% set title = 'Viewing message' %} {% set canonical_url = url('messages-view', { message: message.info.id }) %} {% block messages_content %}
{{ container_title(' Actions') }}
{% if reply_to is defined and reply_to is not empty %} {% endif %} {% if can_send_messages %} {% set has_draft_info = draft_info is defined and draft_info is not null %} {% set reply_field_is_draft = false %} {% if not has_draft_info and not message.info.isSent %} {% set has_draft_info = true %} {% set reply_field_is_draft = true %} {% set draft_info = message.info %} {% endif %} {% set msg_author_id = message.info.authorId|default(0) %} {% set msg_recipient_id = message.info.recipientId|default(0) %} {% if has_draft_info or (msg_author_id > 0 and msg_recipient_id > 0) %}
{{ container_title(has_draft_info ? ' Edit' : ' Reply') }}
{% if has_draft_info %} {{ input_hidden('message', draft_info.id) }} {% else %} {{ input_hidden('reply', message.info.id) }} {{ input_hidden('recipient', self_info.id == msg_author_id ? msg_recipient_id : msg_author_id) }} {% endif %}
{{ input_text('title', 'messages-reply-subject-input', draft_info.title|default('%s%s'|format((message.info.title|slice(0, 4) == 'Re: ' ? '' : 'Re: '), message.info.title)), 'text', 'Subject', true) }}
{{ input_select('parser', constant('\\Misuzu\\Parsers\\Parser::NAMES'), draft_info.parser|default('1'), null, null, null, 'js-messages-reply-parser') }}
{% endif %} {% endif %} {% if replies_for is defined and replies_for is iterable %} {% for reply_for in replies_for %} {% endfor %} {% endif %}
{% endblock %}