<!DOCTYPE html>
<!--
	Copyright 2012-2013, Marten de Vries

	This file is part of OpenTeacher.

	OpenTeacher is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	OpenTeacher is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with OpenTeacher.  If not, see <http://www.gnu.org/licenses/>.
-->
<html>
	<head>
		<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
		<title>{{ _("OpenTeacher Web - sign up") }}</title>
		<style type='text/css'>
			body {
				margin: 0 auto;
				width: 600px;
				font-family: sans-serif;

				background-color: lightblue;
			}

			p {
				text-align: justify;
			}

			h1, h2 {
				text-align: center;
				margin: 0;
				margin-bottom: 10px;
			}

			#page {
				background-color: white;
				padding: 50px 100px;
			}

			#error {
				color: #ff0000;
			}
		</style>
		<script type='text/javascript'>
			var focus = function () {
				document.getElementById("focusfield").focus();
			};
			var cancel = function () {
				document.location = "{{ redirect }}?status=cancel";
			};
		</script>
	</head>
	<body onload='focus();'>
		<div id='page'>
			<h1>{{ _("OpenTeacher Web") }}</h1>
			<h2>{{ _("Sign up") }}</h2>
			<p>
				{{ _("Welcome to OpenTeacher Web! You can register an account below.") }}
			</p>
			<p id='error'>
				{{ error }}
			</p>
			<form action='{{ url_for("register_send") }}' method='post'>
				<input name='redirect' type='hidden' value='{{ redirect }}' />
				<input name='language' type='hidden' value='{{ language }}' />
				<table>
					<tr>
						<td>{{ _("Username:") }}</td>
						<td>
							<input id='focusfield' type='text' name='username' />
						</td>
					</tr>
					<tr>
						<td>{{ _("Password:") }}</td>
						<td>
							<input type='password' name='password' />
						</td>
					</tr>
					<tr>
						<td colspan='2'>
							{% if not screenshotOnly %}
							{# fetching a captcha is too much overhead when the
						       website is just shown for 'screenshot'
							   purposes. #}
							{{ recaptcha }}
							{% endif %}
						</td>
					</tr>
					<tr>
						<td>
						</td>
						<td>
							{# Setting variables because otherwise xgettext doesn't detect them. #}
							{% set sign_up = _("Sign up!") %}
							{% set cancel = _("Cancel") %}
							<input type='submit' value='{{ sign_up }}' />
							<input type='button' onclick='cancel();' value='{{ cancel }}'>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</body>
</html>
