<div i18n:domain="schooltool">
  <form action="." method="post"
    tal:attributes="action string:${context/@@absolute_url}/@@login.html">

    <input type="hidden" name="nexturl"
      tal:condition="request/nexturl | nothing"
      tal:attributes="value request/nexturl" />

    <div class="status" tal:condition="request/expired | nothing">
      <div class="summary ui-state-error ui-corner-all">
        <span class="ui-icon ui-icon-alert">icon</span>
        <tal:block i18n:translate="">
          Your session has expired.
        </tal:block>
      </div>
    </div>

    <div class="status" tal:condition="request/forbidden | nothing">
      <div class="summary ui-state-error ui-corner-all">
        <span class="ui-icon ui-icon-alert">icon</span>
        <tal:block i18n:translate="">
          You are not allowed to access this page.  You can click on the
          back button in your browser to go back, or ask a more privileged
          user to log in.
        </tal:block>
      </div>
    </div>

    <div class="status" tal:condition="view/error|nothing">
      <div class="summary ui-state-error ui-corner-all">
        <span class="ui-icon ui-icon-alert">icon</span>
        <tal:block i18n:translate="">
          Please correct the marked fields below.
        </tal:block>
      </div>
    </div>

    <fieldset>
      <legend><span i18n:translate="">User Information</span></legend>

      <div class="row">
        <div class="label">
          <label for="username">
            <span i18n:translate="">Username</span>
          </label>
        </div>
        <div class="error" tal:condition="view/error">
          <div class="error" tal:content="view/error">
            Error message
          </div>
        </div>
        <div class="widget">
          <input id="username" name="username" type="text" tabindex="1"
                 tal:attributes="value request/username|nothing;
                                 class python:view.error is not None and 'error' or None" />
        </div>
      </div>

      <div class="row">
        <div class="label">
          <label for="password">
            <span i18n:translate="">Password</span>
          </label>
        </div>
        <div class="widget">
          <input id="password" name="password" type="password" tabindex="2" />
        </div>
      </div>
    </fieldset>

    <div class="buttons">
      <input class="button-ok" type="submit" value="Log in" accesskey="L"
             tabindex="3" i18n:attributes="value; accesskey" name="LOGIN" />
    </div>
  </form>

</div>
