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

    <kc-tabs-authentication></kc-tabs-authentication>

    <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageRealm">
        <table class="table table-striped table-bordered">
            <caption class="hidden">Table of Password Policies</caption>
            <thead>
            <tr ng-show="(allPolicies|removeSelectedPolicies:policy).length > 0">
                <th colspan="5" class="kc-table-actions">
                    <div class="pull-right">
                        <div>
                            <select class="form-control" ng-model="selectedPolicy"
                                    ng-options="(p.name|capitalize) for p in (allPolicies|removeSelectedPolicies:policy)"
                                    data-ng-change="addPolicy(selectedPolicy); selectedPolicy = null">
                                <option value="" disabled selected>Add policy...</option>
                            </select>
                        </div>
                    </div>
                </th>
            </tr>
            <tr>
                <th>Policy Type</th>
                <th>Policy Value</th>
                <th>Actions</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="p in policy">
                <td>{{p.name|capitalize}}</td>
                <td>
                    <input id="{{p.name + (p.name == 'regexPattern' && '_' + $index || '')}}" class="form-control" ng-model="p.value" ng-show="p.name != 'notUsername' "
                           placeholder="No value assigned" min="1" required>
                </td>
                <td class="kc-action-cell">
                    <button type="button" class="btn btn-default btn-block btn-sm" ng-click="removePolicy($index)">Delete</button>
                </td>
            </tr>
            </tbody>
        </table>

        <div class="form-group" data-ng-show="access.manageRealm">
            <div class="col-md-12">
                <button kc-save data-ng-disabled="!changed">Save</button>
                <button kc-reset data-ng-disabled="!changed">Cancel</button>
            </div>
        </div>
    </form>

</div>


<kc-menu></kc-menu>
