Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added psgi server and template improvements
- Loading branch information
kthakore
committed
Feb 19, 2011
1 parent
00a37d6
commit 4430dd4
Showing
4 changed files
with
58 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,5 +81,6 @@ | |
<span style="float: right" /> | ||
[% PROCESS navigation.tt %] | ||
</span> | ||
<div id="header-bottom" > </div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,55 @@ | ||
[% PROCESS header.tt %] | ||
<div id="content"> | ||
<div id="dashboard" class="dashboard> | ||
|
||
<!-- Login form --> | ||
<form method="post" action="[% c.uri_for('/login') %]"> | ||
[%IF c.flash.error_msg %] | ||
<p> Error: [%c.flash.error_msg%] </p> | ||
[%END %] | ||
<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> | ||
<div id="dashboard-header" > </div> | ||
<div id="dashboard-content"> | ||
|
||
<p> | ||
[% | ||
# This code illustrates how certain parts of the TT | ||
# template will only be shown to users who have logged in | ||
%] | ||
[% IF c.user_exists %] | ||
[% c.response.redirect(c.uri_for('/')); %] | ||
[% 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. | ||
%] | ||
</p> | ||
<div id="gadget-0-renderbox" class="gadget" style="left: 5px; top: 5px; width: 99%;"> | ||
<div class="shadow"><div class="tl"></div><div class="tr"></div><div class="l"></div><div class="r"></div><div class="bl"></div><div class="br"></div><div class="b"></div></div> | ||
<div class="dashboard-item-header"> | ||
<div class="dashboard-item-content"> | ||
<h3 class="dashboard-item-title" id="gadget-0-title" style="background-color:ddddff">Login</h3> | ||
<!-- Login form --> | ||
<form method="post" action="[% c.uri_for('/login') %]"> | ||
[%IF c.flash.error_msg %] | ||
<p> Error: [%c.flash.error_msg%] </p> | ||
[%END %] | ||
<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 c.user_exists %] | ||
[% c.response.redirect(c.uri_for('/')); %] | ||
[% 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. | ||
%] | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
[% PROCESS footer.tt %] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
use SIMS; | ||
|
||
SIMS->setup_engine('PSGI'); | ||
my $app = sub { SIMS->run(@_) }; | ||
|
Binary file not shown.