{% extends 'base.html' %}

{% block title %}Edit Resource - LMS{% endblock %}

{% block content %}
<div class="container mt-4">
    <div class="row">
        <div class="col-md-8 mx-auto">
            <div class="card shadow-sm">
                <div class="card-header bg-warning text-dark">
                    <h3 class="mb-0"><i class="fas fa-edit"></i> Edit Resource</h3>
                </div>
                <div class="card-body">
                  <form method="post" enctype="multipart/form-data">
                    {% csrf_token %}
                    {% for field in form %}
                        <div class="mb-3">
                            {{ field.label_tag }}
                            {{ field }}
                            {% if field.help_text %}
                                <div class="form-text">{{ field.help_text }}</div>
                            {% endif %}
                            {% for error in field.errors %}
                                <div class="text-danger small">{{ error }}</div>
                            {% endfor %}
                        </div>
                    {% endfor %}
    <button type="submit" class="btn btn-primary">Save</button>
</form>

                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
