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

{% block title %}{{'student.profile'|trans}}{% endblock %}

{% block body %}

<table class="table table-striped table-condenseda table-bordered">
	{% for field, value in profile %}
		{% if field == 'truename' %}
		<tr>
			<th width="25%">{{'student.profile.truename'|trans}}</th>
			<td>
				{% if profile.truename %}
					{{ profile.truename }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'gender' %}
		<tr>
			<th width="25%">{{'student.profile.gender'|trans}}</th>
			{% if profile.gender == 'male' %}
				<td>{{'student.profile.gender.male'|trans}}</td>
			{% elseif profile.gender == 'female' %}
				<td>{{'student.profile.gender.female'|trans}}</td>
			{% elseif profile.gender == 'secret' %}
				<td>{{'student.profile.field.empty'|trans}}</td>
			{% endif %}
		</tr>
		{% elseif field == 'job' %}
		<tr>
			<th width="25%">{{'student.profile.job'|trans}}</th>
			<td>
				{% if profile.job %}
					{{ profile.job }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'company' %}
		<tr>
			<th width="25%">{{'student.profile.company'|trans}}</th>
			<td>
				{% if profile.company %}
					{{ profile.company }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'mobile' %}
		<tr>
			<th>{{'student.profile.mobile'|trans}}</th>
			<td>
				{% if profile.mobile %}
					{{ profile.mobile }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'title' %}
		<tr>
			<th>{{'student.profile.title'|trans}}</th>
			<td>
				{% if profile.title %}
					{{ profile.title }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'signature' %}
		<tr>
			<th>{{'student.profile.signature'|trans}}</th>
			<td>
				{% if profile.signature %}
					{{ profile.signature }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'about' %}
		<tr>
			<th>{{'student.profile.about'|trans}}</th>
			<td>
				{% if profile.about %}
					<div class="editor-text">
					{{ profile.about }}
					</div>
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'weibo' %}
		<tr>
			<th>{{'student.profile.weibo'|trans}}</th>
			<td>
				{% if profile.weibo %}
					{{ profile.weibo }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'weixin' %}
		<tr>
			<th>{{'student.profile.weixin'|trans}}</th>
			<td>
				{% if profile.weixin %}
					{{ profile.weixin }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% elseif field == 'qq' %}
		<tr>
			<th>QQ</th>
			<td>
				{% if profile.qq %}
					{{ profile.qq }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% endif %}
	{% for userField in userFields %}
		{% if field == userField.fieldName %}
		<tr>
			<th>{{userField.title}}</th>
			<td>
				{% if profile[userField.fieldName] %}
					{{ profile[userField.fieldName] }}
				{% else %}
					{{'student.profile.field.empty'|trans}}
				{% endif %}
			</td>
		</tr>
		{% endif %}
	{% endfor %}
	{% endfor %}

</table>

{% endblock %}

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