{% extends 'FDPrivateMessageBundle::layout.html.twig' %}

{% trans_default_domain 'FDPrivateMessageBundle' %}

{% block fd_private_message_content %}

<h1>{{ conversation.subject }}</h1>

<a href="{{ url('fdpm_list_conversations') }}">{{ 'conversation.back' | trans }}</a>

<div>

    {% if conversation.recipients | length > 1 %}
        {{ 'conversation.recipients' | trans }} :

        {% for recipient in conversation.recipients %}
            {{ recipient.username }}
        {% endfor %}
    {% else %}
        {{ 'conversation.alone' | trans }}
    {% endif %}
</div>

<ul>
    {# A conversation MUST have messages #}
    {% for message in conversation.messages %}
        <li>
            <p>{{ message.author.username }}, {{ message.created | date('Y-m-d H:i:s') }}</p>
            <div>{{ message.body }}</div>
        </li>
    {% endfor %}
</ul>

{{ form_start(form) }}
    {{ form_widget(form) }}

    <input type="submit" value="{{ 'private_message.create.submit' | trans }}">
{{ form_end(form) }}
{% endblock %}

{% extends 'FDPrivateMessageBundle::layout.html.twig' %}

{% trans_default_domain 'FDPrivateMessageBundle' %}

{% block fd_private_message_content %}

<h1>{{ conversation.subject }}</h1>

<a href="{{ url('fdpm_list_conversations') }}">{{ 'conversation.back' | trans }}</a>
<a href="{{ url('fdpm_leave_conversation', {'conversation': conversation.id}) }}">{{ 'conversation.leave' | trans }}</a>

<div>

    {% if conversation.recipients | length > 1 %}
        {{ 'conversation.recipients' | trans }} :

        {% for recipient in conversation.recipients %}
            {{ recipient.username }}
        {% endfor %}
    {% else %}
        {{ 'conversation.alone' | trans }}
    {% endif %}
</div>

<ul>
    {# A conversation MUST have messages #}
    {% for message in conversation.messages %}
        <li>
            <p>{{ message.author.username }}, {{ message.created | date('Y-m-d H:i:s') }}</p>
            <div>{{ message.body }}</div>
        </li>
    {% endfor %}
</ul>

{{ form_start(form) }}
    {{ form_widget(form) }}

    <input type="submit" value="{{ 'private_message.create.submit' | trans }}">
{{ form_end(form) }}
{% endblock %}

Add link to leave conversation in main view
Add link to leave conversation in main view
