{% extends 'base.html' %}
{% block content%}

<!-- <div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6 mt-5">
            <div class="card">
            <div class="card-header bg-primary text-white">Edit Book Loan</div>
            <div class="card-body">
                <form method="post" action="{% url 'book_loan_edit' id=book_loan.id %}">
                {% csrf_token %}
                <div class="mb-3">
                    <label for="book_title">Book Title:</label>
                    <p>{{ book_loan.book.title }}</p>
                </div>
                <div class="mb-3">
                    <label for="member_name">Member Name:</label>
                    <p>{{ book_loan.member.name }}</p>
                </div>
                <div class="mb-3">
                    <label for="due_date">Due Date:</label>
                    <input type="date" name="due_date" id="due_date" value="{{ book_loan.due_date }}" class="form-control"required>
                </div>
                <div class="mb-3">
                    <label for="return_date">Return Date:</label>
                    <input type="date" name="return_date" id="return_date" value="{{ book_loan.return_date }}" class="form-control">
                </div>
                <div class="mb-3">
                    <label for="is_returned">Is Returned:</label>
                    <input type="checkbox" name="is_returned" id="is_returned" class="form-check-input" {% if book_loan.is_returned %}checked{% endif %}>
                </div>
                <button type="submit" class="btn btn-primary" role="button">Save Changes</button>
                </form>
            </div>
            </div>
        </div>
    </div>
</div> -->

<div style="text-align: center; margin-top: 50px;">
    <h2>Edit Book Loan</h2>
    <form method="post" action="{% url 'book_loan_edit' id=book_loan.id %}">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit" class="btn btn-primary col-1 mx-2">Save</button>
        <a class="btn btn-warning col-1 mx-2" href="{% url 'book_loan_list' %}" role="button">Back</a>
    </form>
</div>
  
{% endblock content %}
