{% 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>
    <div class="card">
        <div class="card-body">
            <h2>Roles</h2>
            <div class="">
                <form class="" method="POST" action='{{url_for("appadmin.roles_add")}}'>
                    <div class="form-group">
                        <input name="csrf_token" value="{{csrf_token()}}" type="hidden">
                        <input class="form-control" type="" name="name"><br>
                        <button class="btn btn-info" type="submit">add</button>
                    </div>
                </form>
                <br>
                <table>
                    <tbody>
                        {%for role in roles%}
                        <tr>
                            <form action="{{url_for('appadmin.roles_update')}}" method="POST">
                                <td>
                                    <input value="{{role.name}}" class="form-control" type="" name="role_name"></td>
                                <input type="hidden" name="role_id" value="{{role.id}}">
                                <input type="hidden" name="csrf_token" value="{{csrf_token()}}">
                                <td><button class="btn btn-info form-control" type="submit">save</button></td>
                                <td><a class="btn btn-danger" href="{{url_for('appadmin.roles_delete', role_id=role.id)}}">delete</a></td>
                            </form>
                        </tr>
                        {%endfor%}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

{% endblock %}
