<div class="bs-sidebar col-sm-3 " data-ng-include data-src="'partials/realm-menu.html'"></div>
<div id="content-area" class="col-sm-9" role="main">

    <ul class="nav nav-tabs nav-tabs-pf">
        <li data-ng-class="(path[2] == 'audit') && 'active'"><a href="#/realms/{{realm.realm}}/audit">View</a></li>
        <li data-ng-class="(path[2] == 'audit-settings') && 'active'"><a href="#/realms/{{realm.realm}}/audit-settings">Config</a></li>
    </ul>

    <div id="content">
        <ol class="breadcrumb">
            <li><a href="#/realms/{{realm.realm}}">{{realm.realm}}</a></li>
            <li><a href="#/realms/{{realm.realm}}/audit">Audit</a></li>
            <li class="active">Config</li>
        </ol>
        <h2><span>{{realm.realm}}</span> Audit Config</h2>

        <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageAudit">
            <fieldset>
                <div class="form-group" data-ng-show="access.manageAudit">
                    <label class="col-sm-2 control-label" for="password">Clear Audit</label>
                    <div class="col-sm-4">
                        <button class="btn btn-danger" type="submit" data-ng-click="clearAudit()" >Clear Audit</button>
                    </div>
                </div>
            </fieldset>
            <fieldset>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="enabled">Enabled</label>
                    <div class="col-sm-4">
                        <input ng-model="auditConfig.auditEnabled" name="enabled" id="enabled" onoffswitch />
                    </div>
                </div>

                <div class="form-group input-select">
                    <label class="col-sm-2 control-label" for="expiration">Expiration</label>
                    <div class="col-sm-10">
                        <div class="row">
                            <div class="col-sm-2">
                                <input class="form-control" type="number"
                                       data-ng-model="auditConfig.auditExpiration"
                                       id="expiration" name="expiration"/>
                            </div>
                            <div class="col-sm-2 select-kc">
                                <select name="expirationUnit" data-ng-model="auditConfig.expirationUnit" >
                                    <option>Minutes</option>
                                    <option>Hours</option>
                                    <option>Days</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="auditListeners" class="control-label">Audit Listeners</label>

                    <div class="col-sm-4">
                        <select ui-select2 ng-model="auditConfig.auditListeners" data-placeholder="Select an action..." multiple>
                            <option ng-repeat="listener in auditListeners" value="{{listener}}">{{listener}}</option>
                        </select>
                    </div>
                </div>
            </fieldset>

            <div class="pull-right form-actions" data-ng-show="access.manageAudit">
                <button data-kc-reset data-ng-show="changed">Clear changes</button>
                <button data-kc-save data-ng-show="changed">Save</button>
            </div>
        </form>
    </div>
</div>
</div>
