<div id="wrapper" class="container">
    <div class="row">
        <div class="bs-sidebar col-md-3 clearfix" data-ng-include data-src="'partials/realm-menu.html'"></div>
        <div id="content-area" class="col-md-9" role="main">
            <div class="top-nav" data-ng-hide="createRealm">
                <ul class="rcue-tabs">
                    <li><a href="#/realms/{{realm.id}}">General</a></li>
                    <li data-ng-show="realm.social"><a href="#/realms/{{realm.id}}/social-settings">Social</a></li>
                    <li data-ng-show="realm.registrationAllowed"><a href="#/realms/{{realm.id}}/registration-settings">Registration</a></li>
                    <li><a href="#/realms/{{realm.id}}/roles">Roles</a></li>
                    <li><a href="#/realms/{{realm.id}}/required-credentials">Credentials</a></li>
                    <li><a href="#/realms/{{realm.id}}/token-settings">Token</a></li>
                    <li><a href="#/realms/{{realm.id}}/keys-settings">Keys</a></li>
                    <li class="active"><a href="#/realms/{{realm.id}}/smtp-settings">SMTP</a></li>
                </ul>
            </div>
            <div id="content">
                <ol class="breadcrumb">
                    <li><a href="#/realms/{{realm.id}}">{{realm.realm}}</a></li>
                    <li><a href="#/realms/{{realm.id}}">Settings</a></li>
                    <li class="active">SMTP Configuration</li>
                </ol>
                <h2 class="pull-left"><span>{{realm.realm}}</span> SMTP Settings</h2>
                <p class="subtitle"><span class="required">*</span> Required fields</p>
                <form name="realmForm" novalidate>
                    <fieldset>
                        <legend uncollapsed><span class="text">Required Settings</span></legend>
                        <div class="form-group clearfix">
                            <label for="smtpHost" class="control-label">Host <span class="required">*</span></label>
                            <div class="controls">
                                <input id="smtpHost" type="text" ng-model="realm.smtpServer.host" placeholder="SMTP Host" required>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label for="smtpPort" class="control-label">Port <span class="required">*</span></label>
                            <div class="controls">
                                <input id="smtpPort" type="number" ng-model="realm.smtpServer.port" placeholder="SMTP Port (defaults to 25)" required>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label for="smtpFrom" class="control-label">From <span class="required">*</span></label>
                            <div class="controls">
                                <input id="smtpFrom" type="email" ng-model="realm.smtpServer.from" placeholder="SMTP From" required>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label for="smtpSSL" class="control-label">Enable SSL</label>
                            <input ng-model="realm.smtpServer.ssl" name="smtpSSL" id="smtpSSL" onoffswitch />
                        </div>
                        <div class="form-group clearfix">
                            <label for="smtpStartTLS" class="control-label">Enable StartTLS</label>
                            <input ng-model="realm.smtpServer.starttls" name="smtpStartTLS" id="smtpStartTLS" onoffswitch />
                        </div>
                    </fieldset>
                    <fieldset>
                        <legend collapsed><span class="text">Authentication</span></legend>
                        <div class="form-group clearfix">
                            <label for="smtpAuth" class="control-label">Enabled</label>
                            <input ng-model="realm.smtpServer.auth" name="smtpAuth" id="smtpAuth" onoffswitch />
                        </div>
                        <div class="form-group clearfix">
                            <label for="smtpUsername" class="control-label">Username <span class="required" ng-show="realm.smtpServer.auth">*</span></label>
                            <div class="controls">
                                <input 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">
                            <label for="smtpPassword" class="control-label">Password <span class="required" ng-show="realm.smtpServer.auth">*</span></label>
                            <div class="controls">
                                <input 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>
<!--
                    <fieldset class="border-top">
                        <div class="form-group clearfix" ng-repeat="(name, setting) in smtpSettings | orderBy: setting.required">
                            <label for="{{name}}" class="control-label">{{name.replace('mail.smtp.','')}} <span class="required" data-ng-show="setting.required">*</span></label>

                            <div ng-show="setting.type == 'boolean'" class="onoffswitch">
                                <input type="checkbox" data-ng-model="realm.smtp[name]" class="onoffswitch-checkbox" name="{{name}}" id="{{name}}">
                                <label for="{{name}}" class="onoffswitch-label">
                                        <span class="onoffswitch-inner">
                                            <span class="onoffswitch-active">ON</span>
                                            <span class="onoffswitch-inactive">OFF</span>
                                        </span>
                                    <span class="onoffswitch-switch"></span>
                                </label>
                            </div>
                            <div ng-show="setting.type == 'String'" class="controls">
                                <input id="{{name}}" type="text" ng-model="realm.smtp[name]" placeholder="SMTP {{name}} / {{ setting.required }}">
                            </div>
                            <div ng-show="setting.type == 'int'" class="controls">
                                <input id="{{name}}" type="number" ng-model="realm.smtp[name]" placeholder="SMTP {{name}} / {{ setting.required }}">
                            </div>
                        </div>
                    </fieldset>
-->
                   <div class="form-actions">
                        <button type="submit" data-kc-save class="primary" data-ng-show="changed">Save
                        </button>
                        <button type="submit" data-kc-reset data-ng-show="changed">Clear changes
                        </button>
                    </div>

                </form>
            </div>
        </div>
        <div id="container-right-bg"></div>
    </div>
</div>