<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">
    <data-kc-navigation data-kc-current="email" data-kc-realm="realm.realm" data-kc-social="realm.social"></data-kc-navigation>
    <h2></h2>
    <div id="content">
        <h2 class="pull-left"><span>{{realm.realm}}</span> Email Settings <span tooltip-placement="right" tooltip="Email server to use when the server needs to send an email, i.e. forgot password, credential reset, etc." class="fa fa-info-circle"></span></h2>
        <p class="subtitle"><span class="required">*</span> Required fields</p>
        <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageRealm">
            <fieldset>
                <legend><span class="text">Required Settings</span></legend>
                <div class="form-group clearfix">
                    <label class="col-sm-2 control-label" for="smtpHost">Host <span class="required">*</span></label>
                    <div class="col-sm-4">
                        <input class="form-control" id="smtpHost" type="text" ng-model="realm.smtpServer.host" placeholder="SMTP Host" required>
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-sm-2 control-label" for="smtpPort">Port</label>
                    <div class="col-sm-4">
                        <input class="form-control" id="smtpPort" type="number" ng-model="realm.smtpServer.port" placeholder="SMTP Port (defaults to 25)">
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-sm-2 control-label" for="smtpFrom">From <span class="required">*</span></label>
                    <div class="col-sm-4">
                        <input class="form-control" id="smtpFrom" type="email" ng-model="realm.smtpServer.from" placeholder="Sender Email Address" required>
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-sm-2 control-label" for="smtpSSL">Enable SSL</label>
                    <div class="col-sm-4">
                        <input ng-model="realm.smtpServer.ssl" name="smtpSSL" id="smtpSSL" onoffswitch />
                    </div>
                </div>
                <div class="form-group clearfix">
                    <label class="col-sm-2 control-label" for="smtpStartTLS">Enable StartTLS</label>
                    <div class="col-sm-4">
                        <input ng-model="realm.smtpServer.starttls" name="smtpStartTLS" id="smtpStartTLS" onoffswitch />
                    </div>
                </div>
            </fieldset>
            <fieldset>
                <legend><span class="text">Authentication</span></legend>
                <div class="form-group clearfix">
                    <label class="col-sm-2 control-label" for="smtpAuth">Enable Authentication</label>
                    <div class="col-sm-4">
                        <input ng-model="realm.smtpServer.auth" name="smtpAuth" id="smtpAuth" onoffswitch />
                    </div>
                </div>
                <div class="form-group clearfix" data-ng-show="realm.smtpServer.auth">
                    <label class="col-sm-2 control-label" for="smtpUsername">Username <span class="required" ng-show="realm.smtpServer.auth">*</span></label>
                    <div class="col-sm-4">
                        <input class="form-control" id="smtpUsername" type="text" ng-model="realm.smtpServer.user" placeholder="Login Username" ng-disabled="!realm.smtpServer.auth" ng-required="realm.smtpServer.auth">
                    </div>
                </div>
                <div class="form-group clearfix" data-ng-show="realm.smtpServer.auth">
                    <label class="col-sm-2 control-label" for="smtpPassword">Password <span class="required" ng-show="realm.smtpServer.auth">*</span></label>
                    <div class="col-sm-4">
                        <input class="form-control" id="smtpPassword" type="password" ng-model="realm.smtpServer.password" placeholder="Login Password" ng-disabled="!realm.smtpServer.auth" ng-required="realm.smtpServer.auth">
                    </div>
                </div>
            </fieldset>

            <div class="pull-right form-actions" data-ng-show="access.manageRealm">
                <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>