{% extends "base.html" %}
{% load legacy_filters %}
{% load tailwind_filters %}

{% block title %}
    {% if view.title %}
        {{ view.title }}
    {% else %}
        {{ view|class_name }}
    {% endif %}
{% endblock %}

{% block content %}
<div class="container mx-auto px-4 py-6">
    <h1 class="text-2xl font-bold mb-6">
        {% if view.title %}
            {{ view.title }}
        {% elif view|class_name == "CreateViewClass" %}
            Create {{ model_verbose_name }}
        {% else %}
            Update {{ model_verbose_name }}
        {% endif %}
    </h1>

    <!-- Render the Form -->
    <form method="post" enctype="multipart/form-data" >
        {% csrf_token %}
        <div>
          
        {{ form|crispy }}
        </div>
        <div class='mt-4'>
            <button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
                Save
            </button>
            <a href="{% url list_url_name %}" class="bg-gray-300 text-gray-800 px-4 py-2 rounded hover:bg-gray-400">
                Cancel
            </a>
        </div>
    </form>
</div>
{% endblock %}
