<div ng-controller="editarUtController" ng-init="checkIsLDAP()">

    <div class="modal-header">
        <h3>{{selected.item.op}} Utilizador</h3>
        <nav class="navbar navbar-default" role="navigation">
            <div class="container-fluid">
                <ul class="nav navbar-nav">
                    <li ng-click="mostrarTab(0)" ng-class="{active:tabActiva[0]}"><a href="">Dados</a></li>
                    <li ng-click="mostrarTab(1)" ng-class="{active:tabActiva[1]}" ng-show="selected.item.perm.PEditar==true"><a href="">Perfis</a></li>
                </ul>
            </div>
        </nav>
    </div>
    <div class="modal-body">
        <div ng-show="tabActiva[0]">
            <div ng-show="true">
                <div class="input-group">
                    <span class="input-group-addon">
                        <span class="glyphicon glyphicon-user"></span>
                    </span>
                    <input type="text" class="form-control" placeholder="Login"
                           ng-disabled="selected.item.op=='Editar'"
                           ng-model="selected.item.Login">
                </div>

            </div>
            <br />
            <span>Nome</span>
            <br />
            <input class="form-control" ng-model="selected.item.Nome" />
            <br />

            <div class="input-group">
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-lock"></span>
                </span>
                <input type="password" class="form-control" placeholder="Password" ng-model="selected.item.Password" ng-disabled="trancar">
            </div>
            <br />
            <div class="input-group">
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-lock"></span>
                </span>
                <input type="password" class="form-control" placeholder="Repetir Password" ng-model="selected.item.CPassword" ng-disabled="trancar">
            </div>
            <br />
            <div class="input-group">
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-envelope"></span>
                </span>
                <input type="email" class="form-control" placeholder="E-Mail" ng-model="selected.item.Email">
            </div>
        </div>
        <div ng-show="tabActiva[1]" style="overflow:auto; height:290px">

            <ul class="list-group" id="lstPerfis"
                ng-controller="perfilAcessoController"
                ng-init="listarPerfis(selected.item)">
                <li class="list-group-item" ng-repeat="perfil in lstperfis" style="padding-bottom :0; padding-top:0">
                    <label class="checkbox" style="margin-left:10px">
                        <input type="checkbox"
                               ng-disabled="(selected.item.PK_Utilizador==5 && perfil.NomePerfil.toUpperCase()=='SUPERVISOR')"
                               ng-model="perfil.Pertence"
                               ng-click="actualizarPerfisActivos(selected.item)" />
                        {{perfil.NomePerfil}}
                    </label>
                </li>


            </ul>

        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" ng-click="ok()">Guardar</button>
        <button class="btn btn-warning" ng-click="cancel()">Cancelar</button>
    </div>

</div>
