{% extends 'layout/page.html' %}

{% block head_title %}
  {% trans %}List of messages{% endtrans %}
{% endblock %}

{% block page_header %}
  {% trans %}List of messages{% endtrans %}
{% endblock %}

{% block content %}

  {% for msg in context.list() %}
    <div>
      <dl class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
        <div class="col row">
          <dt class="col col-auto">{% trans %}Author{% endtrans %}</dt>
          <dd class="col col-auto">{{ msg.author.plain()|u }}</dd>
        </div>
        <div class="col row">
          <dt class="col col-auto">{% trans %}Date{% endtrans %}</dt>
          <dd class="col col-auto">{{ msg.date.plain()|u }}</dd>
        </div>
        <div class="col row">
          <dt class="col col-auto">{% trans %}Message id{% endtrans %}</dt>
          <dd class="col col-auto">{{ msg.id }}</dd>
        </div>
      </dl>
      <div>
      {% if msg.type == 'text/markdown' %}
        <div class="msg">{{ msg.content.markdown()|u|safe }}</div>
      {% elif msg.type == 'text/x-rst' %}
        <div class="msg">{{ msg.content.rst()|u|safe }}</div>
      {% else %}
        <pre class="msg">{{ msg.content.hyperlinked()|u|safe }}</pre>
      {% endif %}
      </div>
    </div>
    <hr>
  {% endfor %}

{% endblock %}
