<!-- 用户中心菜单 -->
<div class="user-sidebar am-offcanvas" id="user-offcanvas">
  <div class="am-offcanvas-bar user-offcanvas-bar">
    <ul class="am-list user-sidebar-list">
      {{if !empty($user_left_menu) and is_array($user_left_menu)}}
        {{foreach $user_left_menu as $k=>$v}}
          {{if $v.is_show eq 1}}
            {{if empty($v['item'])}}
              <li class="{{if isset($v['contains']) and ((in_array(strtolower($module_name.$controller_name.$action_name), $v['contains']) and isset($v['is_system']) and $v['is_system'] eq 1 and !isset($params['pluginsname'])) or (isset($params['pluginsname']) and isset($params['pluginscontrol']) and isset($params['pluginsaction']) and in_array(strtolower($params['pluginsname'].$params['pluginscontrol'].$params['pluginsaction']), $v['contains']) and (!isset($v['is_system']) or $v['is_system'] neq 1)))}} am-active{{/if}}" >
                <a href="{{$v.url}}">{{if !empty($v['icon'])}}<i class="{{$v.icon}}"></i>{{/if}} {{$v.name}}</a>
              </li>
            {{else /}}
              <li>
                <a class="am-cf user-item-parent" data-am-collapse="{target: '#collapse-nav-{{$k}}'}">{{if !empty($v['icon'])}}<i class="{{$v.icon}}"></i>{{/if}} {{$v.name}}<span class="am-icon-angle-down am-fr am-margin-right"></span></a>
                <ul class="am-list am-collapse user-sidebar-sub am-in" id="collapse-nav-{{$k}}">
                  {{foreach $v.item as $vs}}
                    {{if $vs.is_show eq 1}}
                      <li class="{{if isset($vs['contains']) and ((in_array(strtolower($module_name.$controller_name.$action_name), $vs['contains']) and isset($vs['is_system']) and $vs['is_system'] eq 1 and !isset($params['pluginsname'])) or (isset($params['pluginsname']) and isset($params['pluginscontrol']) and isset($params['pluginsaction']) and in_array(strtolower($params['pluginsname'].$params['pluginscontrol'].$params['pluginsaction']), $vs['contains']) and (!isset($vs['is_system']) or $vs['is_system'] neq 1)))}} am-active{{/if}}">
                        <a href="{{$vs.url}}" class="am-cf">{{if !empty($vs['icon'])}}<i class="{{$vs.icon}}"></i>{{/if}} {{$vs.name}}</a>
                      </li>
                    {{/if}}
                  {{/foreach}}
                </ul>
              </li>
            {{/if}}
          {{/if}}
        {{/foreach}}
      {{/if}}
    </ul>
  </div>
</div>
<a href="javascript:;" class="am-icon-btn am-icon-th-list am-show-sm-only user-menu" data-am-offcanvas="{target: '#user-offcanvas'}"></a>

<!-- 用户头像修改 -->
<div class="am-popup common-cropper-popup" id="user-avatar-popup">
    <div class="am-popup-inner">
        <div class="am-popup-hd meila-radius">
            <h4 class="am-popup-title">头像上传</h4>
            <span data-am-modal-close class="am-close">&times;</span>
        </div>
        <div class="am-popup-bd">
            <form class="am-form form-validation-user-avatar view-save" action="{{:MyUrl('index/user/useravatarupload')}}" method="POST" request-type="ajax-reload" enctype="multipart/form-data">
                <div class="cropper-images-view">
                    <div class="img-container am-fl user-avatar-img-container">
                        <img src="{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/default-user-avatar.jpg" alt="Picture" />
                    </div>
                    <div class="img-preview preview-lg am-fl am-radius user-avatar-img-preview am-hide-sm-only"></div>
                    <div class="img-preview preview-md am-fl am-radius user-avatar-img-preview "></div>
                    <div class="img-preview preview-sm am-fl am-radius user-avatar-img-preview "></div>
                    <input type="hidden" name="img_x" id="user-avatar-img_x" />
                    <input type="hidden" name="img_y" id="user-avatar-img_y" />
                    <input type="hidden" name="img_width" id="user-avatar-img_width" />
                    <input type="hidden" name="img_height" id="user-avatar-img_height" />
                    <input type="hidden" name="img_rotate" id="user-avatar-img_rotate" />
                </div>
                <div class="submit-operation">
                    <button type="button" class="am-btn am-btn-default am-fl am-icon-search-plus am-icon-sm am-btn-xs am-radius" data-method="zoom" data-option="0.1"></button>
                    <div class="am-form-group am-form-file am-fl am-form-group-refreshing">
                        <button type="button" class="am-btn am-btn-default am-btn-sm cropper-input-images-submit">
                        <i class="am-icon-cloud-upload"></i> 选择图片</button>
                        <input type="file" name="file" multiple accept="image/gif,image/jpeg,image/jpg,image/png" data-validation-message="请选择需要上传的图片" required  />
                    </div>
                    <button type="button" class="am-btn am-btn-default am-fl am-icon-search-minus am-icon-sm am-btn-xs am-radius" data-method="zoom" data-option="-0.1"></button>
                </div>

                <button type="submit" class="am-btn am-btn-primary am-btn-sm am-radius head-submit btn-loading-example am-margin-top-sm" data-am-loading="{loadingText: '上传中...'}">确认上传</button>
            </form>
            <div class="am-alert am-alert-secondary" data-am-alert>
              <p>请在工作区域放大缩小及移动选取框，选择要裁剪的范围，裁切宽高比例固定；</p>
              <p>裁切后的效果为右侧预览图所显示；</p>
              <p>确认提交后生效。</p>
            </div>
        </div>
    </div>
</div>