{% if mrs %}
<figure>
<table class="sortable">
    <thead>
        <tr><th>ID</th><th>Title</th><th>Author</th><th>Branches</th><th>Comments</th><th>Status</th></tr>
    </thead>
    <tbody>
        {% for m in mrs %}
        {% set _mine_users = (state.usernames | default({})).values() | list %}
        {% set _involved = m.author in _mine_users or (m.assignees | default([]) | select("in", _mine_users) | list | length > 0) or (m.reviewers | default([]) | select("in", _mine_users) | list | length > 0) %}
        <tr class="{% if state and _involved %}row-mine{% endif %}">
            <td>!{{ m.iid }}</td>
            <td><a href="{{ m.web_url }}" target="_blank">{{ m.title }}</a></td>
            <td>{{ m.author }}</td>
            <td><code>{{ m.source_branch }}</code> &rarr; <code>{{ m.target_branch }}</code></td>
            <td>{{ m.user_notes_count or "" }}</td>
            <td><span class="badge-{% if m.approved %}approved{% else %}{{ m.state }}{% endif %}">{% if m.approved %}approved{% else %}{{ m.state }}{% endif %}</span></td>
        </tr>
        {% endfor %}
    </tbody>
</table>
</figure>
{% else %}
<p>No open MRs.</p>
{% endif %}
