{% load static %}
{% include 'dashboard/admin_dashboard/header.html' %}
{% include 'dashboard/admin_dashboard/body.html' %}
<!-- Right side column. Contains the navbar and content of the page -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div style="padding: 10px;">
      {% if messages %}
          {% for message in messages %}
          <div class="alert {% if 'success' in message.tags %}alert-success{% elif 'danger' in message.tags %}alert-danger{% endif %}" role="alert" id="success-alert">
  <!--                            <div class="alert alert-success" role="alert" id="success-alert">-->
              {{message}}
              <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
              </button>
          </div>
          {% endfor %}
      {% endif %}
    </div>
    <section class="content-header text-center">
      <h1>
        Edit  Area
        <small>Control panel</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Edit  Area</li>
      </ol>
    </section>
    <section class="content">
    <!-- Small boxes (Stat box) -->
        <div class="row">
            <div class="col-lg-6 col-lg-offset-3">
                <!-- general form elements -->
                <div class="box box-primary">
                  <div class="box-header">
                    <h3 class="box-title">Edit Area</h3>
                  </div><!-- /.box-header -->
                  <!-- form start -->
                  <form role="form" method="POST" enctype="multipart/form-data" action="">
                    {% csrf_token %}
                    <div class="box-body">
                        <div class="form-group">
                            <label>Area Code</label>
                            <input type="text" name="area_code" class="form-control" value="{{all_areas.area_code}}" required="" >
                        </div>

                        <div class="form-group">
                            <label>Area Name</label>
                            <input type="text" name="area_name" class="form-control" value="{{all_areas.area_name}}" required="" >
                        </div>

                        <div class="form-group">
                            <label>Location</label>
                            <select name="location_id" id="country-dropdown" class="form-control" required="">
                              <option value="">-- Select Location --</option>
                              {% for all_location in location %}
                                    <option value="{{ all_location.id }}" {% if all_areas.location_id == all_location.id %} selected {% endif %}>{{ all_location.location_name }}</option>
                              {% endfor %}
                            </select>
                        </div>
                    </div>

                    <div class="box-footer">
                      <button type="submit" class="btn btn-primary">Submit</button>
                    </div>
                  </form>
                </div><!-- /.box -->


              </div>
            </div>   <!-- /.row -->
        </div>
    </section>
</div>
{% include 'dashboard/visitors_dashboard/footer.html' %}
