{% extends 'index.html' %}
{% load static %}
{% load crispy_forms_tags %}

{% block content %}
<div class="container w-50 justify-content-center bg-light border rounded">
    <div class="py-4 text-center">
        <h2>{% if form.instance.pk %}Edit A Sub-Category{% else %}Add A Sub-Category{% endif %}</h2>
    </div>
    <div>
        <form method="post">
            {% csrf_token %}
            {{ form|crispy}}
            <button type="submit" class="btn btn-primary">Save</button>
            <a href="{% url 'sub_category_list' %}" class="btn btn-secondary">Cancel</a>
        </form>
    </div>
</div>
{% endblock %}
