{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "users/base.html" %}
{% from "layout/errorlist.html" import errorlist %}
{% set title = _('Register') %}
{% set classes = 'register' %}

{% block content %}
<section id="content">
  <div class="wrap">
    <section id="content-main" role="main">
      <article id="browser_register" class="main">
  
        <h1>{{ _('BrowserID is here!') }}</h1>
        <p>{% trans browserid_href='https://browserid.org/', why_browserid='http://identity.mozilla.com/post/12950196039/deploying-browserid-at-mozilla' %}
        MDN has switched to <a href="{{ browserid_href }}" rel="external">BrowserID</a>, 
        a safe and simple way to sign in with just your e-mail address. <a href="{{ why_browserid }}" rel="external">Learn more about it.</a>
        {% endtrans %}</p> 
    
    
        <form id="create_user" class="boxed" method="post" action="">
          <h2>{{ _('New MDN Members') }}</h2>
          <p>{% trans %}
            We couldn't find an MDN profile for your BrowserID. If you're new here, 
            you can pick a display name now and complete your registration.
          {% endtrans %}</p>
          <p>{% trans %}
            You can access everything on the MDN website even without an account, 
            but when you join you'll be able to edit docs, submit demos, and have 
            your own profile page.
          {% endtrans %}</p>
          {{ errorlist(register_form) }}
          
          {{ csrf() }}
          <input type="hidden" name="action" value="register">
          <fieldset>
            <ul>
              <li>
                <label for="id_username">{{ _('Display name') }}</label>
                {{ register_form.username|safe }}
              </li>
              <li class="submit">
                <button type="submit" name="create">{{ _('Create a New Profile') }}</button>
              </li>
            </ul>
          </fieldset>
        </form>
    
        <form id="existing_user" class="boxed" method="post" action="">
          <h2>{{ _('Returning MDN Members') }}</h2>
          <p>{% trans %}
            If you have an MDN account, log in here to use your
            existing MDN profile. You'll be able to sign in with your BrowserID from 
            now on.
          {% endtrans %}</p>
          {{ errorlist(login_form) }}
          
          {{ csrf() }}
          <input type="hidden" name="action" value="login">
          <fieldset>
            <ul>
              <li>
                <label for="id_username">{{ _('Username') }}</label>
                {{ login_form.username|safe }}
              </li>
              <li>
                <label for="id_password">{{ _('Password') }}</label>
                {{ login_form.password|safe }}
              </li>
              <li class="submit">
                <button type="submit">{{ _('Log In') }}</button>
              </li>
            </ul>
          </fieldset>
        </form>

        <form id="forgot_email" class="boxed" method="post" action="{{ url('users.send_email_reminder') }}">
          <h2>{{ _('Forgot your email?') }}</h2>
          <p>{% trans %}
            If you have an MDN account, but you've forgotten which email
            address you use on MDN, enter your usname below and we'll send you
            an email reminder.
          {% endtrans %}</p>
          {{ errorlist(login_form) }}

          {{ csrf() }}
          <input type="hidden" name="action" value="remind">
          <fieldset>
            <ul>
              <li>
                <label for="id_username">{{ _('Username') }}</label>
                {{ login_form.username|safe }}
              </li>
              <li class="submit">
                <button type="submit">{{ _('Log In') }}</button>
              </li>
            </ul>
          </fieldset>
        </form>

      </article>
    </section>
  </div>
</section>
{% endblock %}
