{% extends "base_content.html" %}
<!-- complete.html -->
{% load i18n %}
{% block head %}{% endblock %}
{% block title %}{% spaceless %}{% trans "Connect your OpenID with this site" %}{% endspaceless %}{% endblock %}
{% block content %}
    <div id="main-bar" class="headNormal">
		{% trans "Connect your OpenID with your account on this site" %}
    </div>      
	<div id="completetxt" >
        <div class="message">
            {# Only display the OpenID greeting if a provider is detected. #}
            {% if provider %}
                <p>
                    <b>{% trans "You are here for the first time with " %}{{ provider }}</b>
                </p>
            {% endif %}
            <p>
                {% trans "Please choose your screen name and confirm your email address. A valid email address is necessary to receive notifications about activity in the areas of this community you're most interested in, and will help you become an involved participant in this community." %}
            </p>
        </div>
    	<p style="display:none">{% trans "This account already exists, please use another." %}</p>
	</div>

	{% if form1.errors %}
        <ul class="errorlist">
        {% if form1.non_field_errors %}
            {% for error in form1.non_field_errors %}
                <li>{{error}}</li>
            {% endfor %}
        {% endif %}
        </ul>
	{% endif %}

	<div class="login">
        <form name="fregister" action="" method="POST">
            {% csrf_token %}
            {{ form1.next }}
            <div class="form-row-vertical margin-bottom">
                <label for="id_username">{{ form1.username.label }}</label>
                {% if form1.username.errors %} 
                    <p class="error">{{ form1.username.errors|join:", " }}</p>
                {% endif %}
                {{ form1.username }}
            </div>
            <div class="form-row-vertical margin-bottom">
                <label for="id_email">{{ form1.email.label }}</label>
                {% if form1.email.errors %} 
                    <p class="error">{{ form1.email.errors|join:", " }}</p>
                {% endif %}
                {{ form1.email }}
            </div>
            <div class="form-row-vertical margin-bottom">
                <label for="id_real_name">{{ form1.real_name.label }}</label>
                {% if form1.real_name.errors %}
                    <p class="error">{{ form1.real_name.errors|join:", " }}</p>
                {% endif %}
                {{ form1.real_name }}
            </div>
            {% if form1.password1 %}
                <div class="form-row-vertical margin-bottom">
                    <label for="password1_id">{{ form1.password1.label }}</label>
                    {% if form1.password1.errors %}
                        <p class="error">{{ form1.password1.errors|join:", " }}</p>
                    {% endif %}
                    {{ form1.password1 }}
                </div>
                <div class="form-row-vertical margin-bottom">
                    <label for="password2_id">{{ form1.password2.label }}</label>
                    {% if form1.password2.errors %} 
                        <p class="error">{{ form1.password2.errors|join:", " }}</p>
                    {% endif %}
                    {{ form1.password2 }}
                </div>
            {% endif %}
            {% if form1.recaptcha %}
                <div class="form-row-vertical margin-bottom">
                <label for="recaptcha_id">{{ form1.recaptcha.label }}</label>
                {% if form1.recaptcha.errors %} 
                    <p class="error">{{ form1.recaptcha.errors|join:", " }}</p>
                {% endif %}
                {{ form1.recaptcha }}
                </div>
            {% endif %}
            <div class="submit-row"><input type="submit" class="submit" name="bnewaccount" id="bnewaccount" value="{% trans "create account" %}"/></div>
		</form>
	</div>
    {% comment %}<!-- this form associates openID with an existing password-protected account, not yet functional -->
    {% if form2 %}
	<div class="login" style="display:none">
        <form name="fverify" action="{% url user_register %}" method="POST">
            {% csrf_token %}
            {{ form2.next }}
			<fieldset style="padding:10px">
				<legend class="big">{% trans "Existing account" %}</legend>
				<div class="form-row"><label for="id_username">{% trans "user name" %}</label><br/>{{ form2.username }}</div>
				<div class="form-row"><label for="id_passwordl">{% trans "password" %}</label><br/>{{ form2.password }}</div>
                <p><span class='big strong'>(Optional) receive updates by email</span> - only sent when there are any.</p>
				<!--todo double check translation from chinese 确认 = "Register" -->
				<div class="submit-row">
					<input type="submit" class="submit" name="bverify" value="{% trans "Register" %}"/> 
					<a href="{% url user_sendpw %}">{% trans "Forgot your password?" %}</a>
				</div>
			</fieldset>
		</form>
	</div>
    {% endif %}
    {% endcomment %}
{% endblock %}
<!-- end complete.html -->
