Skip to content

Commit

Permalink
organize files by themes and a simple webapp to test the themes.
Browse files Browse the repository at this point in the history
  • Loading branch information
anandology committed May 24, 2010
1 parent 8123798 commit d9f6c5d
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 136 deletions.
136 changes: 0 additions & 136 deletions newtry/site.html

This file was deleted.

File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
136 changes: 136 additions & 0 deletions static/themes/alankar/site.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
$def with (page)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>$page.title - PyCon India 2010</title>
<link rel="stylesheet" type="text/css" href="/themes/alankar/style.css" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="http://ideamonk.in/inpycon/static/jquery.countdown.min.js"></script>

<script type="text/javascript">
\$(document).ready( function(){
// setup countdown
var pyconDate = new Date();
pyconDate = new Date(2010, 7, 25);
\$('#defaultCountdown').countdown({
until: pyconDate,
format: 'DHMS',
layout: '<div id="t7_timer">'+
'<div id="t7_vals">'+
'<div id="t7_d" class="t7_numbs">{dnn}</div>'+
'<div id="t7_h" class="t7_numbs">{hnn}</div>'+
'<div id="t7_m" class="t7_numbs">{mnn}</div>'+
'<div id="t7_s" class="t7_numbs">{snn}</div>'+
'</div>'+
'<div id="t7_labels">'+
'<div id="t7_dl" class="t7_labs">days</div>'+
'<div id="t7_hl" class="t7_labs">hours</div>'+
'<div id="t7_ml" class="t7_labs">mins</div>'+
'<div id="t7_sl" class="t7_labs">secs</div>'+
'</div>'+
'<div id="t7_timer_over"></div>'+
'</div>'
});
});
</script>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="account">
$if ctx.user:
<form name='logout' action="$homepath()/account/logout" method='POST' style="display:none;"></form>
Welcome <a href="$homepath()/$ctx.user">$ctx.user.displayname</a>!
| <a href="#" onclick="document.forms['logout'].submit()">Log out</a>
$else:
<a href="$homepath()/account/login">Login</a>
</div>

<div id="defaultCountdown"></div>

<div id="nav">
<ul>
<li>
<a href="$homepath()/">
Home
</a>
<span> &nbsp; </span>
</li>
<li>
<a href="$homepath()/sponsors">Sponsors</a>
<span> behind the scene </span>
</li>
<li>
<a href="$homepath()/cfp">CFP</a>
<span> participate! </span>
</li>
<li>
<a href="$homepath()/program">Schedule</a>
<span> talks, speakers </span>
</li>
<li>
<a href="$homepath()/faq">FAQ</a>
<span> more details </span>
</li>
</ul>
</div>
</div>
<!-- end of header -->

<div id="content">
<div id="sidebar">
<h3>Platinum Sponspors</h3>
<p>
<img src="http://placehold.it/120x80&text=Sponsor" alt="" title=""/>
</p>

<h3>Gold Sponspors</h3>
<p>
<img src="http://placehold.it/120x80&text=Sponsor" alt="" title=""/>
</p>
<p>
<img src="http://placehold.it/120x80&text=Sponsor" alt="" title=""/>
</p>

<h3>Silver Sponspors</h3>
<p>
<img src="http://placehold.it/120x80&text=Sponsor" alt="" title=""/>
</p>
<p>
<img src="http://placehold.it/120x80&text=Sponsor" alt="" title=""/>
</p>
<p>
<img src="http://placehold.it/120x80&text=Sponsor" alt="" title=""/>
</p>
</div>
<!-- end of sidebar -->

<div id="contents">
<!--
<h2>PyCon India 2010</h2>
<p>
Pycon India 2010 is the second Python conference in India. A purely volunteer effort, it is being hosted for the second time in India, and will attract some of the best Python developers in India and abroad.
</p>
-->

$if page.title != "Home":
<h2>$page.title</h2>
$:page

</div>
<!-- end of normal content -->

</div>
<!-- end of content -->

<div id="footer">
<a href="#">Contact Us</a>
<span style="float: right">Powered by <a href="http://infogami.org/">Infogami</a></span>
</div>
<!-- end of content -->

</div>
</body>
</html>
File renamed without changes.
28 changes: 28 additions & 0 deletions webapp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import web

urls = (
"/(themes/.*)", "media",
"/(.*)", "page"
)
app = web.application(urls, globals())

tglobals = dict(
ctx=web.storage(user=None, flash_messages=[]),
homepath=lambda: "",
)

def render_page(name):
return web.template.TemplateResult(title=name, __body__="Hello, world!")

class media:
def GET(self, path):
raise web.found("/static/" + path)

class page:
def GET(self, name):
i = web.input(theme="alankar")
t = web.template.frender("static/themes/" + i.theme + "/site.html", globals=tglobals)
return t(render_page(name))

if __name__ == "__main__":
app.run()

0 comments on commit d9f6c5d

Please sign in to comment.