{% extends 'adminapp/master.html' %}
{% load static %}
{% block content %}


    <div class="pagetitle">
      <h1>UPDATE </h1>
      <nav>
      </nav>
    </div><!-- End Page Title -->

    <section class="section">
      <div class="row">
        <div class="col-lg-6">

          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Bike Update Form</h5>

              <!-- General Form Elements -->
              <form method="post">
                {% csrf_token %}
                <div class="mb-3">
                    <label class="form-label"> Code</label>
                    <input type="number" name="code" value="{{data.code}}" class="form-control" >
                </div>
                <div class="mb-3">
                  <label class="form-label">Category</label>
                  <select class="form-control" aria-label="Default select example" name="category" required>
                    <option value="" >select Category</option>
                    {% for ab in category %}
                    <option value="{{ab.id}}" {% if data.category == ab %} selected {% endif %}>{{ab.name}}</option>
                    {% endfor %}
                  </select>
                </div>
        
                <div class="mb-3">
                  <label class="form-label">Station</label>
                  <select class="form-control" aria-label="Default select example" name="station" required>
                    <option value="" >select station</option>
                    {% for a in station %}
                    <option value="{{a.id}}" {% if data.station == a %} selected {% endif %}>{{a.location}}</option>
                    {% endfor %}
                  </select>
                </div>
    
                <div class="mb-3">
                    <label class="form-label"> Model</label>
                    <input type="text" name="model"  value="{{data.model}}" class="form-control">
                </div>
                <div class="mb-3">
                    <label class="form-label">Price (₹)</label>
                    <input type="number" name="price" value="{{data.price}}" class="form-control">
                </div>
                <div class="mb-3">
                    <label class="form-label">Image</label>
                    <input type="file" name="image"  value="{{data.image}}" class="form-control">
                </div>
                <div class="row mb-3">
                  <label class="col-sm-2 col-form-label"></label>
                  <div class="col-sm-10">
                    <button type="submit" class="btn btn-primary">Submit</button>
                  </div>
                </div>              
        
                </div>

              </form><!-- End General Form Elements -->

            </div>
          </div>

        </div>

        
      </div>
    </section>


  {% endblock %}