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

{% block title %}{{'course.members_manage.official_student.show.content_title'|trans}}{% endblock %}

{% block body %}

<table class="table table-striped table-condenseda table-bordered">
	<tr>
		<th width="25%">{{'user.fields.username_label'|trans}}</th>
		<td width="75%">
			<a class="pull-right link-primary" href="{{ path('user_show', {id:user.id}) }}" target="_blank">{{'user.btn.homepage'|trans}}</a>
			{{ user.nickname }}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.email_label'|trans}}</th>
		<td>
	      {% if not is_system_generated_email(user.email) %}
	        {{ user.email }}
	      {% else %}
	        {{'site.datagrid.empty'|trans}}
	      {% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.truename_label'|trans}}</th>
		<td>
			{% if profile.truename %}
				{{ profile.truename }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.gender_label'|trans}}</th>
		<td>
			{% if profile.gender == 'mail' %}
				{{'user.fields.gender.male'|trans}}
			{% elseif profile.gender == 'femail' %}
				{{'user.fields.gender.female'|trans}}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.company_label'|trans}}</th>
		<td>
			{% if profile.company %}
				{{ profile.company }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.career_label'|trans}}</th>
		<td>
			{% if profile.job %}
				{{ profile.job }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.title_label'|trans}}</th>
		<td>
		{% if profile.title %}
				{{ profile.title }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.phone_label'|trans}}</th>
		<td>
		{% if profile.mobile %}
				{{ profile.mobile }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.sign_label'|trans}}</th>
		<td>
		{% if profile.signature %}
				{{ profile.signature }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.introduction_label'|trans}}</th>
		<td>
		{% if profile.about %}
				<div class="editor-text">
				{{ profile.about|cdn|raw }}
				</div>
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fields.web_site_label'|trans}}</th>
		<td>
			{% if profile.site %}
				{{ profile.site }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fileds.microblog'|trans}}</th>
		<td>
			{% if profile.weibo %}
				{{ profile.weibo }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fileds.wechat'|trans}}</th>
		<td>
			{% if profile.weixin %}
				{{ profile.weixin }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>

	<tr>
		<th>{{'user.fileds.qq'|trans}}</th>
		<td>
			{% if profile.qq %}
				{{ profile.qq }}
			{% else %}
				{{'site.datagrid.empty'|trans}}
			{% endif %}
		</td>
	</tr>
{% if userFields %}
	{% for userField in userFields %}
	<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 %}
				{{'site.datagrid.empty'|trans}}
		  {% endif %}
		</td>
	</tr>
  {% endfor %}
  {% endif %}
  </table>
</table>

{% endblock %}

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