<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><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 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><span>{{realm.realm}}</span> SMTP Settings</h2>
                <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="text" 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>
                            <div class="onoffswitch">
                                <input type="checkbox" data-ng-model="realm.smtpServer.ssl.enable" class="onoffswitch-checkbox" name="smtpSSL" id="smtpSSL">
                                <label for="smtpSSL" 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>
                    </fieldset>
                    <fieldset>
                        <legend collapsed><span class="text">Authentication</span></legend>
                        <div class="form-group clearfix">
                            <label for="smtpAuth" class="control-label">Enabled</label>
                            <div class="onoffswitch">
                                <input type="checkbox" data-ng-model="realm.smtpServer.auth" class="onoffswitch-checkbox" name="smtpAuth" id="smtpAuth">
                                <label for="smtpAuth" 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>
                        <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-ng-click="save()" class="primary" data-ng-show="changed">Save
                        </button>
                        <button type="submit" data-ng-click="reset()" data-ng-show="changed">Clear changes
                        </button>
                    </div>

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