<div class="reg_pass" id="backImg">
  <div class="educontent realheight" id="realheight">
    <div class="clearfix font-16 mb30 title_detail">
      <a style="<%= @user.lastname.blank? ? 'cursor: default;' : '' %>" href="<%= @user.lastname.blank? ? "javascript:void(0)" : home_path %>" class="none"><img src="/images/educoder/logo.png" class="fl"/></a>
      <span class="fr">
        <% if !@user.authentication && (@apply_user_auth.nil? || @apply_user_auth.status == 2 || @apply_user_auth.status == 3) %>
          1.填写实名信息
        <% elsif !@user.authentication && @apply_user_auth.try(:status) == 0 %>
          2.等待人工审核
        <% elsif @user.authentication %>
          3.实名认证结果
        <% end %>
        <% unless @user.lastname.blank? %>
          <em class="vertical-line ml5 mr5"></em><a href="<%= my_account_path %>" class="color-blue">返回</a>
        <% end %>
      </span>
    </div>
    <div class="account_main">
      <div class="account_title">实名信息</div>
      <div id="bind_info">
        <% if !@user.authentication && (@apply_user_auth.nil? || @apply_user_auth.status == 3) %>
          <p class="color-orange-tip mt15 mb15 edu-txt-center">温馨提示:尊敬的用户,您提交的数据将会被加密,请放心填写。</p>
        <% end %>
        <% if !@user.authentication && @apply_user_auth.try(:status) == 2 %>
          <p class="color-orange-tip mt15 mb15 edu-txt-center">实名认证未通过:<%= @apply_user_auth.remarks %></p>
        <% end %>
        <% if !@user.authentication && (@apply_user_auth.nil? || @apply_user_auth.status == 2 || @apply_user_auth.status == 3) %>
          <%= form_for :user, :url => apply_auth_account_path, :method => :post, :html => {:id => 'my_user_auth_form'} do |f| %>
            <ul class="abouttable clearfix">
              <li class="clearfix">
                <% if @user.certification == 1 %>
                  <input type="hidden" id="user_certi_real_name" value="<%= @user.lastname+@user.firstname %>">
                <% end %>
                <label class="rz-label fl"><span class="color-orange">* </span>真实姓名:</label>
                <input type="text" id="lastname" name="lastname" maxlength="20" class="winput-240-45 fl" placeholder="填写您的真实姓名" value="<%= @user.lastname+@user.firstname %>">
                <p class="notice color-orange fl mb5"><span class="falseInfo none"><i class="fa fa-minus-circle mt7 mr5 fl"></i>姓名不能为空</span></p>
              </li>
              <li class="clearfix">
                <label class="rz-label fl"><span class="color-orange">* </span>身份证号:</label>
                <input type="text" id="ID_number" name="ID_number" value="<%= @user.ID_number %>" maxlength="18" class="winput-240-45 fl" placeholder="填写您的身份证号">
                <p class="notice color-orange fl mb5"><span class="falseInfo none"><i class="fa fa-exclamation-circle mt7 mr5 fl"></i>身份证号填写错误</span></p>
              </li>
              <li class="clearfix">
                <label class="minh-label fl">持身份证正面头部照:</label>
                <div class="color-grey fl font-12 pr" id="shili_image">
                  <%= image_tag(url_to_auth_img(@user.id, 'ID'), :width => 120, :height => 70, :id => 'ren_zheng_image', :class => "radius4 fl") %>
                </div>
              </li>
              <li class="clearfix mt10">
                <label class="minh-label fl">&nbsp;</label>
                <div class="pr fl none" id="upload_img_file">
                  <%= image_tag(url_to_auth_img(0, 'ID'), :width => 120, :height => 70, :id => 'nh_source_id',:class=>"radius4") %>
                  <a href="javascript:void(0)" onclick="$('#upload_img_id').click();" class="changephotos radius4">更换照片</a>
                </div>

                <%= file_field_tag 'avatar[image]',
                                   :id => "upload_img_id",
                                   :style => 'display:none;',#added by young
                                   :size => "1",
                                   :multiple => false,
                                   :onchange => 'addInputAvatar(this);',
                                   :data => {
                                       :max_file_size => Setting.authentication_img_max_size.to_i.kilobytes,
                                       :max_file_size_message => l(:error_user_auth_too_big, :max_size => number_to_human_size(Setting.authentication_img_max_size.to_i.kilobytes)),
                                       :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
                                       :file_type => Redmine::Configuration['pic_types'].to_s,
                                       :type_support_message => l(:error_pic_type),
                                       :upload_path => upload_avatar_path(:format => 'js'),
                                       :description_placeholder => nil ,# l(:label_optional_description)
                                       :source_type => 'UserAuthentication',
                                       :source_id => @user.id.to_s,
                                       :auth_type => 'ID',
                                       :is_direct => 1
                                   } %>
                <input type="hidden" value="<%= File.exist?(disk_auth_filename('UserAuthentication', @user.id, 'ID')) ? 1 : 0 %>" name="upload_img" id="upload_img_id_sign" />
                <a href="javascript:void(0);" onclick="$('#upload_img_id').click();" id="choose_file" class="choosefile fl">+选择文件</a>
              </li>
              <li class="clearfix">
                <label class="rz-label fl">&nbsp;</label>
                <p class="color-grey-6 fl font-12">请上传身份证正面的原件照片,确保清晰可辨认。<br/>或者出具其它等效证明照片,确保清晰可辨认。<br/>png/jpg/bmp格式,不超过2MB<br/>照片在审核完成后将立即清除</p>
                <p class="notice color-orange fl mb5 none" id="upload_img_id_sign_notice"><span class="falseInfo"><i class="fa fa-exclamation-circle mt7 mr5 fl"></i>请上传证件照片</span></p>
              </li>
              <input type="hidden" name="save_or_submit" id="save_or_submit" value="0">
              <li class="clearfix mt20 mb40 pl20 pr20" style="box-sizing:  border-box;">
                <a href="javascript:void(0);" class="submit_save_btn" id="user_auth_save_a">保存信息</a>
                <a href="javascript:void(0);" class="submit_btn" id="user_auth_submit_a">提交认证</a>
              </li>
            </ul>
          <% end %>
        <% elsif (!@user.authentication && @apply_user_auth.try(:status) == 0) || @user.authentication %>
          <ul class="ml30 mr30 clearfix pt30">
            <li class="clearfix mb15">
              <label class="with50 pr5 edu-txt-right fl color-grey-9">
                <span class="color-orange">* </span>真实姓名:
              </label>
              <span class="fl pl5 with50 edu-txt-left"><%= @user.lastname+@user.firstname %></span>
            </li>
            <li class="clearfix mb25">
              <label class="with50 pr5 edu-txt-right fl color-grey-9"><span class="color-orange">* </span>身份证号:</label>
              <span class="fl pl5 with50 edu-txt-left"><%= @user.ID_number %></span>
            </li>
            <li class="clearfix edu-txt-center mb25">
              <div class="pr inline">
                <%= image_tag(url_to_auth_img(@user.id, 'ID'), :width => 160, :height => 110, :class => "radius4 fl", :id => 'upload_id_image') %>
              </div>
            </li>
            <% if !@user.authentication && @apply_user_auth.try(:status) == 0 %>
                <p class="color-orange-tip edu-txt-center font-16 mb25">审核中</p>
              <a href="javascript:void(0);" class="all_submit_btn" onclick="s_op_confirm_box('<%= cancel_pro_apply_account_path(:auth_type => 1) %>', '是否确定撤销提交的实名认证申请')">撤销认证</a>
            <% elsif @user.authentication %>
                <p class="color-green edu-txt-center font-16 mb25">审核已通过</p>
              <span style="background: #ccc" class="all_submit_btn">已完成认证</span>
            <% end %>
          </ul>
        <% end %>
      </div>
    </div>
    <%= render :partial => "account/copyright_info" %>
  </div>
</div>