<div class="repository-tokens-table-element">
  <div class="resource-view" resource="tokensResource"
       error-message="'Could not load repository tokens'">
      <div class="alert alert-warning">Note: Access tokens are <strong>deprecated</strong> and will be removed in the near future. <a href="http://docs.quay.io/glossary/robot-accounts.html">Robot accounts</a> are the recommended replacement.
      </div>

      <table class="co-table permissions">
        <thead>
          <tr>
            <td style="min-width: 400px;">Token Name</td>
            <td>Permissions</td>
            <td style="width: 95px;"></td>
          </tr>
        </thead>

        <tbody>
         <tr ng-repeat="(code, token) in tokens">
            <td class="user token">
              <i class="fa fa-key"></i>
              <a ng-click="showToken(token.code)">{{ token.friendlyName }}</a>
            </td>
            <td class="user-permissions">
              <div class="btn-group btn-group-sm">
                <button type="button" class="btn btn-default" ng-click="changeTokenAccess(token.code, 'read')" ng-class="{read: 'active', write: ''}[token.role]">Read only</button>
                <button type="button" class="btn btn-default" ng-click="changeTokenAccess(token.code, 'write')" ng-class="{read: '', write: 'active'}[token.role]">Write</button>
              </div>
            </td>
            <td>
              <span class="delete-ui" delete-title="'Delete Token'" perform-delete="deleteToken(token.code)"></span>
            </td>
          </tr>
        </tbody>
      </table>
  </div>
</div>