<!-- $Id$ -->

<metal:login define-macro="login_form"
             i18n:domain="zope"
             tal:define="principal request/principal/id">
    <h2>Login</h2>
    <div>
      <p i18n:translate=""
         tal:condition="python: principal == 'zope.anybody'">
        Please provide Login Information</p>
      <p i18n:translate=""
         tal:condition="python: principal != 'zope.anybody'">
        You are not authorized to perform this action. However, you may login as a
        different user who is authorized.</p>
      <form method="post"
            tal:define="submitted python:
                            principal != 'zope.anybody' and 'SUBMIT' in request">
        <tal:redirect condition="submitted">
            <span tal:define="dummy python:request.response.redirect(
                                request.get('camefrom') or request.URL[-1])" />
        </tal:redirect>
        <tal:form condition="not:submitted">
          <div class="row">
            <div class="label" i18n:translate="">User Name</div>
            <div class="field">
                <input type="text" name="login"/></div>
          </div><br />
          <div class="row">
            <div class="label" i18n:translate="">Password</div>
            <div class="field">
                <input type="password" name="password"/></div>
          </div><br />
          <div class="row">
              <input class="form-element" type="submit"
                     name="SUBMIT" value="Log in"
                     i18n:attributes="value login-button" /></div>
          <input type="hidden" name="camefrom"
                 tal:attributes="value request/camefrom | nothing">
        </tal:form>
      </form>
    </div>
</metal:login>
