cleaned up code and integrated some simple CSS master
authormako@atdot.cc <>
Tue, 2 Oct 2007 14:16:54 +0000 (10:16 -0400)
committermako@atdot.cc <>
Tue, 2 Oct 2007 14:16:54 +0000 (10:16 -0400)
rapidsms.py
static/style.css [new file with mode: 0644]
templates/layout.tmpl
templates/questionaires.tmpl

index 92a441b..58960b0 100755 (executable)
@@ -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 (file)
index 0000000..9bbffe7
--- /dev/null
@@ -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%;
+}
+
index cc48dbe..4432b19 100644 (file)
@@ -1,12 +1,21 @@
 <html>
 <head>
 <title>UNICEF Phone Application</title>
+<link rel="stylesheet" type="text/css" href="{{homepath}}/static/style.css" />
 </head>
 <body>
 <h1>UNICEF Phone Application</h1>
 <div id="content">
 {% block content %}
 {% endblock %}
+
+<div id="footer">
+<strong>RapidSMS</strong> © 2007
+<a href="http://mako.cc">Benjamin Mako Hill</a> ::
+<a href="http://projects.mako.cc/source/rapidsms">Source Available</a> under
+<a href="http://www.affero.org/oagpl.html">AGPL</a>
+
+</div>
 </div>
 </body>
 </html>
index ba8ae24..907046d 100644 (file)
@@ -15,7 +15,7 @@
 <tr>
 <td>{{q.code}}</td>
 <td>{{q.description}}</td>
-<td>{{len(q.questions) or 0}}</td>
+<td>{{q.questions.count()}}</td>
 <td><a href="{{homepath}}/edit_questions/{{q.id}}">edit</a></td>
 </tr>
 {% endfor %}

Benjamin Mako Hill || Want to submit a patch?