{% extends "base.html" %}
{% load static %}
{% block title %}Create Category{% endblock %}
{% block extra_css %}{% endblock %}
{% block content %}
<div class="container mt-4">
    <h2>Create Category</h2>
    <form method="post" enctype="multipart/form-data" class="row g-3">
        {% csrf_token %}
        <div class="col-md-6">
            <label for="parent_id" class="form-label">Parent Category</label>
            <select name="parent_id" id="parent_id" class="form-select">
                <option value="">Select a Category</option>
                {% for parent in parents %}
                    <option value="{{ parent.id }}">{{ parent.name }}</option>
                {% endfor %}
            </select>
        </div>
        <div class="col-md-6">
            <label for="name" class="form-label">Name</label>
            <input type="text" class="form-control" id="name" name="name">
        </div>
        <div class="col-md-6">
            <label for="status" class="form-label">Status</label>
            <select class="form-select" id="status" name="status">
                <option value="active">Active</option>
                <option value="inactive">Inactive</option>
            </select>
        </div>
        <div class="col-12">
            <label for="description" class="form-label">Description</label>
            <textarea class="form-control" id="description" name="description" rows="3"></textarea>
        </div>

        <div class="col-12">
            <label for="image" class="form-label">Image</label>
            <input type="file" class="form-control" id="image" name="image">
        </div>
        <div class="col-12">
            <button type="submit" class="btn btn-primary">Create Category</button>
            <a href="{% url 'category-management' %}" class="btn btn-secondary">Back</a>
        </div>
    </form>
</div>
{% endblock %}
{% block extra_js %}{% endblock %}
