<div class="bs-sidebar col-sm-3 " data-ng-include data-src="resourceUrl + '/partials/realm-menu.html'"></div>
<div id="content-area" class="col-sm-9" role="main">
    <kc-navigation data-kc-current="general" data-kc-realm="realm.realm" data-kc-social="social"></kc-navigation>
    <h2></h2>
    <div id="content">
        <div data-ng-show="access.viewRealm">
            <h2><span>{{realm.realm}}</span> Login Settings</h2>
            <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageRealm">
                <fieldset class="border-top">
                    <div class="form-group">
                        <label for="registrationAllowed" class="col-sm-2 control-label">User registration</label>
                        <div class="col-sm-4">
                            <input ng-model="realm.registrationAllowed" name="registrationAllowed" id="registrationAllowed" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Enable/disable the registration page. A link for registration will show on login page too." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group" ng-show="registrationAllowed">
                        <label for="registrationEmailAsUsername" class="col-sm-2 control-label">Email as username</label>
                        <div class="col-sm-4">
                            <input ng-model="realm.registrationEmailAsUsername" name="registrationEmailAsUsername" id="registrationEmailAsUsername" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="If enabled then username field is hidden from registration form and email is used as username for new user." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label for="resetPasswordAllowed" class="col-sm-2 control-label">Forget password</label>
                        <div class="col-sm-4">
                            <input ng-model="realm.resetPasswordAllowed" name="resetPasswordAllowed" id="resetPasswordAllowed" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Show a link on login page for user to click on when they have forgotten their credentials." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="rememberMe">Remember Me</label>
                        <div class="col-sm-4">
                            <input ng-model="realm.rememberMe" name="rememberMe" id="rememberMe" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Show checkbox on login page to allow user to remain logged in between browser restarts until session expires." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label for="verifyEmail" class="col-sm-2 control-label">Verify email</label>
                        <div class="col-sm-4">
                            <input ng-model="realm.verifyEmail" name="verifyEmail" id="verifyEmail" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Require the user to verify their email address the first time they login." class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label for="passwordCredentialGrantAllowed" class="col-sm-2 control-label">Direct Grant API</label>
                        <div class="col-sm-4">
                            <input ng-model="realm.passwordCredentialGrantAllowed" name="passwordCredentialGrantAllowed" id="passwordCredentialGrantAllowed" onoffswitch />
                        </div>
                        <span tooltip-placement="right" tooltip="Enable/disable REST API for login/token grant access" class="fa fa-info-circle"></span>
                    </div>
                    <div class="form-group">
                        <label for="sslRequired" class="col-sm-2 control-label">Require SSL</label>
                        <div class="col-sm-4">
                            <div class="select-kc">
                                <select id="sslRequired" ng-model="realm.sslRequired">
                                    <option value="all">all requests</option>
                                    <option value="external">external requests</option>
                                    <option value="none">none</option>
                                </select>
                            </div>
                        </div>
                        <span tooltip-placement="right" tooltip="Is HTTPS required?  'None' means HTTPS is not required for any client IP address. 'External requests' means localhost and private IP addresses can access without HTTPS.  'All requests' means HTTPS is required for all IP addresses." class="fa fa-info-circle"></span>
                    </div>
                </fieldset>
                <div class="pull-right form-actions" data-ng-show="access.manageRealm">
                    <button kc-reset data-ng-show="changed">Clear changes</button>
                    <button kc-save  data-ng-show="changed">Save</button>
                </div>
            </form>
        </div>
        <div data-ng-hide="access.viewRealm">
            <h2 ><span>{{realm.realm}}</span></h2>
        </div>

    </div>
</div>