{% extends "template.html" %}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

{% block body %}
<div>
{% set rows = int(REQ.get("rows", SHOW_ROWS)) %}
{% set lng = REQ.get("lang", LANG) %}

{% set ret = set_rows_and_lang(rows, lng) %}
{% set SHOW_ROWS = ret[0] %}
{% set LANG = ret[1] %}
{% set error = set_password(REMOTE_LOGIN, REQ) %}

<form action="settings.html" method="post">
<table style="width: 50%">
<tr>
  <td colspan="2" style="text-align: center">
    <h1 style="text-align: center">{{ _('User settings') }}</h1></td>
</tr>
{% if error %}
<tr>
<td colspan="2" style="text-align: center"><hr/>{{ error }}</td>
</tr>
{% endif %}
<tr><td colspan="2"><hr/></td></tr>
<tr>
  <td colspan="2" style="text-align: center">
    <h3 style="text-align: center">{{ _('Password change') }}</h3></td>
</tr>
<tr>
  <td style="text-align: right">{{ _('Old password:') }}</td>
  <td><input type="password" name="old"/></td>
</tr>
<tr>
  <td style="text-align: right">{{ _('New password:') }}</td>
  <td><input type="password" name="new"/></td>
</tr>
<tr>
  <td style="text-align: right">{{ _('Retype new password:') }}</td>
  <td><input type="password" name="retyped"/></td>
</tr>
<tr><td colspan="2"><hr/></td></tr>
<tr>
  <td colspan="2" style="text-align: center">
    <h3 style="text-align: center">{{ _('Other settings') }}</h3></td>
</tr>
<tr><td style="text-align: right">{{ _('Language:') }}</td><td>
<select name="lang">
{% for lng in LANGS -%}
<option value="{{ lng }}"
{%- if lng==LANG -%}selected="selected"{%- endif -%}
>{{ lng }}</option>
{%- endfor %}
</select>
</td></tr>
<tr>
  <td style="text-align: right">{{ _('Show rows:') }}</td>
  <td><input type="text" name="rows" size="3" value="{{ SHOW_ROWS }}"/></td>
</tr>
<tr><td colspan="2"><hr/></td></tr>
<tr><td colspan="2" style="text-align: center"><input type="submit" value="Save settings" class="submit"/></td></tr>
</table>
</form>
</div>
{% endblock %}

</html>
