{% extends 'base.html' %}
{% block title %}{{ model_name }} List | {{ app_name|capfirst }}{% endblock %}
{% block content %}
<div class="row">
  <div class="col-12">
    <h1 class="mb-4">{{ model_name }} List</h1>
    <a class="btn btn-success mb-3" href="{% url '<< urls["create"] >>' %}">
      <i class="fas fa-plus-circle me-1"></i>
      <span>Create New {{ model_name }}</span>
    </a>
    <ul class="list-group">
      {% for object in object_list %}
      <li class="list-group-item d-flex justify-content-between align-items-center">
        <span>{{ object.name }}</span>
        <div>
          <a class="btn btn-sm btn-primary me-2" href="{% url '<< urls["update"] >>' object.pk %}">
            <i class="fas fa-edit me-1"></i> Edit
          </a>
          <a class="btn btn-sm btn-danger" href="{% url '<< urls["delete"] >>' object.pk %}">
            <i class="fas fa-trash-alt me-1"></i> Delete
          </a>
        </div>
      </li>
      {% empty %}
      <li class="list-group-item">No items found.</li>
      {% endfor %}
    </ul>
  </div>
</div>
{% endblock %}
