maestrano/mno-enterprise

View on GitHub
frontend-admin/src/app/components/mnoe-users-local-list/mnoe-users-local-list.html

Summary

Maintainability
Test Coverage
<rd-widget>
  <rd-widget-header icon="fa-users" title="{{users.widgetTitle}}">
    &nbsp;<a href="" ng-click="switchState()" ng-show="list && users.switchLinkTitle">{{users.switchLinkTitle}}</a>
    <input type="text" ng-model="users.search" ng-change="searchChange()" placeholder="Search all" class="form-control input-sm search-bar" />
  </rd-widget-header>
  <rd-widget-body loading="!list" classes="medium no-padding">
    <table class="table table-layout-fixed">
      <thead>
        <tr>
          <th>Username</th>
          <th style="width: 100px;">Creation</th>
          <th style="width: 140px;">Status</th>
          <th style="width: 100px;" ng-if="impersonation_enabled"></th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="user in users.displayList">
          <td>
            <a ui-sref="dashboard.home.user({userId: user.id})">
              <div ng-show="user.name && user.surname">{{::user.name}} {{::user.surname}}</div>
              <div ng-show="!user.name && !user.surname">nc</div>
              <small>{{::user.email}}</small>
            </a>
          </td>
          <td>{{user.created_at | date: 'dd/MM/yyyy'}}</td>
          <td>
            <button ng-show="user.status === 'pending'" ng-click="sendInvitation(user)" class="btn btn-xs btn-default" ng-disabled="user.isSendingInvite">
              <span ng-show="user.isSendingInvite"><i class="fa fa-spinner fa-pulse fa-fw"></i></span>
              INVITE
            </button>
            <button ng-show="user.status === 'invited'" ng-click="sendInvitation(user)" class="btn btn-xs btn-default" ng-disabled="user.isSendingInvite">
              <span ng-show="user.isSendingInvite"><i class="fa fa-spinner fa-pulse fa-fw"></i></span>
              RESEND INVITE
            </button>
            <span ng-show="user.status === 'active'">Active</span>
          </td>
          <td ng-if="impersonation_enabled"><a href="" ng-click="impersonateUser(user)">Log In as...</a></td>
        </tr>
      </tbody>
    </table>
  </rd-widget-body>
</rd-widget>