
{% extends 'base/base.html' %}
{% block start %}

<section class="main_content dashboard_part large_header_bg">

<div class="main_content_iner ">
<div class="container-fluid p-0 sm_padding_15px">
<div class="row justify-content-center">
<div class="col-lg-12">
<div class="white_card card_height_100 mb_30">
<div class="white_card_header">
<div class="box_header m-0">
<div class="main-title">
<h3 class="m-0">Edit Skill</h3>
</div>
</div>
</div>

<div class="white_card_body">
<div class="card-body">
       
        <form method="POST" action="/Editskill/{{item.id}}" enctype="multipart/form-data">
        {% csrf_token %}
        <div class="row mb-3">
        <div class="col-md-6">
        <label class="form-label" for="inputEmail4">Title</label>
        <input type="text" value="{{item.title}}" class="form-control" id="inputEmail4" placeholder="Enter Title" name="title">
        </div>
        <div class="col-md-6">
        <button type="submit" class="btn btn-primary" style="margin-top:28px">Save Skill</button> 
        </div>
        </div>

        {% comment %} <button type="submit" class="btn btn-primary" style="float:right">Save Skill</button> {% endcomment %}
        </form>
      
    
</div>
</div>

</div>
</div>
</div>
</div>
</div>

</section>



<div id="back-top" style="display: none;">
<a title="Go to Top" href="#">
<i class="ti-angle-up"></i>
</a>
</div>



{% comment %} !-- Include jQuery library for AJAX --> {% endcomment %}
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>

<script>
  // Check if jQuery library is loaded
  if (window.jQuery) {
    $(document).ready(function() {
      // Bind a click event to the scan button
      $('#scanButton').click(function() {
        // Show an alert to prompt the user to scan the tag ID
        alert('Please scan the tag ID.');

        // Send an AJAX request to the server
        $.ajax({
          type: 'GET',
          url: '{% url "get_tag_id" %}',  // URL of your Django view function
          success: function(response) {
            console.log(response);
            // Update the input field with the received tag ID
            $('#tagIdInput').val(response.number);
          },
          error: function() {
            alert('Failed to retrieve the tag ID.');
          }
        });
      });
    });
  } else {
    alert('jQuery library is not loaded. Make sure you have included it.');
  }
</script>

{% endblock %}

