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

<!-- right content start  -->
<div class="content-right">
    <div class="content">
        <!-- nav start -->
        {{:ModuleInclude('public/admin_nav', [
            'title'     => MyLang('pluginsadmin.base_nav_title').(empty($data['id']) ? MyLang('created_title') : MyLang('edit_title')),
            'back_url'  => MyUrl('admin/pluginsadmin/index', $params)
        ])}}
        <!-- nav end -->
        <!-- form start -->
        <form class="am-form form-validation am-form-full-screen am-form-popup-sticky" action="{{:MyUrl('admin/pluginsadmin/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/pluginsadmin/index')}}" enctype="multipart/form-data">
            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_plugins')}}<span class="am-form-group-label-tips-must">*</span><span class="am-form-group-label-tips">{{:MyLang('common_service.pluginsadmin.form_item_plugins_tips')}}</span></label>
                <input type="text" name="plugins" placeholder="{{:MyLang('common_service.pluginsadmin.form_item_plugins_message')}}" minlength="2" maxlength="60" data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_plugins_message')}}" pattern="^[a-z0-9_]{2,60}$" class="am-radius" {{if !empty($plugins)}} value="{{$plugins}}"{{/if}} readonly="true" required />
            </div>

            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_logo')}}<span class="am-form-group-label-tips-must">*</span><span class="am-form-group-label-tips">{{:MyLang('common_service.pluginsadmin.form_item_logo_tips')}}</span></label>
                <div class="am-form-file-upload-container">
                    <ul class="plug-file-upload-view plugins-logo-view" data-form-name="logo" data-max-number="1" data-dialog-type="images" data-is-eye="1">
                        <li class="plug-file-upload-submit" data-view-tag="ul.plugins-logo-view">
                            {{if empty($data['logo'])}}
                                <i class="iconfont icon-add"></i>
                            {{else /}}
                                <input type="text" name="logo" value="{{$data.logo}}" />
                                <img src="{{$data.logo}}" />
                                <i class="iconfont icon-close"></i>
                                <i class="iconfont icon-eye"></i>
                            {{/if}}
                        </li>
                    </ul>
                </div>
            </div>
            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
                <input type="text" name="name" placeholder="{{:MyLang('common_service.pluginsadmin.form_item_name_message')}}" minlength="1" maxlength="80" data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_name_message')}}" class="am-radius" {{if !empty($data['name'])}} value="{{$data.name}}"{{/if}} required />
            </div>
            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_version')}}<span class="am-form-group-label-tips-must">*</span><span class="am-form-group-label-tips">{{:MyLang('common_service.pluginsadmin.form_item_version_tips')}}</span></label>
                <input type="text" name="version" placeholder="{{:MyLang('common_service.pluginsadmin.form_item_version')}}" minlength="5" maxlength="18" data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_version_message')}}" pattern="{{:MyConst('common_regex_version')}}" class="am-radius" {{if !empty($data['version'])}} value="{{$data.version}}"{{/if}} required />
            </div>

            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_author')}}<span class="am-form-group-label-tips-must">*</span></label>
                <input type="text" name="author" placeholder="{{:MyLang('common_service.pluginsadmin.form_item_author_message')}}" minlength="1" maxlength="80" data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_author_message')}}" class="am-radius" {{if !empty($data['author'])}} value="{{$data.author}}"{{/if}} required />
            </div>
            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_author_url')}}<span class="am-form-group-label-tips-must">*</span><span class="am-form-group-label-tips">{{:MyLang('common_service.pluginsadmin.form_item_author_url_tips')}}</span></label>
                <input type="url" placeholder="{{:MyLang('common_service.pluginsadmin.form_item_author_url_tips')}}" name="author_url"  data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_author_url_message')}}" class="am-radius" {{if !empty($data['author_url'])}} value="{{$data.author_url}}"{{/if}} required />
            </div>

            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_desc')}}<span class="am-form-group-label-tips-must">*</span></label>
                <textarea rows="2" name="desc" class="am-radius am-field-valid" placeholder="{{:MyLang('common_service.pluginsadmin.form_item_desc_message')}}" minlength="2" maxlength="255" data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_desc_message')}}">{{if !empty($data['desc'])}}{{$data.desc}}{{/if}}</textarea>
            </div>

            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_apply_terminal')}}<span class="am-form-group-label-tips-must">*</span></label>
                <div class="am-checkbox-group am-flex am-gap-12 am-flex-warp">
                    {{foreach :MyConst('common_platform_type') as $v}}
                        <label class="am-checkbox-inline">
                            <input type="checkbox" name="apply_terminal" value="{{$v.value}}" data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_apply_terminal_message')}}" {{if isset($data['apply_terminal']) and in_array($v['value'], $data['apply_terminal'])}}checked{{/if}} data-am-ucheck required /> {{$v.name}}
                        </label>
                    {{/foreach}}
                </div>
            </div>

            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_apply_version')}}<span class="am-form-group-label-tips-must">*</span></label>
                <div class="am-checkbox-group am-flex am-gap-12 am-flex-warp">
                    {{foreach :MyConst('common_system_version_list') as $v}}
                        <label class="am-checkbox-inline">
                            <input type="checkbox" name="apply_version" value="{{$v.value}}" data-validation-message="{{:MyLang('common_service.pluginsadmin.form_item_apply_version_message')}}" {{if isset($data['apply_version']) and in_array($v['value'], $data['apply_version'])}}checked{{/if}} data-am-ucheck required /> {{$v.name}}
                        </label>
                    {{/foreach}}
                </div>
            </div>

            <div class="am-form-group">
                <label class="am-block">{{:MyLang('common_service.pluginsadmin.form_item_is_home')}}<span class="am-form-group-label-tips">{{:MyLang('common_service.pluginsadmin.form_item_is_home_tips')}}</span></label>
                <input name="is_home" value="1" type="checkbox" data-off-text="{{:MyLang('no_title')}}" data-on-text="{{:MyLang('yes_title')}}" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if isset($data['is_home']) and $data['is_home'] eq 1}}checked="true"{{/if}} />
            </div>

            <div class="am-form-popup-submit">
                <input type="hidden" name="id" {{if !empty($data['id'])}}value="{{$data.id}}"{{/if}} />
                <a href="{{:MyUrl('admin/pluginsadmin/index', $params)}}" class="am-btn am-btn-warning am-radius am-btn-xs am-margin-right-lg">
                    <i class="am-icon-mail-reply"></i>
                    <span>{{:MyLang('retreat_title')}}</span>
                </a>
                <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')}}