{% extends 'ocp_project_plugin/ocp_project/base.html' %}
{% load helpers %}
{% load render_table from django_tables2 %}

{% block content %}
<div class="row">
    <div class="col">
        <div class="card">
            <h5 class="card-header">OCP Project</h5>
            <div class="card-body">
                <table class="table table-hover attr-table">
                    <tr>
                        <th scope="row">Name</th>
                        <td>{{ object.name }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Description</th>
                        <td>{{ object.description }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Display Name</th>
                        <td>{{ object.display_name }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Project Owner</th>
                        <td>{{ object.owner|linkify|placeholder }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Contact E-Mail</th>
                        <td>{{ object.contact|linkify|placeholder }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Customer</th>
                        <td>{{ object.customer|linkify|placeholder }}</td>
                    </tr>
                    <tr>
                        <th scope="row">URL</th>
                        <td><a href="{{ object.docu_url }}">{{ object.docu_url }}</a></td>
                    </tr>
                    <tr>
                        <th scope="row">Workload</th>
                        <td>{{ object.workload }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Request</th>
                        <td>{{ object.request }}</td>
                    </tr>
                </table>
            </div>
        </div>
        {% include 'inc/panels/custom_fields.html' %}
    </div>

    <div class="col col-md-12">
        <div class="card">
            <h5 class="card-header">App Environments</h5>
            <div class="card-body table-responsive">
                {% render_table assignments_table 'inc/table.html' %}
                {% include 'inc/paginator.html' with paginator=assignments_table.paginator page=assignments_table.page %}
            </div>
            {% if perms.ipam.add_service %}
                <div class="card-footer text-end noprint">
                    <a href="{% url 'plugins:ocp_project_plugin:appenvironment_add' %}?ocp_project={{ object.pk }}" class="btn btn-sm btn-primary">
                        <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add App Environment
                    </a>
                </div>
            {% endif %}
        </div>
    </div>
{% endblock %}
</div>