<div class="col-md-12" style="padding:3px;"
     ng-controller="utilizadorController"
     ng-init="carregarUtilizadores()">
    <div class="row">
        <div class="navbar-form navbar-right" style="">
            <div class="form-group" style="">
                <input type="text" ng-model="procurar_ut" class="form-control" placeholder="Procurar...">
            </div>
        </div>
    </div>

    <div class="row">
    <div class="table-responsive margem">
        <table class="table" style="margin:0">
            <tr>
                <th style="width:250px">Utilizador</th>
                <th>Perfis</th>
                <th style="text-align:right">
                    <button popover-placement="left"
                            popover-trigger="mouseenter"
                            data-popover="Remover"
                            ng-click="confirmarApagarUtilizador(selectedRow)"
                            ng-disabled="mnuUtilizadores.PApagar==false || selectedRow.PK_Utilizador==getSessionId() || selectedRow==null"
                            type="button" class="btn btn-warning btn-sm">
                        <span class="glyphicon glyphicon-remove"></span>
                    </button>
                    <button popover-placement="left"
                            popover-trigger="mouseenter"
                            data-popover="Adicionar"
                            ng-click="utilizadorEditRow()"
                            ng-disabled="mnuUtilizadores.PCriar==false"
                            type="button" class="btn btn-primary btn-sm">
                        <span class="glyphicon glyphicon-plus"></span>
                    </button>

                </th>
            </tr>
        </table>
        <div style="border:1px solid #DDD; height:394px; overflow:auto">
            <table class="table table-hover table-striped">

                <tr ng-repeat="utilizador in users | filter:procurar_ut" ng-click="selectItem(utilizador)" class="apontar" ng-class="{info:utilizador.PK_Utilizador==selectedRow.PK_Utilizador}">
                    <td style="width:250px"><input type="text" onfocus="this.blur()" readonly="readonly" ng-model="utilizador.Nome" class="input_tab readonly" /></td>
                    <td>
                        <input type="text" onfocus="this.blur()" readonly="readonly" ng-model="utilizador.NomesPerfisAssociados" class="input_tab readonly" />
                    </td>
                    <td style="text-align:right">
                        <button popover-placement="top"
                                popover-trigger="mouseenter"
                                data-popover="Editar"
                                ng-click="utilizadorEditRow(utilizador)"
                                ng-disabled="mnuUtilizadores.PEditar==false && podeEditarUtilizador(utilizador.PK_Utilizador)==false"
                                type="button" class="btn btn-default btn-sm">
                            <span class="glyphicon glyphicon-pencil"></span>
                        </button>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </div>

</div>