<div class="input form-group">
  <div class="formGroup-label">
    <label for="token-label"><%- @T('Name') %> *</label>
  </div>
  <div class="controls"><input id="token-label" type="text" name="label" value="" class="form-control js-input" required></div>
</div>

<div class="input form-group">
  <div class="formGroup-label">
    <label for="token-label"><%- @T('Expires') %></label>
  </div>
  <div class="controls js-date"></div>
</div>

<div class="permission form-group checkbox">
  <div class="checkbox">
  <% for permission in @permissions: %>
    <% if !permission.name.match(/\./): %>
    <label class="inline-label checkbox-replacement">
      <input type="checkbox" value="<%= permission.name %>" name="permission" <% if @params && _.contains(@params.permissions, permission.id): %>checked<% end %> <% if permission.preferences.disabled: %>disabled<% end %>/>
      <%- @Icon('checkbox', 'icon-unchecked') %>
      <%- @Icon('checkbox-checked', 'icon-checked') %>
      <span class="label-text"><%= permission.name %></span>
      <span class="help-text"><%- @T.apply(@, [permission.note].concat(permission.preferences.translations)) %></span>
    </label>
    <% else: %>
      <div class="checkbox-child js-subPermissionList">
        <label class="inline-label checkbox-replacement">
          <input type="checkbox" value="<%= permission.name %>" name="permission" <% if @params && _.contains(@params.permissions, permission.id): %>checked<% end %> <% if permission.preferences.disabled: %>disabled<% end %>/>
          <%- @Icon('checkbox', 'icon-unchecked') %>
          <%- @Icon('checkbox-checked', 'icon-checked') %>
          <span class="label-text"><%= permission.name.replace(/^.+?\./, '') %></span>
          <span class="help-text"><%- @T.apply(@, [permission.note].concat(permission.preferences.translations)) %></span>
        </label>
      </div>
    <% end %>
  <% end %>
  </div>
</div>
