{* Страница регистрации *}

{$meta_title = "Регистрация" scope=parent}

{literal}
<script src="https://www.google.com/recaptcha/api.js?render=6LegdywdAAAAADKhWf40ZE7xYCwRlvVg_mg3Ot0q"></script>
<script>
    grecaptcha.ready(function () {
        grecaptcha.execute('6LegdywdAAAAADKhWf40ZE7xYCwRlvVg_mg3Ot0q', { action: 'contact' }).then(function (token) {
            var recaptchaResponse = document.getElementById('recaptchaResponse');
            recaptchaResponse.value = token;
        });
    });
</script>
{/literal}

<div class="title">Регистрация</div>
<div class="well">
{if $error}
<div class="message_error">
	{if $error == 'empty_name'}Введите имя
	{elseif $error == 'empty_email'}Введите email
	{elseif $error == 'empty_password'}Введите пароль
	{elseif $error == 'user_exists'}Пользователь с таким email уже зарегистрирован
	{elseif $error == 'captcha'}Неверно введена капча
    {elseif $error == 'recaptcha'}Вы не прошли проверку защиты
	{else}{$error}{/if}
</div>
{/if}

<form class="form register_form form-horizontal" method="post">
<div class="form-group">
	<label for="name" class="col-sm-2 control-label">Имя</label>
	<div class="col-sm-10"><input class="form-control" type="text" name="name" data-format=".+" data-notice="Введите имя" value="{$name|escape}" maxlength="255" /></div>
</div>
<div class="form-group">	
	<label for="email" class="col-sm-2 control-label">Email</label>
	<div class="col-sm-10"><input class="form-control" type="text" name="email" data-format="email" data-notice="Введите email" value="{$email|escape}" maxlength="255" /></div>
</div>
<div class="form-group">
    <label for="password" class="col-sm-2 control-label">Пароль</label>
    <div class="col-sm-10"><input class="form-control" type="password" name="password" data-format=".+" data-notice="Введите пароль" value="" /></div>
</div>
	<input type="submit" class="btn btn-danger pull-right" name="register" value="Зарегистрироваться">
    <input type="hidden" name="recaptcha_response" id="recaptchaResponse">
</form>
</div>
