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

<!-- right content start  -->
<div class="content-right">
	<div class="content">
        <!-- nav start -->
        {{:ModuleInclude('public/admin_nav', [
            'title'     => MyLang('appcenternav.base_nav_title').(empty($data['id']) ? MyLang('created_title') : MyLang('edit_title')),
            'back_url'  => MyUrl('admin/appcenternav/index', $params)
        ])}}
        <!-- nav end -->
        <!-- form start -->
        <form class="am-form form-validation am-form-full-screen am-form-popup-sticky" action="{{:MyUrl('admin/appcenternav/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/appcenternav/index', $params)}}" enctype="multipart/form-data">
            <div class="am-form-group">
                <label>{{:MyLang('common_service.appcenternav.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
                <input type="text" name="name" placeholder="{{:MyLang('common_service.appcenternav.form_item_name_message')}}" minlength="2" maxlength="60" data-validation-message="{{:MyLang('common_service.appcenternav.form_item_name_message')}}" class="am-radius" {{if !empty($data['name'])}} value="{{$data.name}}"{{/if}} required />
            </div>
            <div class="am-form-group">
                <label>{{:MyLang('form_platform_title')}}<span class="am-form-group-label-tips-must">*</span></label>
                <div class="am-checkbox-group">
                    {{foreach :MyConst('common_platform_type') as $v}}
                        <label class="am-checkbox-inline">
                            <input type="checkbox" value="{{$v.value}}" name="platform" data-am-ucheck {{if (!empty($data['platform']) and is_array($data['platform']) and in_array($v['value'], $data['platform'])) or (empty($data['platform']) and isset($v['checked']) and $v['checked'] eq true)}}checked{{/if}} data-validation-message="{{:MyLang('form_platform_message')}}" required /> {{$v.name}}
                          </label>
                    {{/foreach}}
                </div>
            </div>

            <div class="am-form-group">
                <label>{{:MyLang('common_service.appcenternav.form_item_desc')}}</label>
                <input type="text" name="desc" placeholder="{{:MyLang('common_service.appcenternav.form_item_desc_message')}}" data-validation-message="{{:MyLang('common_service.appcenternav.form_item_desc_message')}}" class="am-radius" {{if !empty($data['desc'])}} value="{{$data.desc}}"{{/if}} />
            </div>

            <div class="am-form-group">
                <label>{{:MyLang('form_event_type_title')}}</label>
                <select name="event_type" class="am-radius chosen-select" data-placeholder="{{:MyLang('optional_tips')}}" data-validation-message="{{:MyLang('form_event_type_message')}}">
                    <option value="">{{:MyLang('optional_tips')}}</option>
                    {{foreach $common_app_event_type as $v}}
                        <option value="{{$v.value}}" {{if isset($data['event_type']) and $data['event_type'] eq $v['value']}}selected{{else /}}{{if !isset($data['event_type']) and isset($v['checked']) and $v['checked'] eq true}}selected{{/if}}{{/if}}>{{$v.name}}</option>
                    {{/foreach}}
                </select>
            </div>
            <div class="am-form-group">
                <label>{{:MyLang('form_event_value_title')}}</label>
                <input type="text" name="event_value" placeholder="{{:MyLang('form_event_value_message')}}" data-validation-message="{{:MyLang('common_service.appcenternav.form_item_event_value_message')}}" class="am-radius" {{if !empty($data['event_value'])}} value="{{$data.event_value}}"{{/if}} />
                {{:ModuleInclude('public/event_value_tips')}}
            </div>

            <div class="am-form-group am-form-file">
                <label class="am-block">{{:MyLang('common_service.appcenternav.form_item_images_url')}}<span class="am-form-group-label-tips-must">*</span></label>
                <div class="am-form-file-upload-container">
                    <ul class="plug-file-upload-view slide-images_url-images-view" data-form-name="images_url" data-max-number="1" data-dialog-type="images" data-is-eye="1">
                        <li class="plug-file-upload-submit" data-view-tag="ul.slide-images_url-images-view">
                            {{if empty($data['images_url'])}}
                                <i class="iconfont icon-add"></i>
                            {{else /}}
                                <input type="text" name="images_url" value="{{$data.images_url}}" />
                                <img src="{{$data.images_url}}" />
                                <i class="iconfont icon-close"></i>
                                <i class="iconfont icon-eye"></i>
                            {{/if}}
                        </li>
                    </ul>
                </div>
            </div>
            {{:ModuleInclude('lib/sort')}}
            {{:ModuleInclude('lib/is_enable')}}

            <div class="am-form-popup-submit">
                <input type="hidden" name="id" {{if !empty($data)}} value="{{$data.id}}"{{/if}} />
                <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')}}