{% extends 'base.html' %}
{% block content %}
<section class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">
        <div class="col-sm-6">
          <h1>Update Website Details</h1>
        </div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="{% url 'dashboard' %}">Home</a></li>
            <li class="breadcrumb-item active">Update Website Details</li>
          </ol>
        </div>
      </div>
    </div><!-- /.container-fluid -->
  </section>

  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <!-- left column -->
        <div class="col-md-12">
          <!-- jquery validation -->
          <div class="card card-primary">
            <div class="card-header">
              <h3 class="card-title">Update Website Details</h3>
            </div>
            <br>
            <!-- /.card-header -->
            {% if messages %}
            {% for message in messages %}
             {% if message.tags == 'error' %}
            <div class="alert alert-warning alert-dismissible fade show" role="alert">
            {{message}}
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
             </button>
              </div>
            {% endif %}
            {% endfor %}
            {% endif %}
               {% if messages %}
            {% for message in messages %}
             {% if message.tags == 'success' %}
            <div class="alert alert-warning alert-dismissible fade show" role="alert">
            {{message}}
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
             </button>
              </div>
            {% endif %}
            {% endfor %}
            {% endif %}
            <form method="POST" enctype="multipart/form-data"  action="">
                {% csrf_token %}
                {% for page in pages %}
              <div class="card-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">Page Title</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="pagetitle" value="{{page.pagetitle}}">
                        <input type="hidden" name="web_id" class="form-control" id="web_id" required="true" value="{{page.id}}">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label">Address</label>
                    <div class="col-sm-10">
                        <textarea class="form-control" name="address">{{page.address}}</textarea>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label">About Us</label>
                    <div class="col-sm-10">
                        <textarea class="form-control" name="aboutus">{{page.aboutus}}</textarea>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label">Mobile Number</label>
                    <div class="col-sm-10">
                      <input class="form-control" id="mobilenumber" maxlength="10" name="mobilenumber"  type="text" required="true" pattern="[0-9]+" value="{{page.mobilenumber}}">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label">Email</label>
                    <div class="col-sm-10">
                      <input class="form-control" id="email" name="email"  type="email" required="true" value="{{page.email}}">
                    </div>
                  </div>
               
              </div>{% endfor %}
              <!-- /.card-body -->
              <div class="card-footer">
                <button type="submit" class="btn btn-primary">Add</button>
              </div>
            </form>
          </div>
          <!-- /.card -->
          </div>
        <!--/.col (left) -->
        <!-- right column -->
        <div class="col-md-6">

        </div>
        <!--/.col (right) -->
      </div>
      <!-- /.row -->
    </div><!-- /.container-fluid -->
  </section>{% endblock %}