# extends 'admin.html'
<!DOCTYPE html>
<html>
  <head>
    <title>
      # block admintitle
      ${dgettext('acct_mgr', 'Accounts: Cleanup')}
      # endblock admintitle
    </title>
  </head>

  <body>
    # block adminpanel
    <h2>${dgettext('acct_mgr', 'Accounts: Cleanup')}</h2>
    <form id="cleanup" class="mod" method="post">
      ${jmacros.form_token_input()}
      <div id="attributelist">
        <table class="listing" id="attributelist">
          <thead>
            <tr>
              <th class="sel">&nbsp;</th>
              <th colspan="3">${dgettext('acct_mgr', 'Account')}</th>
            </tr>
            <tr>
              <th class="sel">&nbsp;</th>
              <th class="sel">&nbsp;</th>
              <th>${dgettext('acct_mgr', 'Attribute')}</th>
              <th>${dgettext('acct_mgr', 'Value')}</th>
            </tr>
          </thead>
          <tbody>
            <tr class="suggestions">
              <td colspan="4">${dgettext('acct_mgr', 'Authenticated Accounts')}</td>
            </tr>
            # for account, states in attr.items()
            <tr>
              <th><input type="checkbox" name="sel" value="${states['id'][1]}" /></th>
              <th colspan="3">'${account}'</th>
            </tr>
            #   for name, value in states[1].items()
            #     if name != 'id' and value is not mapping
            <tr>
              <td>&nbsp;</td>
              <td>
                <input type="checkbox" name="sel" value="${states[1]['id'][name]}" />
              </td>
              <td>'${name}'</td>
              <td>'${value}'</td>
            </tr>
            #     endif
            #   endfor
            # endfor
          </tbody>
        </table>
      </div>
      <div class="buttons">
        <input type="hidden" name="max_per_page" value="$max_per_page" />
        <input type="hidden" name="accounts" value="${','.join(accounts)}" />
        <input type="submit" name="purge"
               value="${dgettext('acct_mgr', 'Remove selected entries')}" />
        <input type="submit" name="unselect"
               value="${dgettext('acct_mgr', 'Undo selection')}" />
      </div>
    </form>
    # endblock adminpanel
  </body>
</html>
