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

<!-- content start  -->
<div class="am-padding">
    <!-- form start -->
    <form class="am-form form-validation am-form-full-screen am-form-popup-fixed" action="{{:MyUrl('index/usergoodscomments/save')}}" method="POST" request-type="ajax-reload" request-value="parent">
        <div class="am-form-group">
            <label>{{:MyLang('common_service.goodscomments.form_item_goods_info_title')}}</label>
            <div class="goods-info">
                {{if !empty($data['goods'])}}
                    <div class="base am-nbfc">
                        <a href="{{$data.goods.goods_url}}" target="_blank" rel="noopener noreferrer">
                            <img src="{{$data.goods.images}}" alt="{{$data.goods.title}}" class="am-img-thumbnail am-radius am-align-left am-margin-right-xs am-margin-bottom-0 am-fl" width="57" height="57" />
                        </a>
                        <a class="am-text-top am-text-sm am-text-truncate-2" href="{{$data.goods.goods_url}}" target="_blank" rel="noopener noreferrer">{{$data.goods.title}}</a>
                        <p class="am-text-danger">{{$currency_symbol}}{{$data.goods.price}}</p>
                    </div>
                {{else /}}
                    {{:MyLang('gods_info_abnormal_tips')}}
                {{/if}}
            </div>
        </div>

        <div class="am-form-group">
            <label>{{:MyLang('common_service.goodscomments.form_item_rating')}}</label>
            <select name="rating" class="chosen-select" data-placeholder="{{:MyLang('common_service.goodscomments.form_item_rating_placeholder')}}" data-validation-message="{{:MyLang('common_service.goodscomments.form_item_rating_message')}}" required>
                {{if !empty($common_goods_comments_rating_list)}}
                    {{foreach $common_goods_comments_rating_list as $k=>$v}}
                        <option value="{{$k}}" {{if isset($data['rating']) and $data['rating'] eq $k}}selected{{/if}}>{{$v.name}}</option>
                    {{/foreach}}
                {{/if}}
            </select>
        </div>

        <div class="am-form-group">
            <label>{{:MyLang('common_service.goodscomments.form_item_content')}}<span class="am-form-group-label-tips-must">*</span></label>
            <textarea name="content" class="am-radius" rows="4" minlength="6" maxlength="230" placeholder="{{:MyLang('common_service.goodscomments.form_item_content_message')}}" data-validation-message="{{:MyLang('common_service.goodscomments.form_item_content_message')}}" required>{{if !empty($data['content'])}}{{$data.content}}{{/if}}</textarea>
        </div>

        <div class="am-form-group">
            <label class="am-block">{{:MyLang('common_service.goodscomments.form_item_is_anonymous')}}</label>
            <input name="is_anonymous" 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_anonymous']) and $data['is_anonymous'] 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}} />
            <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>
<!-- content end  -->

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