From 78c2c7b8bb0ee1182445d194d15f0529993babec Mon Sep 17 00:00:00 2001 From: "mako@atdot.cc" <> Date: Tue, 2 Oct 2007 10:16:54 -0400 Subject: [PATCH] cleaned up code and integrated some simple CSS --- rapidsms.py | 22 +++++++++--------- static/style.css | 44 ++++++++++++++++++++++++++++++++++++ templates/layout.tmpl | 9 ++++++++ templates/questionaires.tmpl | 2 +- 4 files changed, 65 insertions(+), 12 deletions(-) create mode 100644 static/style.css diff --git a/rapidsms.py b/rapidsms.py index 92a441b..58960b0 100755 --- a/rapidsms.py +++ b/rapidsms.py @@ -154,17 +154,17 @@ class edit_questions: codes = list(int(q.code) for q in questionaire.questions) return(len(codes) + 1) -class test: - def GET(self): - render('test.tmpl') - - def POST(self): - render('test_sent.tmpl') - -class raw_sms_in: - def POST(self): - #TODO magic to parse sms - pass +#class test: +# def GET(self): +# render('test.tmpl', locals()) +# +# def POST(self): +# render('test_sent.tmpl', locals()) +# +#class raw_sms_in: +# def POST(self): +# #TODO magic to parse sms +# pass web.webapi.internalerror = web.debugerror diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..9bbffe7 --- /dev/null +++ b/static/style.css @@ -0,0 +1,44 @@ +h1, h2, h3 { + border-bottom: 3px #000080 solid; + width: 66%; +} + +#errormsg { + width: 20em; + border: 2px red solid; +} + +#errormsg h3 { + margin: 0; + padding: 0.3em 0 0.3em 0; + background: red; + color: white; + text-align: center; + border: 0 0 0 0; +} + +table, td, th { + border: 1px #000080 solid; + border-collapse: collapse; + border-spacing: 0px; +} + +td, th { + padding: 0.2em; + text-alignt: left; +} + +th { + background: #000080; + color: white; + text-align: center; + font-weight: bold; +} + +#footer { + clear: both; + margin-top: 7em; + text-align: center; + font-size: 70%; +} + diff --git a/templates/layout.tmpl b/templates/layout.tmpl index cc48dbe..4432b19 100644 --- a/templates/layout.tmpl +++ b/templates/layout.tmpl @@ -1,12 +1,21 @@ UNICEF Phone Application +

UNICEF Phone Application

{% block content %} {% endblock %} + +
diff --git a/templates/questionaires.tmpl b/templates/questionaires.tmpl index ba8ae24..907046d 100644 --- a/templates/questionaires.tmpl +++ b/templates/questionaires.tmpl @@ -15,7 +15,7 @@ {{q.code}} {{q.description}} -{{len(q.questions) or 0}} +{{q.questions.count()}} edit {% endfor %} -- 2.30.2