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

<!-- right content start  -->
<div class="content-right">
	<div class="content">
        <!-- nav start -->
        {{:ModuleInclude('public/admin_nav', [
            'title'     => MyLang('slide.base_nav_title').(empty($data['id']) ? MyLang('created_title') : MyLang('edit_title')),
            'back_url'  => MyUrl('admin/slide/index', $params)
        ])}}
        <!-- nav end -->
        <!-- form start -->
        <form class="am-form form-validation am-form-full-screen am-form-popup-sticky" action="{{:MyUrl('admin/slide/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/slide/index', $params)}}" enctype="multipart/form-data">
            <div class="am-form-group">
                <label>{{:MyLang('common_service.slide.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
                <input type="text" name="name" placeholder="{{:MyLang('common_service.slide.form_item_name_message')}}" minlength="2" maxlength="60" data-validation-message="{{:MyLang('common_service.slide.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.slide.form_item_describe')}}</label>
                <input type="text" name="describe" placeholder="{{:MyLang('common_service.slide.form_item_describe_message')}}" maxlength="230" data-validation-message="{{:MyLang('common_service.slide.form_item_describe_message')}}" class="am-radius" {{if !empty($data['describe'])}} value="{{$data.describe}}"{{/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 :MyConst('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_bg_color_title')}}</label>
                <div class="colorpicker-container">
                    <input type="hidden" name="bg_color" value="{{if !empty($data['bg_color'])}}{{$data.bg_color}}{{/if}}" />
                    <div class="colorpicker-submit" data-color="{{if !empty($data['bg_color'])}}{{$data.bg_color}}{{/if}}"  data-color-tag="input[name='bg_color']" data-color-style="background-color"></div>
                    <img class="imitate-colorpicker-submit" src="{{:StaticAttachmentUrl('colorpicker.png')}}" width="24" height="24" />
                </div>
            </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('form_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.slide.form_item_images_url')}}<span class="am-form-group-label-tips-must">*</span>{{if is_array(MyLang('common_service.slide.form_item_images_url_tips'))}}<a href="javascript:;" class="am-icon-question-circle am-margin-left-xs" data-am-popover="{content: '{{:implode('<br />', MyLang('common_service.slide.form_item_images_url_tips'))}}', trigger: 'hover focus', theme: 'sm'}"></a>{{/if}}</label>
                <div class="am-form-file-upload-container plug-file-upload-view-width-auto">
                    <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>
            <div class="am-form-group">
                <label>{{:MyLang('form_time_valid_title')}}</label>
                <div class="form-multiple-where-input">
                    <input type="text" name="start_time" autocomplete="off" class="Wdate am-radius" placeholder="{{:MyLang('form_time_start_title')}}" data-validation-message="{{:MyLang('form_time_start_message')}}" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss', maxDate:'#F{$dp.$D(\'end-time\');}'})" {{if !empty($data['start_time'])}}value="{{$data.start_time}}"{{/if}} data-is-clearout="0" id="start-time" />
                    <span class="am-text-grey">~</span>
                    <input type="text" name="end_time" autocomplete="off" class="Wdate am-radius" placeholder="{{:MyLang('form_time_end_title')}}" data-validation-message="{{:MyLang('form_time_end_message')}}" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss', minDate:'#F{$dp.$D(\'start-time\');}'})" {{if !empty($data['end_time'])}}value="{{$data.end_time}}"{{/if}} data-is-clearout="0" id="end-time" />
                </div>
            </div>
            
            {{:ModuleInclude('lib/sort')}}
            {{:ModuleInclude('lib/is_enable')}}

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