{% 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 Librarian</div>
          <div class="card-body">
            <form method="POST" action="{% url 'librarian_edit' id=librarian.id %}">
              {% csrf_token %}
              <div class="mb-3">
                <label for="id_name">Name:</label>
                <input type="text" name="name" id="id_name" value="{{ librarian.name }}" placeholder="Input Name" class="form-control" required>
              </div>
              
              <div class="mb-3">
                <label for="id_lastname">Last Name:</label>
                <input type="text" name="last_name" id="id_lastname" value="{{ librarian.last_name }}" placeholder="Last Name" class="form-control" required>
              </div>

              <div class="mb-3">
                <label for="id_address">Address:</label>
                <textarea type="text" name="address" id="id_address" value="{{ librarian.address }}" placeholder="Address" class="form-control" required></textarea>
                
              </div>

              <div class="mb-3">
                <label for="id_birthplace">Birth Place:</label>
                <input type="text" name="birth_place" id="id_lastname" value="{{ librarian.birth_place }}" placeholder="Birth Place" class="form-control" required>
              </div>

              <div class="mb-3">
                <label for="id_datebirth">Birth date:</label>
                <input type="date" name="date_birth" id="id_datebirth" value="{{ librarian.date_birth }}" placeholder="Birth Date" class="form-control" required>
                
              </div>

              <div class="mb-3">
                <!-- <label for="id_phone_number" class="form-label">Phone Number</label>
                <input type="tel" name="phone_number" id="id_phone_number" value="{{ librarian.phone_number }}" placeholder="Phone Number" class="form-control" required> -->
                {{form.phone_number}}
              </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</h2>
    <form method="post" action="{% url 'librarian_edit' id=librarian.id %}">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit" class="btn btn-primary">Save</button>
    </form>
</div> -->


{% endblock content%}