<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">

    <ol class="breadcrumb">
        <li><a href="#/realms/{{realm.realm}}/clients">Clients</a></li>
        <li>{{client.clientId}}</li>
    </ol>

    <h1>{{client.clientId|capitalize}}</h1>

    <kc-tabs-client></kc-tabs-client>

        <h2><span>{{client.clientId}}</span> Scope Mappings </h2>
        <p class="subtitle"></p>
        <form class="form-horizontal" name="allowScope" novalidate kc-read-only="!access.manageClients">
            <fieldset class="border-top">
                <div class="form-group">
                    <label class="col-md-2 control-label" for="fullScopeAllowed">Full Scope Allowed</label>
                    <kc-tooltip>Allows you to disable all restrictions.</kc-tooltip>
                    <div class="col-md-6">
                        <input ng-model="client.fullScopeAllowed" ng-click="changeFullScopeAllowed()" name="fullScopeAllowed" id="fullScopeAllowed" onoffswitch />
                    </div>
                </div>
            </fieldset>
        </form>

        <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageClients" data-ng-show="!client.fullScopeAllowed">
            <div class="form-group">
                <label class="col-md-2 control-label" class="control-label">Realm Roles</label>
                <div class="col-md-10">
                    <div class="row">
                        <div class="col-md-3">
                            <label class="control-label" for="available">Available Roles</label>
                            <kc-tooltip>Realm level roles that can be assigned to scope.</kc-tooltip>

                            <select id="available" class="form-control" multiple size="5"
                                    ng-multiple="true"
                                    ng-model="selectedRealmRoles"
                                    ng-options="r.name for r in realmRoles">
                            </select>
                            <button class="btn btn-default" type="submit" ng-click="addRealmRole()" tooltip="Move right" tooltip-placement="right">
                                Add selected <i class="fa fa-angle-double-right"></i>
                            </button>
                        </div>
                        <div class="col-md-3">
                            <label class="control-label" for="assigned">Assigned Roles</label>
                            <kc-tooltip>Realm level roles assigned to scope.</kc-tooltip>
                            <select id="assigned" class="form-control" multiple size=5
                                    ng-multiple="true"
                                    ng-model="selectedRealmMappings"
                                    ng-options="r.name for r in realmMappings">
                            </select>
                            <button class="btn btn-default" type="submit" ng-click="deleteRealmRole()" tooltip="Move left" tooltip-placement="left">
                                <i class="fa fa-angle-double-left"></i> Remove selected
                            </button>
                        </div>
                        <div class="col-md-3">
                            <label class="control-label" for="realm-composite">Effective Roles  </label>
                            <kc-tooltip>Assigned realm level roles that may have been inherited from a composite role.</kc-tooltip>
                            <select id="realm-composite" class="form-control" multiple size=5
                                    disabled="true"
                                    ng-model="dummymodel"
                                    ng-options="r.name for r in realmComposite">
                            </select>
                        </div>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label" class="control-label">
                    <span>Client Roles</span>
                    <select class="form-control" id="clients" name="clients" ng-change="changeClient()" ng-model="targetClient" ng-options="a.clientId for a in clients" ng-disabled="false"></select>
                </label>

                <div class="col-md-10">
                    <div class="row" data-ng-hide="targetClient">
                        <div class="col-md-4"><span class="text-muted">Select client to view roles for client</span></div>
                    </div>
                    <div class="row" data-ng-show="targetClient">
                        <div class="col-md-3">
                            <label class="control-label" for="client-available">Available Roles</label>
                            <kc-tooltip>Client roles available to be assigned.</kc-tooltip>
                            <select id="client-available" class="form-control" multiple size="5"
                                    ng-multiple="true"
                                    ng-model="selectedClientRoles"
                                    ng-options="r.name for r in clientRoles">
                            </select>
                            <button class="btn btn-default" type="submit" ng-click="addClientRole()" tooltip="Assign role" tooltip-placement="right">
                                Add selected <i class="fa fa-angle-double-right"></i>
                            </button>
                        </div>
                        <div class="col-md-3">
                            <label class="control-label" for="client-assigned">Assigned Roles</label>
                            <kc-tooltip>Assigned client roles.</kc-tooltip>
                            <select id="client-assigned" class="form-control" multiple size=5
                                    ng-multiple="true"
                                    ng-model="selectedClientMappings"
                                    ng-options="r.name for r in clientMappings">
                            </select>
                            <button class="btn btn-default" type="submit" ng-click="deleteClientRole()" tooltip="Unassign role" tooltip-placement="left">
                                <i class="fa fa-angle-double-left"></i> Remove selected
                            </button>
                        </div>
                        <div class="col-md-3">
                            <label class="control-label" for="client-composite">Effective Roles</label>
                            <kc-tooltip>Assigned client roles that may have been inherited from a composite role.</kc-tooltip>
                            <select id="client-composite" class="form-control" multiple size=5
                                    disabled="true"
                                    ng-model="dummymodel"
                                    ng-options="r.name for r in clientComposite">
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>

<kc-menu></kc-menu>