<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
    <h1>
        <span>Clients</span>
        <kc-tooltip>Clients are trusted browser apps and web services in a realm.  These clients can request a login. You can also define client specific roles.</kc-tooltip>
    </h1>

    <table class="table table-striped table-bordered">
        <thead>
        <tr>
            <th class="kc-table-actions" colspan="5">
                <div class="form-inline">
                    <div class="form-group">
                        <div class="input-group">
                            <input type="text" placeholder="Search..." data-ng-model="search.clientId" class="form-control search" onkeyup="if(event.keyCode == 13){$(this).next('I').click();}">
                            <div class="input-group-addon">
                                <i class="fa fa-search" type="submit"></i>
                            </div>
                        </div>
                    </div>

                    <div class="pull-right" data-ng-show="access.manageClients">
                        <a id="createClient" class="btn btn-default" href="#/create/client/{{realm.realm}}">Create</a>
                        <a id="importClient" class="btn btn-default" href="#/import/client/{{realm.realm}}" data-ng-show="importButton">Import</a>
                    </div>
                </div>
            </th>
        </tr>
        <tr data-ng-hide="clients.length == 0">
            <th>Client ID</th>
            <th>Enabled</th>
            <th>Base URL</th>
            <th colspan="2">Actions</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="client in clients | filter:search | orderBy:'clientId'">
            <td><a href="#/realms/{{realm.realm}}/clients/{{client.id}}">{{client.clientId}}</a></td>
            <td>{{client.enabled}}</td>
            <td ng-class="{'text-muted': !client.baseUrl}">
                <a href="{{client.baseUrl}}" target="_blank" data-ng-show="client.baseUrl">{{client.baseUrl}}</a>
                <span data-ng-hide="client.baseUrl">Not defined</span>
            </td>
            <td class="kc-action-cell">
                <button class="btn btn-default btn-block btn-sm" kc-open="/realms/{{realm.realm}}/clients/{{client.id}}">Edit</button>
            </td>
            <td class="kc-action-cell">
                <button class="btn btn-default btn-block btn-sm" data-ng-click="removeClient(client)">Delete</button>
            </td>
        </tr>
        <tr data-ng-show="(clients | filter:search).length == 0">
            <td class="text-muted" colspan="3" data-ng-show="search.clientId">No results</td>
            <td class="text-muted" colspan="3" data-ng-hide="search.clientId">No clients available</td>
        </tr>
        </tbody>
    </table>
</div>

<kc-menu></kc-menu>