{% extends "base/main_base.html" %}

{% set active_page = "admin" %}

{% block pagehead %}

{% endblock %}

{% block content %}
{%include 'admin/nav.html'%}
<br>
<h2>Roles</h2>
<div class="">
  <form class="" method="POST" action='{{url_for("admin.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>
  <table>
    <tbody>
  {%for role in roles%}
  
      
  <tr>
  <form action="{{url_for('admin.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('admin.roles_delete', role_id=role.id)}}">delete</a></td>

  </form>
    </tr>
  {%endfor%}
    </tbody>
  </table>
</div>
{% endblock %}