From 6a6a09d88f50282b910ef82c47bb4bb21cd48556 Mon Sep 17 00:00:00 2001 From: Vikraman Choudhury Date: Thu, 4 Aug 2011 05:15:24 +0530 Subject: updates to index page, trying out relative urls --- server/index.py | 16 +++++++++++++++- server/templates/index.html | 26 +++++++++++++------------- 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
@@ -7,18 +7,18 @@ Number of hosts: $count

Statistics

Package search

- +
+ $:form.render() +
-- cgit v1.2.3-65-gdbad