{% extends 'nautobot_version_control/pull_request/base.html' %}
{% load buttons %}
{% load custom_links %}
{% load helpers %}
{% load plugins %}
{% load static %}
{% load render_table from django_tables2 %}

{% block content %}
    <div class="row">
        <div class="col-md-12">
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="details">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <strong>{{ object.summary_description|placeholder }}</strong>
                                </div>
                                <table class="table table-hover panel-body attr-table">
                                    <tr>
                                        <td>Description</td>
                                        <td>{{ object.description|placeholder }}</td>
                                    </tr>
                                    <tr>
                                        <td>Source Branch</td>
                                        <td>{{ object.source_branch|placeholder }}</td>
                                    </tr>
                                    <tr>
                                        <td>Destination Branch</td>
                                        <td>{{ object.destination_branch|placeholder }}</td>
                                    </tr>
                                    <tr>
                                        <td>Creator</td>
                                        <td>{{ object.creator|placeholder }}</td>
                                    </tr>
                                    <tr>
                                        <td>Created</td>
                                        <td>{{ object.created_at|placeholder }}</td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="col-md-3"></div>
                        <div class="col-md-3">
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <strong>Diff Summary</strong>
                                </div>
                                <div class="list-group">
                                    {% for obj_type in results %}
                                    <a href="#{{ obj_type.name|lower }}" class="row list-group-item">
                                        <div class="col-md-6 align-middle">{{ obj_type.name }}</div>
                                        <div class="col-md-6 text-right">
                                            <span class="label label-success">{{ obj_type.added }}</span>
                                            <span class="label label-warning">{{ obj_type.modified }}</span>
                                            <span class="label label-danger">{{ obj_type.removed }}</span>
                                            <span class="badge">{{ obj_type.table.page.paginator.count }}</span>
                                        </div>
                                    </a>
                                    {% endfor %}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                {% include 'nautobot_version_control/diffs.html' with results=results %}

            </div>
        </div>
    </div>
{% endblock %}
