initial version of app - login working

This commit is contained in:
Oliver Gorwits
2012-01-06 22:15:23 +00:00
parent 57bb5ea5ef
commit b9a11449a4
12 changed files with 433 additions and 0 deletions

89
Netdisco/views/index.tt Normal file
View File

@@ -0,0 +1,89 @@
[%
more_dd = { "Reports" = "/reports" }
user_dd = [
{ "title" = "Settings", "link" = "/settings" },
{ "title" = "Help", "link" = "/help" },
{ "title" = "Log Out", "link" = "/logout" }
]
%]
<div class="topbar" data-dropdown="dropdown">
<div class="topbar-inner">
<div class="container-fluid">
<a class="brand" href="/">Netdisco</a>
[% IF session.user %]
<ul class="nav">
<li><a href="/">Home</a></li>
[% IF more_dd.size %]
<li class="dropdown">
<a href="#" class="dropdown-toggle">More</a>
<ul class="dropdown-menu">
[% FOREACH title IN more_dd.keys.sort %]
<li><a href="[% more_dd.$title %]">[% title %]</a></li>
[% END %]
</ul>
</li> <!-- /dropdown -->
[% END %]
</ul>
<form action="/search">
<input class="span5" type="text" placeholder="Search">
</form>
<ul class="nav secondary-nav">
<li class="menu">
<p>Logged in as &nbsp;</p>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle">[% session.user %]</a>
<ul class="dropdown-menu">
[% FOREACH item IN user_dd %]
<li><a href="[% item.link %]">[% item.title %]</a></li>
[% END %]
</ul>
</li> <!-- /dropdown -->
</ul>
[% END %]
</div>
</div>
</div>
<div class="container">
<div class="row nd_herorow">
<div class="span10 offset3">
[% IF params.failed %]
<div class="nd_loginalert alert-message error" data-alert="on">
<a class="close" href="#">×</a>
<p>Incorrect username or password, please try again.</p>
</div>
[% END %]
[% IF params.logout %]
<div class="nd_loginalert alert-message notice" data-alert="on">
<a class="close" href="#">×</a>
<p>You are logged out.</p>
</div>
[% END %]
[% IF params.notfound %]
<div class="nd_loginalert alert-message notice" data-alert="on">
<a class="close" href="#">×</a>
<p>Sorry, page not found.
<a href="http://sourceforge.net/tracker/?group_id=80033&atid=558508" target="_blank">Report a Bug?</a></p>
</div>
[% END %]
<div class="hero-unit">
<h2>Welcome to Netdisco</h2>
<small>Netdisco is an Open Source web-based network management tool.</small>
[% IF NOT session.user %]
<form class="nd_loginform" method="post" action="/login">
<div class="inline-inputs">
<input placeholder="Username" class="span2" name="username" type="text"/>
<input placeholder="Password" class="span2" name="password" type="password"/>
<button type="submit" class="btn info">Log In</button>
</div>
[% IF vars.requested_path %]
<input type="hidden" name="path" value="[% vars.requested_path %]"/>
[% END %]
</form>
[% END %]
</div>
</div>
</div>
</div> <!-- /container -->