[% WRAPPER layout.tt title="Sign in" %]
[% PROCESS common.tt %]

[% IF c.user_exists %]
<p class="btn-info btn-large">
You are already logged in as <tt>[% c.user.username %]</tt>.
You can <a href="[% c.uri_for('/logout') %]">logout</a> here.
</p>
[% ELSE %]

<!--
<p>Don't have an account yet? Please <a href="[%
c.uri_for('/register') %]">register</a> first.</p>
-->

<br/>

<form class="form-horizontal" method="post" action="[% c.uri_for('/login') %]">

  <fieldset>
    <div class="control-group">
      <label class="control-label">User name</label>
      <div class="controls">
        <input type="text" class="span3" name="username" value=""></input>
      </div>
    </div>

    <div class="control-group">
      <label class="control-label">Password</label>
      <div class="controls">
        <input type="password" class="span3" name="password" value=""></input>
      </div>
    </div>

    <div class="form-actions">
      <input type="submit" name="login" value="Sign in" class="btn btn-primary" />
    </div>
  </fieldset>

</form>

[% END %]

[% END %]
