{% load i18n %}

{% trans "Имя" as p_name  %}
{% trans "Фамилия" as p_lastname  %}
{% trans "Телефон" as p_tel  %}
{% trans "Пароль" as p_password  %}
{% trans "Подтвердить пароль" as p_con_password  %}

<section class="register">
    <h1>{% translate "Регистрация" %}</h1>

    <form name="registration_form" method="POST">
        {% csrf_token %}


          <div class="inputs">
            <div class="inp_firstname">
                <input
                        name="firstname"
                        onkeydown  = "hideErrors(this)"
                        type="text"
                        placeholder="{{ p_name }}"
                        {% if form.data.firstname %} value="{{ form.data.firstname }}"{% endif %}>

                {% if form.errors and form.errors.firstname %}
                    <span>{{ form.errors.firstname }}</span>
                {% endif %}

            </div>
            <div><input
                    name="lastname"
                    onkeydown  = "hideErrors(this)"
                    type="text"
                    placeholder="{{ p_lastname }}"
                    {% if form.data.lastname %} value="{{ form.data.lastname }}"{% endif %}>

                {% if form.errors and form.errors.lastname %}
                    <span>{{ form.errors.lastname }}</span>
                {% endif %}
            </div>

          </div>
          <div class="inputs">
            <div class="inp_firstname">
                <input
                        name="email"
                        onkeydown  = "hideErrors(this)"
                        type="text"
                        placeholder="E-mail"
                        {% if form.data.email %} value="{{ form.data.email }}"{% endif %}>

                {% if form.errors and form.errors.email %}
                    <span>{{ form.errors.email }}</span>
                {% endif %}
            </div>

            <div><input
                    name="tel"
                    onkeydown  = "hideErrors(this)"
                    type="text"
                    placeholder="{{ p_tel }}"
                    {% if form.data.tel %} value="{{ form.data.tel }}"{% endif %}>

                {% if form.errors and form.errors.tel %}
                    <span>{{ form.errors.tel|safe }}</span>
                {% endif %}
            </div>
          </div>

          <div class="inputs">
            <div class="inp_firstname">
                <input
                        name="password"
                        onkeydown  = "hideErrors(this)"
                        type="password"
                        placeholder="{{ p_password }}"
                        {% if form.data.password %} value="{{ form.data.password }}"{% endif %}>

                {% if form.errors and form.errors.password %}
                    <span>{{ form.errors.password }}</span>
                {% endif %}
            </div>

            <div><input
                    name="confirm_password"
                    onkeydown  = "hideErrors(this)"
                    type="password"
                    placeholder="{{ p_con_password }}"
                    {% if form.data.confirm_password %} value="{{ form.data.confirm_password }}"{% endif %}>

                {% if form.errors and form.errors.confirm_password %}
                    <span>{{ form.errors.confirm_password }}</span>
                {% endif %}
            </div>

          </div>
                <div class="agree">

                    <div class="checkbox">
                        <input class="custom-checkbox" type="checkbox" id="agreement" name="agreement" value="true" {% if form.data.agreement %} value="{{ form.data.agreement}}"{% endif %}>
                        <label id="agreement_check" for="agreement" onclick="hideErrors(this)"></label>

                    </div>
                      <div class="agree_text">{% translate "Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности" %}</div>
                    {% if form.errors and form.errors.agreement %}
                         <span id="reg_agree_error">{{ form.errors.agreement }}</span>
                     {% endif %}
                </div>
          <div class="button_register">
               <button id="registration" onclick="SendRegistrationForm(this)"> {% translate "Зарегистрироваться" %} </button>
          </div>
    </form>
  </section>



{##}
{##}
{#<div class="registration">#}
{#    <h2>Регистрация</h2>#}
{##}
{#    <div class="form_radio_btn">#}
{##}
{#        <input id="radio-1" type="radio" name="radio" value="1" checked>#}
{#	    <label for="radio-1">Перевозчик</label>#}
{##}
{#    </div>#}
{#    <div class="form_radio_btn">#}
{#	    <input id="radio-2" type="radio" name="radio" value="2">#}
{#	    <label for="radio-2">Отправитель</label>#}
{#    </div>#}
{##}
{#    <form action="">#}
{#        {% csrf_token %}#}
{#         <div class="reg_inputs">#}
{#             <label><input name="firstname" type="text" placeholder="Имя"{% if form.data.firstname %} value="{{ form.data.firstname }}"{% endif %}></label>#}
{#             {% if form.errors and form.errors.firstname %}#}
{#                 <span>{{ form.errors.firstname }}</span>#}
{#             {% endif %}#}
{#             <label><input name="email" type="text" placeholder="E-mail"{% if form.data.email %} value="{{ form.data.email }}"{% endif %}></label>#}
{#            {% if form.errors and form.errors.email %}#}
{#                 <span>{{ form.errors.email }}</span>#}
{#             {% endif %}#}
{#             <label><input name="password" type="text" placeholder="Пароль"{% if form.data.password %} value="{{ form.data.password }}"{% endif %}></label>#}
{#            {% if form.errors and form.errors.password %}#}
{#                 <span>{{ form.errors.password }}</span>#}
{#             {% endif %}#}
{#             <label><input name="lastname" type="text" placeholder="Фамилия"{% if form.data.lastname %} value="{{ form.data.lastname }}"{% endif %}></label>#}
{#            {% if form.errors and form.errors.lastname %}#}
{#                 <span>{{ form.errors.lastname }}</span>#}
{#             {% endif %}#}
{#             <label><input name="tel" type="text" placeholder="Телефон"{% if form.data.tel %} value="{{ form.data.tel }}"{% endif %}></label>#}
{#            {% if form.errors and form.errors.tel %}#}
{#                 <span>{{ form.errors.tel }}</span>#}
{#             {% endif %}#}
{#             <label><input name="confirm_password" type="text" placeholder="Подтвердить пароль"{% if form.data.confirm_password %} value="{{ form.data.confirm_password }}"{% endif %}></label>#}
{#            {% if form.errors and form.errors.confirm_password %}#}
{#                 <span>{{ form.errors.confirm_password }}</span>#}
{#             {% endif %}#}
{#         </div>#}
{##}
{#            <input type="checkbox"> <p>Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности</p>#}
{##}
{#        <div class="reg_button">#}
{#            <button id="registration" onclick="SendRegistrationForm(this)"> Зарегистрироваться </button>#}
{#        </div>#}
{#    </form>#}
{##}
{##}
{##}
{#</div>#}