{% extends "dashboard/base.html" %}
{% load static icon lookup dashboard %}
{% block content %}
    {% include "dashboard/crud/breadcrumb.html" %}
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
    <div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
    <div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
        <table class="min-w-full divide-y divide-gray-200">
            <thead class="bg-gray-50">
            <tr>
                {% for field in view.fields %}
                    <th scope="col"
                        class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                        {{ field }}
                    </th>
                {% endfor %}
                <th scope="col" class="relative px-6 py-3 justify-end flex">
                    <span class="sr-only">Edit and Delete</span>
                    <a href="{% dashboard_url 'create' %}" class="bg-pc-600 border border-transparent rounded-md shadow-sm py-2 px-4 inline-flex justify-center text-sm font-medium text-white hover:bg-pc-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-pc-500">Create</a>
                </th>
            </tr>
            </thead>
            <tbody>
            {% for o in object_list %}
                <tr class="{% cycle 'bg-white' 'bg-gray-50' %}">
                    {% for field in view.fields %}
                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
                            {% render_field o field %}
                        </td>
                    {% endfor %}
                    <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium flex space-x-4 justify-end">
                        <a href="{% dashboard_url 'update' gid=o.gid %}" class="text-pc-600 hover:text-pc-900 flex">Edit</a>
                        <a href="{% dashboard_url 'delete' gid=o.gid %}" class="text-red-600 hover:text-red-900 flex">Delete</a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    </div>
</div>
{% endblock %}