aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikraman Choudhury <vikraman.choudhury@gmail.com>2011-08-04 05:15:24 +0530
committerVikraman Choudhury <vikraman.choudhury@gmail.com>2011-08-04 05:15:24 +0530
commit6a6a09d88f50282b910ef82c47bb4bb21cd48556 (patch)
tree7277edbbb5c6f09be24078fc8483f60b8aac8c47
parentimproved index page (diff)
downloadgentoostats-6a6a09d88f50282b910ef82c47bb4bb21cd48556.tar.gz
gentoostats-6a6a09d88f50282b910ef82c47bb4bb21cd48556.tar.bz2
gentoostats-6a6a09d88f50282b910ef82c47bb4bb21cd48556.zip
updates to index page, trying out relative urls
-rw-r--r--server/index.py16
-rw-r--r--server/templates/index.html26
2 files changed, 28 insertions, 14 deletions
diff --git a/server/index.py b/server/index.py
index e6a63f5..2204bd3 100644
--- a/server/index.py
+++ b/server/index.py
@@ -1,8 +1,22 @@
+from web import form
from config import render, db
+search_form = form.Form(
+ form.Textbox('cat', value = 'any', description = 'Category'),
+ form.Textbox('pkg', value = 'any', description = 'Package'),
+ form.Textbox('ver', value = 'any', description = 'Version'),
+ form.Textbox('repo', value = 'any', description = 'Repository'),
+ form.Textbox('min_hosts', value = 'any', description = 'Minimum hosts'),
+ form.Textbox('max_hosts', value = 'any', description = 'Maximum hosts'),
+ form.Button('Search', type = 'submit')
+ )
+
class Index(object):
def GET(self):
hosts = db.select('HOSTS', what='COUNT(UUID) as COUNT')
count = hosts[0]['COUNT']
- return render.index(count)
+
+ form = search_form()
+
+ return render.index(count, form)
diff --git a/server/templates/index.html b/server/templates/index.html
index e601b26..24f7ea7 100644
--- a/server/templates/index.html
+++ b/server/templates/index.html
@@ -1,4 +1,4 @@
-$def with (count)
+$def with (count, form)
$var title: Gentoostats
Welcome to the gentoostats webapp <br/>
@@ -7,18 +7,18 @@ Number of hosts: $count<br/>
<h2>Statistics</h2>
<ul>
- <li>Arch statistics: <a href="/gentoostats/arch">/arch</a></li>
- <li>Portage feature statistics: <a href="/gentoostats/feature">/feature</a></li>
- <li>Keyword statistics: <a href="/gentoostats/keyword">/keyword</a></li>
- <li>Language statistics: <a href="/gentoostats/lang">/lang</a></li>
- <li>Mirror statistics: <a href="/gentoostats/mirror">/mirror</a></li>
- <li>Package statistics: <a href="/gentoostats/package">/package</a></li>
- <li>Profile statistics: <a href="/gentoostats/profile">/profile</a></li>
- <li>Repository statistics: <a href="/gentoostats/repo">/repo</a></li>
- <li>Useflag statistics: <a href="/gentoostats/use">/use</a></li>
+ <li>Arch statistics: <a href="arch">/arch</a></li>
+ <li>Portage feature statistics: <a href="feature">/feature</a></li>
+ <li>Keyword statistics: <a href="keyword">/keyword</a></li>
+ <li>Language statistics: <a href="lang">/lang</a></li>
+ <li>Mirror statistics: <a href="mirror">/mirror</a></li>
+ <li>Package statistics: <a href="package">/package</a></li>
+ <li>Profile statistics: <a href="profile">/profile</a></li>
+ <li>Repository statistics: <a href="repo">/repo</a></li>
+ <li>Useflag statistics: <a href="use">/use</a></li>
</ul>
<h2>Package search</h2>
-<ul>
- <li><a href="/gentoostats/search">/search</a></li>
-</ul>
+<form method="GET" action="/gentoostats/search">
+ $:form.render()
+</form>