{{:ModuleInclude('public/header')}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
        <!-- nav start -->
        {{:ModuleInclude('public/nav_switch_tabs', [
            'nav_data'  => $nav_data,
            'nav_type'  => $type,
            'url'       => 'admin/email/index'
        ])}}
        <!-- nav end -->	
        <!-- form start -->
        <form class="am-form form-validation am-form-popup-sticky" action="{{:MyUrl('admin/email/save')}}" method="POST" request-type="ajax-view" request-value="{{:MyUrl('admin/email/index', ['type'=>'index'])}}">
            <div class="nav-content">
                <!-- table tips start -->
                {{:ModuleInclude('email/tips')}}
                <!-- table tips end -->
                <div class="am-form-group">
                    <label>{{$data.common_email_smtp_host.name}}<span class="am-form-group-label-tips">{{$data.common_email_smtp_host.describe}}</span></label>
                    <input type="text" name="{{$data.common_email_smtp_host.only_tag}}" placeholder="{{$data.common_email_smtp_host.name}}" data-validation-message="{{$data.common_email_smtp_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_email_smtp_host.value}}"{{/if}} />
                </div>
                <div class="am-form-group">
                    <label>{{$data.common_email_smtp_port.name}}<span class="am-form-group-label-tips">{{$data.common_email_smtp_port.describe}}</span></label>
                    <input type="number" name="{{$data.common_email_smtp_port.only_tag}}" placeholder="{{$data.common_email_smtp_port.name}}" data-validation-message="{{$data.common_email_smtp_port.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_email_smtp_port.value}}"{{/if}} />
                </div>
                <div class="am-form-group">
                    <label>{{$data.common_email_smtp_account.name}}<span class="am-form-group-label-tips">{{$data.common_email_smtp_account.describe}}</span></label>
                    <input type="text" name="{{$data.common_email_smtp_account.only_tag}}" placeholder="{{$data.common_email_smtp_account.name}}" data-validation-message="{{$data.common_email_smtp_account.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_email_smtp_account.value}}"{{/if}} />
                </div>
                <div class="am-form-group">
                    <label>{{$data.common_email_smtp_name.name}}<span class="am-form-group-label-tips">{{$data.common_email_smtp_name.describe}}</span></label>
                    <input type="text" name="{{$data.common_email_smtp_name.only_tag}}" placeholder="{{$data.common_email_smtp_name.name}}" data-validation-message="{{$data.common_email_smtp_name.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_email_smtp_name.value}}"{{/if}} />
                </div>
                <div class="am-form-group">
                    <label>{{$data.common_email_smtp_pwd.name}}<span class="am-form-group-label-tips">{{$data.common_email_smtp_pwd.describe}}</span></label>
                    <input type="password" name="{{$data.common_email_smtp_pwd.only_tag}}" placeholder="{{$data.common_email_smtp_pwd.name}}" data-validation-message="{{$data.common_email_smtp_pwd.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_email_smtp_pwd.value}}"{{/if}} />
                </div>
                <div class="am-form-group">
                    <label>{{$data.common_email_is_use_ssl.name}}</label>
                    <div class="am-radio-group">
                        {{foreach :MyConst('common_is_text_list') as $v}}
                            <label class="am-radio-inline">
                                <input type="radio" value="{{$v.id}}" name="{{$data.common_email_is_use_ssl.only_tag}}" data-validation-message="{{$data.common_email_is_use_ssl.error_tips}}" required {{if isset($data['common_email_is_use_ssl']['value']) and $data['common_email_is_use_ssl']['value'] eq $v['id']}}checked{{/if}} data-am-ucheck>{{$v.name}}
                            </label>
                        {{/foreach}}
                    </div>
                </div>
                <div class="am-form-group">
                    <label>{{$data.common_email_smtp_send_name.name}}<span class="am-form-group-label-tips">{{$data.common_email_smtp_send_name.describe}}</span></label>
                    <input type="text" name="{{$data.common_email_smtp_send_name.only_tag}}" placeholder="{{$data.common_email_smtp_send_name.name}}" data-validation-message="{{$data.common_email_smtp_send_name.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_email_smtp_send_name.value}}"{{/if}} />
                </div>
                <div class="am-form-group">
                    <label>{{:MyLang('email.form_item_test')}}<span class="am-form-group-label-tips">{{:MyLang('email.form_item_test_tips')}}</span></label>
                    <div class="am-flex am-gap-1">
                        <input type="text" placeholder="{{:MyLang('email.form_item_test')}}" class="am-radius test-email-value" />
                        <button class="am-btn am-btn-primary-plain am-radius test-email-submit" type="button" data-url="{{:MyUrl('admin/email/emailtest')}}">
                            <i class="iconfont icon-check"></i>
                            {{:MyLang('email.form_item_test_button_title')}}
                        </button>
                    </div>
                </div>
            </div>
            <div class="am-form-popup-submit">
                <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('save_title')}}'}">
                    <i class="am-icon-save"></i>
                    <span>{{:MyLang('save_title')}}</span>
                </button>
            </div>
        </form>
        <!-- form end -->
	</div>
</div>
<!-- right content end  -->

<!-- footer start -->
{{:ModuleInclude('public/footer')}}