{% extends get_active_back_theme()+"/base.html" %}

{%block head%}
    <script src="{{url_for('static', filename='jquery_3.2.1.min.js')}}"></script>
{%endblock%}

{% block content %}
<div class="container">
    <br>
    <a href="{{ url_for('appadmin.user_list') }}">
        <button type="button" class="btn rounded-pill btn-icon btn-primary">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill: rgb(255, 255, 255);transform: ;msFilter:;"><path d="M21 11H6.414l5.293-5.293-1.414-1.414L2.586 12l7.707 7.707 1.414-1.414L6.414 13H21z"></path></svg>
          </button>
    </a>
    <br>
    <div class="container col-md-6 off-set-3">
        <div class="card">
            <div class="card-body">
                <form action="/appadmin/add" method="post">
                    <div class="input-group mb-3">
                        <input type="email" name="email" class="form-control" id="email" placeholder="Email" required autocomplete="off">
                    </div>
                    <div class="input-group mb-3">
                        <input type="password" name="password" class="form-control" id="user_password" placeholder="Password" required autocomplete="off">
                    </div>
                    <div class="input-group mb-3">
                        <input type="text" name="first_name" class="form-control" placeholder="First Name" autocomplete="off">
                    </div>
                    <div class="input-group mb-3">

                        <input type="text" name="last_name" class="form-control" placeholder="Last Name" autocomplete="off">
                    </div>
                    <div class="input-group mb-3">
                        <div class="custom-control custom-checkbox">
                            <input type="checkbox" name="is_admin" class="custom-control-input" id="is_admin" value="True" checked>
                            <label for="is_admin" class="custom-control-label">Admin User</label>
                        </div>
                    </div>
                    <table class="table">
                        <tbody>
                            {%for role in roles%}
                            <tr>
                                <td><input type="checkbox" name="role_{{role.id}}"></td>
                                <td>{{role.name}}</td>
                            </tr>
                            {%endfor%}
                        </tbody>
                    </table>
                    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
                    <input type="submit" class="btn btn-info" value="add" required>
                </form>
            </div>
        </div>
    </div>
</div>

{% endblock %}
