{% extends "admin/base.html" %}
{% import 'macros/form.html' as form %}

{% block primary_content_inner %}
  {% asset 'acl/permission_form' %}

  <form method='post' action="" class="form-horizontal" data-module="permission-form">
    {% block permission_form %}
         <div class="control-group">
            <fieldset>
              <legend>User</legend>
              <div class="controls">

                <input id="username" type="text" name="username" placeholder="Username"
                  value="{{ username }}" class="control-medium" data-module="autocomplete"
                  data-module-source="/api/2/util/user/autocomplete?q=?">

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

        <fieldset>
          <legend>Permissions</legend>
          {% for perm in perm_list.permissions_list() %}
            {{ form.checkbox("perm", id="perm_" + perm, label=perm_list.humanize_permission(perm), value=perm, classes=["perm-checkbox"]) }}
          {% endfor %}
        </fieldset>
    {% endblock %}
    <div class="form-actions">
      <button type="submit" class="btn btn-primary" name="save">{{ _('Update Permissions') }}</button>
    </div>
  </form>
{% endblock %}

{% block secondary_content %}
  <div class="module module-narrow module-shallow">
    <h2 class="module-heading">
      <i class="icon-info-sign"></i>
      {{ _('Permission info') }}
    </h2>
    <div class="module-content">
        <p>Help text</p>
    </div>
  </div>
{% endblock %}
