{% extends cv_extends %}

{% load crud_views %}
{% load django_tables2 %}

{% block cv_content %}

    <h3>ViewSet</h3>

    <table>
        <tr>
            <th>Key</th>
            <th>Value</th>
        </tr>
        <tr>
            <td>
                Name
            </td>
            <td>
                {{ cv.name }}
            </td>
        </tr>
        <tr>
            <td>
                Prefix
            </td>
            <td>
                {{ cv.prefix }}
            </td>
        </tr>
        <tr>
            <td>
                app
            </td>
            <td>
                {{ cv.app }}
            </td>
        </tr>
        <tr>
            <td>
                pk
            </td>
            <td>
                {{ cv.pk }}
            </td>
        </tr>
        <tr>
            <td>
                pk_name
            </td>
            <td>
                {{ cv.pk_name }}
            </td>
        </tr>
        <tr>
            <td>
                parent
            </td>
            <td>
                {{ cv.parent }}
            </td>
        </tr>
    </table>

    <h3>ViewSet Permissions</h3>
    <table>
        <tr>
            <th>Permission</th>
            <th>Django Permission</th>
            <th>Access</th>
        </tr>
        {% for row in data %}
            <tr>
                <td>
                    {{ row.viewset }}
                </td>
                <td>
                    {{ row.django }}
                </td>
                <td>
                    {{ row.has_permission }}
                </td>
            </tr>
        {% endfor %}
    </table>

    <br>
    <hr><br>

    <h3>Views</h3>

    <br>

    {% for view_key, view in views.items %}

        <h4>{{ view_key }}</h4>

        <table>
            {% for section, section_data in view.items %}

                <tr>
                    <th colspan="2">{{ section }}</th>
                </tr>

                {% for key, value in section_data.items %}
                    <tr>
                        <td>{{ key }}</td>
                        <td>{{ value }}</td>
                    </tr>
                {% endfor %}
            {% endfor %}
        </table>

        <br>

    {% endfor %}


{% endblock cv_content %}


