{# Renders all the signed and next-to-be signed signoffs for the approval instance #}
{% load signoff_tags %}

<div class="signoffs approval">
    <div class="panel panel-{{ approval.status.get_css_class }}">
        <div class="panel-heading">
            {{ approval.label }}
            {% if show_status_message %}
                <span class="status-msg label label-{{ approval.status.get_css_class }}">
                    {{ approval.status.get_label }}
                </span>
            {% endif %}
        </div>
        <!-- List group -->
        <ul class="list-group">
            {% for signoff in approval.signoffs.all %}
                <li class="list-group-item">
                    {% render_approval_signoff approval signoff %}
                </li>
            {% endfor %}
        </ul>
        {% with signoffs=approval|next_signoffs_for_user:request_user %}
            {% if signoffs and render_signoff_forms %}
                <div class="panel-footer">
                    <h5>
                        {{ approval.label }} {{ request_user.get_full_name }}
                    </h5>
                    {% for signoff in signoffs %}
                        {% render_signoff signoff %}
                    {% endfor %}
                </div>
            {% endif %}
        {% endwith %}
    </div>
</div>
