@using MicroUniverso.Web.Security.Html

<div breadcrumb-start="Pesquisar Usuários" region="main">
    <form id="form-pesquisar-usuario">
        <fieldset>
            <div>
                <div class="tam-3">
                    <label>Nome</label><input name="Nome" type="text" maxlength="100" />
                </div>
            </div>
        </fieldset>
        <br />
        <div class="submit" style="clear: both">
            <button id="pesquisar-usuarios" type="submit">Pesquisar</button>
            <button type="submit" data-bind="click: pesquisarGrupos">Grupos</button>
        </div>
    </form>

    <!-- ko if: model.usuarios && model.usuarios() && model.usuarios().length > 0 -->
    <div class="responsiv">
        
        <table class="t1">
            <tr>
                <th class="ds">Usuário</th>
                @if (Html.UsuarioPermitidoAcao("ALTERAR"))
                {
                <th class="tam-selecao"></th>
                }
            </tr>
            <tbody data-bind="foreach: model.usuarios()">
                <tr>
                    <td data-bind="text: Nome"></td>
                    @if (Html.UsuarioPermitidoAcao("ALTERAR")) 
                    { 
                        <td><a href="#" class="icone-editar" title="Editar" data-bind="click: $.proxy($root.editar, $root)"></a></td>
                    }
                </tr>
            </tbody>
        </table>
        
        <div id="pesquisar-usuario-page-container"></div>

    </div>
    <!-- /ko -->
</div>

<div id="editar-usuario-region"></div>
<div id="grupos-usuario-region"></div>