<div class="form_wrapper">
  <form name="create_user" method="POST" action="${h.get_redirect_url(u'user')}">
    ${h.field_token()|n}

    <% randomizeid_user_names = h.config.get_bool('adhocracy.force_randomized_user_names') %>
    %if not randomized_user_names:
    <fieldset>
      <legend>${_("User name")}</legend>
      <p class="info">${_("Can only contain letters and numbers.")}</p>
      <div class="input_wrapper">
        <input type="text" autofocus="autofocus" name="user_name" />
      </div>
    </fieldset>
    %endif
    %if h.config.get_bool('adhocracy.set_display_name_on_register'):
    <fieldset>
      <legend>${_("Display name")}</legend>
      <p class="info">${_("You can choose which name other users see.")}</p>
      <div class="input_wrapper">
        <input type="text" class="title" name="display_name"
               ${u'autofocus="autofocus"' if randomized_user_names else u''|n} />
      </div>
    </fieldset>
    %endif

    <fieldset>
      <legend>${_("E-mail")}</legend>
      <div class="input_wrapper">
        <input type="text" name="email" />
      </div>
    </fieldset>

    <fieldset>
      <legend>${_("Password")}</legend>
      <div class="input_wrapper">
        <label for="password">${_("Enter password:")}</label>
        <input type="password" name="password" />
        <label for="password_confirm">${_("Password (confirm):")}</label>
        <input type="password" name="password_confirm" />
      </div>
    </fieldset>

    <p>
      %if c.agree_text is None:
        ${_("By registering, you agree with the %s.") % ("<a class='staticlink_terms' href='/static/terms.html'>%s</a>" % _("Terms and Conditions")) |n}
        Wir werden Sie gelegentlich über wichtige Ereignisse wie den Beteiligungsstart einzelner Projektgruppen per E-Mail informieren.
      %else:
        ${c.agree_text|n}
      %endif
    </p>

    ## <!--SPAM protection-->
    <div class="hidejs" id="register_input_js">
      <label for="input_js">JS ${_('leave empty')}</label>
      <input name="input_js" />
    </div>
    <div id="register_input_css">
      <label for="input_css">CSS ${_('leave empty')}</label>
      <input name="input_css" />
    </div>
    ${c.recaptcha}

    <div class="input_wrapper submit">
      <input type="submit" value="${_('Register')}" />
    </div>
  </form>
  <script>
      $('input[name=user_name]').focus();
  </script>
</div>
