<!-- 继承公共的 form -->
{{extend name="../../../module/view/form_table/form" /}}

<!-- 表单顶部操作栏 -->
{{block name="form_operate_top"}}
    {{if AdminIsPower('link', 'save')}}
        <button type="button" class="am-btn am-btn-primary am-radius am-btn-xs submit-add" data-am-modal="{target: '#data-save-win'}">
            <i class="iconfont icon-add am-show-sm-only"></i>
            <span>{{:MyLang('add_title')}}</span>
        </button>
    {{/if}}

    <!-- 父级内容 -->
    {__block__}
{{/block}}

<!-- 扩展 -->
{{block name="form_extend"}}
	<!-- save win start -->
	<div class="am-popup am-radius" id="data-save-win">
		<div class="am-popup-inner">
			<div class="am-popup-hd">
				<h4 class="am-popup-title" data-add-title="{{:MyLang('link.base_nav_title')}}{{:MyLang('add_title')}}" data-edit-title="{{:MyLang('link.base_nav_title')}}{{:MyLang('edit_title')}}">{{:MyLang('link.base_nav_title')}}{{:MyLang('add_title')}}</h4>
				<span data-am-modal-close class="am-close">&times;</span>
			</div>
			<div class="am-popup-bd">
                <!-- form start -->
                <form class="am-form form-validation am-form-popup-fixed" action="{{:MyUrl('admin/link/save')}}" method="POST" request-type="ajax-reload" request-value="">
                    <div class="am-form-group row">
                        <label>{{:MyLang('common_service.link.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
                        <input type="text" placeholder="{{:MyLang('common_service.link.form_item_name_message')}}" name="name" minlength="1" maxlength="60" data-validation-message="{{:MyLang('common_service.link.form_item_name_message')}}" class="am-radius" required />
                    </div>
                    <div class="am-form-group row">
                        <label>{{:MyLang('common_service.link.form_item_url')}}<span class="am-form-group-label-tips-must">*</span></label>
                        <input type="url" placeholder="{{:MyLang('common_service.link.form_item_url_placeholder')}}" name="url" data-validation-message="{{:MyLang('common_service.link.form_item_url_message')}}" class="am-radius" required />
                    </div>
                    {{:ModuleInclude('lib/sort', ['is_row'=>1])}}
                    {{:ModuleInclude('lib/is_new_window_open', ['is_row'=>1])}}
                    {{:ModuleInclude('lib/is_enable', ['is_row'=>1])}}
                    <div class="am-form-group row am-form-success">
                        <label class="am-flex-align-self-start">{{:MyLang('common_service.link.form_item_desc')}}</label>
                        <textarea rows="3" maxlength="60" name="describe" class="am-radius" placeholder="{{:MyLang('common_service.link.form_item_desc_message')}}" data-validation-message="{{:MyLang('common_service.link.form_item_desc_message')}}"></textarea>
                    </div>
                    <div class="am-form-popup-submit">
                        <input type="hidden" name="id" />
                        <button type="button" class="am-btn am-btn-warning am-radius am-btn-xs" data-am-modal-close>
                            <i class="am-icon-paint-brush"></i>
                            <span>{{:MyLang('cancel_title')}}</span>
                        </button>
                        <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>
	</div>
	<!-- save win end -->
{{/block}}