{% extends "portal/layout.html" %}
{% block content %}

    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading" style="padding-left: 8px;">binding templates</div>
        <div class="panel-body" style="padding-left: 8px;">
            host: <span class="green">{{ h.hostname }}</span>
        </div>

        <!-- Table -->
        <table class="table table-hover table-bordered table-striped" style="margin-bottom: 0px; margin-top: 0px;">
            <thead>
            <tr>
                <th>name</th>
                <th>parent</th>
                <th>creator</th>
            </tr>
            </thead>
            <tbody>
            {% for v in templates %}
                <tr>
                    <td>
                        <a target="_blank" href="{{ url_for('template_view_get', tpl_id=v.id) }}">{{ v.tpl_name }}</a>
                    </td>
                    <td>
                        {% if v.parent %}
                            <a target="_blank" href="{{ url_for('template_view_get', tpl_id=v.parent.id) }}">
                                {{ v.parent.tpl_name }}
                            </a>
                        {% endif %}
                    </td>
                    <td>{{ v.create_user }}</td>
                </tr>
            {% else %}
                <tr>
                    <td colspan="3">no records</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>

    </div>

    <button class="btn btn-default" onclick="history.go(-1);">
        <span class="glyphicon glyphicon-arrow-left"></span>
        Back
    </button>

{% endblock %}
