<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>
    <div id="content">
        <ol class="breadcrumb">
            <li><a href="#/realms/{{realm.realm}}">{{realm.realm}}</a></li>
            <li><a href="#/realms/{{realm.realm}}">Settings</a></li>
            <li class="active">SMTP Configuration</li>
        </ol>
        <h2><span>{{realm.realm}}</span> Email Server Settings</h2>
        <p class="subtitle pull-right"><span class="required">*</span> Required fields</p>
        <form class="form-horizontal" name="realmForm" novalidate>
            <fieldset>
                <legend uncollapsed><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 <span class="required">*</span></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)" required>
                    </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 uncollapsed><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">
                <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>