{% extends 'app/base.html' %} {% load static %} {% block title %} Address
{%endblock title %} {% block content %}

<div class="container my-5">
  <div class="row">
    <h3>
      Welcome
      <span class="text-capitalize">{{request.user}}</span>
    </h3>

    <div class="col-sm-2 border-end">
      <ul class="list-unstyled">
        <li class="d-grid">
          <a href="{% url 'profile' %}" class="btn">Profile</a
          ><a href="{% url 'address' %}" class="btn btn-primary">Address</a>
          <a href="{% url 'password_change' %}" class="btn">Change Password</a>
        </li>
      </ul>
    </div>

    <div class="col-sm-8 offset-sm-1">
        <div class="row">
            {% for ad in add reversed %}
            <div class="col-sm-6">
                <div class="card m-2">
                    <div class="card-body">
                        <h1>Address: {{forloop.counter}}</h1>
                        <div class="mb-1">Name: {{ad.name}}</div>
                        <div class="mb-1">Locality: {{ad.locality}}</div>
                        <div class="mb-1">City: {{ad.city}}</div>
                        <div class="mb-1">Mobile: {{ad.mobile}}</div>
                        <div class="mb-1">State: {{ad.state}}</div>
                        <div class="mb-1">Zipcode: {{ad.zipcode}}</div>
                        <div class="text-center mb-1">
                            <a type="button" class="btn btn-success " href="{% url 'updateAddress' pk=ad.id %}" >Update</a>
                        </div>
                    </div>
                </div>
              </div>
                {% empty %}
                <h1 class="text-center">It's Empty</h1>
            {% endfor %}
        </div>
    </div>
  </div>
</div>
{% endblock content %}