<div>
    <table class="table table-bordered table-hover table-condensed">
        <tr style="font-weight: bold">
            <td style="width:35%">{{ 'NAME' | translate }}</td>
            <td style="width:20%">{{ 'PASSWORD' | translate }}</td>
            <td style="width:20%">{{ 'ROLE' | translate }}</td>
            <td style="width:25%">{{ 'EDIT' | translate }}</td>
        </tr>
        <tr ng-repeat="user in users">
            <td>
        <!-- editable username (text with validation) -->
        <span editable-text="user.name" e-name="name" e-form="rowform" onbeforesave="checkName($data,user.id)" e-required>
          {{ user.name || 'empty' }}
        </span>
            </td>
            <td>
         <!-- editable userpass -->
        <span editable-text="user.pass" e-name="pass" e-form="rowform" e-type="password" e-required>
          {{ user.pass || 'empty' | password}}
        </span>
            </td>
            <td>
        <!-- editable role (select-local) -->
        <span editable-select="user.role" e-name="role" e-form="rowform" e-ng-options="s.value as s.text for s in roles">
          {{ showRole(user) }}
        </span>
            </td>

            <td style="white-space: nowrap">
                <!-- form -->
                <form editable-form name="rowform" onbeforesave="saveUser($data,user.id)" ng-show="rowform.$visible" class="form-buttons form-inline" shown="inserted == user">
                    <button type="submit" ng-disabled="rowform.$waiting" class="btn btn-primary">
                        {{ 'SAVE' | translate }}
                    </button>
                    <button type="button" ng-disabled="rowform.$waiting" ng-click="rowform.$cancel()" class="btn btn-default">
                        {{ 'CANCEL' | translate }}
                    </button>
                </form>
                <div class="buttons" ng-show="!rowform.$visible">
                    <button class="btn btn-primary" ng-click="rowform.$show()">{{ 'EDIT' | translate }}</button>
                    <button class="btn btn-danger" ng-click="removeUser($index)">{{ 'DELETE' | translate }}</button>
                </div>
            </td>
        </tr>
    </table>

    <button class="btn btn-default" ng-click="addUser()">{{ 'USER' | translate }} {{ 'ADD' | translate | lowercase }}</button>
</div>


