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

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
		<form class="am-form form-validation am-form-full-screen am-form-popup-fixed" action="{{:MyUrl('admin/goodsspectemplate/save')}}" method="POST" request-type="ajax-reload" request-value="parent">
            <div class="am-form-group row">
                <label>{{:MyLang('common_service.goodsspectemplate.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
                <input type="text" name="name" placeholder="{{:MyLang('common_service.goodsspectemplate.form_item_name_message')}}" minlength="1" maxlength="80" data-validation-message="{{:MyLang('common_service.goodsspectemplate.form_item_name_message')}}" class="am-radius" {{if !empty($data['name'])}} value="{{$data.name}}"{{/if}} required />
            </div>
            <div class="am-form-group row">
                <label class="am-block">
                    {{:MyLang('common_service.goodsspectemplate.form_item_category_id')}}
                    <span class="am-form-group-label-tips-must">*</span>
                    <a href="javascript:;" class="am-icon-question-circle am-margin-left-xs" data-am-popover="{content: '{{:MyLang('common_service.goodsspectemplate.form_item_category_id_tips')}}', trigger: 'hover focus', theme: 'sm'}"></a>
                </label>
                <select name="category_id" class="am-radius chosen-select" data-placeholder="{{:MyLang('please_select_tips')}}" data-validation-message="{{:MyLang('common_service.goodsspectemplate.form_item_category_id_message')}}" required>
                    {{if !empty($goods_category_list)}}
                        <option value="">{{:MyLang('please_select_tips')}}</option>
                        {{foreach $goods_category_list as $v}}
                            <option value="{{$v.id}}" {{if isset($data['category_id']) and $data['category_id'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
                            {{if !empty($v['items'])}}
                                {{foreach $v.items as $vs}}
                                    <option style="padding-left: 20px;" value="{{$vs.id}}" {{if isset($data['category_id']) and $data['category_id'] eq $vs['id']}}selected{{/if}}>{{if empty($vs['items'])}}├{{else /}}└{{/if}}² {{$vs.name}}</option>
                                    {{if !empty($vs['items'])}}
                                        {{foreach $vs.items as $kss=>$vss}}
                                            <option style="padding-left: 40px;" value="{{$vss.id}}" {{if isset($data['category_id']) and $data['category_id'] eq $vss['id']}}selected{{/if}}>{{if $kss eq count($vs['items'])-1}}└{{else /}}├{{/if}}³ {{$vss.name}}</option>
                                        {{/foreach}}
                                    {{/if}}
                                {{/foreach}}
                            {{/if}}
                        {{/foreach}}
                    {{/if}}
                </select>
            </div>

			<div class="am-form-group row">
				<label>{{:MyLang('common_service.goodsspectemplate.form_item_content')}}<span class="am-form-group-label-tips-must">*</span></label>
                <div class="am-width">
                    <input type="text" name="content" placeholder="{{:MyLang('common_service.goodsspectemplate.form_item_content_placeholder')}}" minlength="1" maxlength="1000" data-validation-message="{{:MyLang('common_service.goodsspectemplate.form_item_content_message')}}" class="am-radius" {{if !empty($data['content'])}} value="{{$data.content}}"{{/if}} required data-am-tagsinput />
                </div>
			</div>
            {{:ModuleInclude('lib/is_enable', ['is_row'=>1])}}

			<!-- 插件扩展数据 start -->
			{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_admin_goods_spec_template_save</span>
                </div>
            {{/if}}
			{{if !empty($plugins_view_admin_goods_spec_template_save_data) and is_array($plugins_view_admin_goods_spec_template_save_data)}}
				<div class="am-alert am-alert-secondary">
					<label class="am-text-sm am-text-warning">{{:MyLang('plugins_view_region_config_tips')}}</label>
					<div>
						{{foreach $plugins_view_admin_goods_spec_template_save_data as $hook}}
		                    {{if is_string($hook) or is_int($hook)}}
		                        {{$hook|raw}}
		                    {{/if}}
		                {{/foreach}}
					</div>
				</div>
			{{/if}}
			<!-- 插件扩展数据 end -->

			<div class="am-form-popup-submit">
                <input type="hidden" name="id" {{if !empty($data['id'])}} value="{{$data.id}}"{{/if}} />
                <button type="button" class="am-btn am-btn-warning am-radius am-btn-xs am-margin-right-lg" 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>
<!-- right content end  -->

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