{%extends "base/page.html"%}
{%block title%}Edit user profile{%endblock%}
{%block contents%}
<h1>Edit user profile</h1>
<form method="post" action=".">{% csrf_token %}

<table class="pgGenericFormTable">
{%if userform.errors or profileform.errors or contribform.errors %}
 <tr class="errorheader">
  <td colspan="2">Please correct the errors below, and re-submit the form.</td>
 </tr>
{%endif%}
{%for field in userform%}
 {%if field.errors %}
 <tr class="error">
  <td colspan="2">{{field.errors.as_ul}}</td>
 </tr>
 {%endif%}
 <tr {%if field.errors%}class="errorinfo"{%endif%}>
  <th>{{field.label_tag}}{%if field.help_text %}<br/>
   <span class="formfieldhelp">{{field.help_text}}</span>{%endif%}</th>
  <td>{{field}}</td>
 </tr>
{%endfor%}
{%for field in profileform%}
 {%if field.errors %}
 <tr class="error">
  <td colspan="2">{{field.errors.as_ul}}</td>
 </tr>
 {%endif%}
 <tr {%if field.errors%}class="errorinfo"{%endif%}>
  <th>{{field.label_tag}}{%if field.help_text %}<br/>
   <span class="formfieldhelp">{{field.help_text}}</span>{%endif%}</th>
  <td>{{field}}</td>
 </tr>
{%endfor%}
</table>

{%if contribform%}
<h2>Edit contributor information</h2>
<p>
You can edit the information that's shown on the
<a href="/community/contributors/">contributors</a> page. Please be
careful as your changes will take effect immediately.
</p>
<table class="pgGenericFormTable">
{%for field in contribform%}
 {%if field.errors %}
 <tr class="error">
  <td colspan="2">{{field.errors.as_ul}}</td>
 </tr>
 {%endif%}
 <tr {%if field.errors%}class="errorinfo"{%endif%}>
  <th>{{field.label_tag}}{%if field.help_text %}<br/>
   <span class="formfieldhelp">{{field.help_text}}</span>{%endif%}</th>
  <td>{{field}}</td>
 </tr>
{%endfor%}
</table>
{%endif%}

<input type="submit" value="Save" />
</form>
{%endblock%}
