<%namespace name="components" file="/components.html"/>
<%
login_titleandtype = h.allowed_login_types()
if 'email+password' in login_titleandtype:
    field_question = _('What is your email address?')
    field_title = _('My email:')
    if 'username+password' in login_titleandtype:
        field_type = 'text'
    else:
        field_type = 'email'
else:
    field_question = _('What is your user name?')
    field_title = _('My user name:')
    field_type =  'text'
%>
<form class="login-alternate ${components.add_patch_camefrom_class()} login_form" method="POST" action="${h.get_redirect_url(u'perform_login')}">
  ${h.field_token()|n}

  <form:error name="login"></form:error>
  <div class="login-alternate-question">
    ${field_question}
  </div>
  <label>${field_title}
    <input type="${field_type}" name="login" autofocus="autofocus" required="required"/>
  </label>
  <div class="login-alternate-question">
    ${_('Do you have a password for %s?') % h.site.name()}
  </div>
  <label>
    <input type="radio" name="have_password" value="false" />
    <span>${_('No, I do not have a password, or I forgot it.')}</span>
  </label>
  <label>
    <input type="radio" name="have_password" value="true" checked="checked" />
    <span>${_('Yes, I do have a password:')}</span></label>
  <input type="password" name="password" />
  <div class="input_wrapper submit">
    <input type="submit" value="${_('Login')}" />
  </div>
</form>
%if 'openid' in login_titleandtype:
    <%
    c.openid_scenario = "login"
    %>
    <%include file="/openid/form.html"/>
%endif
</div>
