{% extends 'old-bootstrap-modal-layout.html.twig' %}

{% block title %}{{'个人详细信息'|trans}}{% endblock %}

{% block body %}

<table class="table table-striped table-condenseda table-bordered">
  <tr>
    <th width="25%">{{'用户名'|trans}}</th>
    <td width="75%">
      <a class="pull-right link-primary" href="{{ path('user_show', {id:user.id}) }}" target="_blank">{{'个人主页'|trans}}</a>
      {{ user.nickname }}
    </td>
  </tr>

  <tr>
    <th>Email</th>
    <td>
      {% set emailArr = user.email|split('@') %}
        {% if emailArr[1] != 'edusoho.net' %}
          {{ user.email }}
        {% else %}
          {{'暂无'|trans}}
        {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'姓名'|trans}}</th>
    <td>
      {% if profile.truename %}
        {{ profile.truename }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'性别'|trans}}</th>
    <td>
      {% if profile.gender == 'mail' %}
        {{'男'|trans}}
      {% elseif profile.gender == 'femail' %}
        {{'女'|trans}}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'公司'|trans}}</th>
    <td>
      {% if profile.company %}
        {{ profile.company }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'职业'|trans}}</th>
    <td>
      {% if profile.job %}
        {{ profile.job }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'头衔'|trans}}</th>
    <td>
    {% if profile.title %}
        {{ profile.title }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'电话'|trans}}</th>
    <td>
    {% if profile.mobile %}
        {{ profile.mobile }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'个人签名'|trans}}</th>
    <td>
    {% if profile.signature %}
        {{ profile.signature }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'自我介绍'|trans}}</th>
    <td>
    {% if profile.about %}
        <div class="editor-text">
        {{ profile.about | raw }}
        </div>
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'个人网站'|trans}}</th>
    <td>
      {% if profile.site %}
        {{ profile.site }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'微博'|trans}}</th>
    <td>
      {% if profile.weibo %}
        {{ profile.weibo }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>{{'微信'|trans}}</th>
    <td>
      {% if profile.weixin %}
        {{ profile.weixin }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>QQ</th>
    <td>
      {% if profile.qq %}
        {{ profile.qq }}
      {% else %}
        {{'暂无'|trans}}
      {% endif %}
    </td>
  </tr>

  {% for userField in userFields if userField %}
    <tr>
      <th width="25%">{{userField.title}}</th>
      <td>
        {% if profile[userField.fieldName] %}
          {% if userField.type=="date"%}
            {{ profile[userField.fieldName]|date("Y-m-d") }}
          {% else %}
            {{ profile[userField.fieldName] }}
          {% endif %}
        {% else %}
          {{'暂无'|trans}}
        {% endif %}
      </td>
    </tr>
  {% endfor %}
  
  </table>
</table>

{% endblock %}

{% block footer %}
  <button type="button" class="btn btn-primary" data-dismiss="modal">{{'关闭'|trans}}</button>
{% endblock %}