<% 
   if @login.login? 
%>
<table border="0" width="100%" 
       cellpadding="0" cellspacing="0" bgcolor="#eeeedd">
<tr align="center">
<td><%=h @login.name%> <%=a 'logout', {}, context %>Logout</a></td>
</tr>
</table>
<% 
  else 
%>
<%= form('login', context) %>
<table border="0" width="100%" 
       cellpadding="0" cellspacing="0" bgcolor="#eeeedd">
<% 
   case(failed_count) 
   when 0
%>
<caption>Login</caption>
<% when 1..2 %>
<caption>Login: <%= failed_count %> </caption>
<% else %>
<caption>oops! <%=a 'guest', {}, context%>login guest</a></caption>
<% end %>
<tr>
<th>user</th>
<td><input size="8" type="text" name="user" value="<%=h @hint %>"/></td>
</tr>
<tr>
<th>password</th>
<td><input type="password" name="pass" size="8"/></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" value="Login" /></td>
</tr>
</table>
</form>
<% 
  end 
%>
