[% META title = 'Login' %]

<!-- Login form -->
<form method="post" action=" [% Catalyst.uri_for('/login') %] ">
  <table>
    <tr>
      <td>Username:</td>
      <td><input type="text" name="username" size="40" /></td>
    </tr>
    <tr>
      <td>Password:</td>
      <td><input type="password" name="password" size="40" /></td>
    </tr>
    <tr>
      <td colspan="2"><input type="submit" name="submit" value="Submit" /></td>
    </tr>
  </table>
</form>

<p>
[%
   # This code illustrates how certain parts of the TT 
   # template will only be shown to users who have logged in
%]
[% IF Catalyst.user_exists %]
    Please Note: You are already logged in as '[% Catalyst.user.username %]'.
    You can <a href="[% Catalyst.uri_for('/logout') %]">logout</a> here.
[% ELSE %]
    You need to log in to use this application.
[% END %]
[%#
   Note that this whole block is a comment because the "#" appears
   immediate after the "[%" (with no spaces in between).  Although it 
   can be a handy way to temporarily "comment out" a whole block of 
   TT code, it's probably a little too subtle for use in "normal" 
   comments.
%]