{% extends 'base.html' %}

{% load static %}
{% block mycontent %}
    <script src="{% static 'Admin/js/jquery.js' %}"></script>
    <script src="{% static 'Admin/js/jquery.validate.js' %}"></script>
    <script src="{% static 'Admin/js/additional-methods.js' %}"></script>
    <script>
    $(document).ready(function() {
        $("#UsertypeForm").validate({
            messages: {
                Utype:"*Please Enter User Type"
            }
        });
    });
    </script>
    <style>
        .error{
            color:red;
            margin: 2px;
        }
    </style>

    <div id="page-wrapper">
        <div class="main-page">
            <div class="forms">
                <div class=" form-grids row form-grids-right">
                    <div class="widget-shadow " data-example-id="basic-forms"> 
                        <div class="form-title">
                            <h4>Add User Type:</h4>
                        </div>
                        <div class="form-body">
                            <form id="UsertypeForm" class="form-horizontal" action="/myadmin/Usertypeaddprocess" method="POST">
                                {% csrf_token %}
                                <div class="form-group"> 
                                    <label class="col-sm-2 control-label">User type</label> 
                                    <div class="col-sm-9"> 
                                        <input type="text" class="form-control" name="Utype" placeholder="Type of User" required> 
                                    </div> 
                                </div> <br>
                                <div class="col-sm-offset-2"> 
                                    <input type="submit" class="btn btn-success" value="Add">
                                    <input type="reset" class="btn btn-primary" value="Reset"> 
                                </div>
                                {% if messages %}
                                   <ul class="messages">
                                   {% for message in messages %}
                                       <li {% if message.tags %} class=" {{ message.tags }} " {% endif %} >
                                          <script>alert('{{ message }}')</script>
                                       </li>
                                   {% endfor %}
                                   </ul>
                                {% endif %} 
                            </form> 
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    {% endblock %}