f3002e91ff73 webui

Update some styles.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Mon, 09 Nov 2009 19:55:40 -0500
parents c5debb475273
children aacf3a20efff
branches/tags webui
files review/web_media/style.css review/web_templates/base.html review/web_ui.py

Changes

--- a/review/web_media/style.css	Thu Oct 22 19:54:20 2009 -0400
+++ b/review/web_media/style.css	Mon Nov 09 19:55:40 2009 -0500
@@ -1,6 +1,6 @@
 /* Basic layout and typography. */
 body {
-    background: #f5f5f5;
+    background: #fafafa;
 }
 div#main-wrap {
     width: 65em;
@@ -10,8 +10,12 @@
 div#head-wrap {
     text-align: center;
     padding: 1.5em 0em .5em;
-    background-color: #ccc;
-    border-bottom: 1px solid #bbb;
+    color: #fff;
+    background-color: #111;
+    border-bottom: 6px solid #3C659A;
+}
+div#head-wrap h1 a, div#head-wrap h1 {
+    font-weight: normal;
 }
 div#footer {
     color: #666;
@@ -23,7 +27,7 @@
 a {
     text-decoration: none;
     font-weight: bold;
-    color: #297E00;
+    color: #3C659A;
 }
 a:hover {
     color: #EA0076;
--- a/review/web_templates/base.html	Thu Oct 22 19:54:20 2009 -0400
+++ b/review/web_templates/base.html	Mon Nov 09 19:55:40 2009 -0500
@@ -1,4 +1,4 @@
-$def with (rd, content)
+$def with (rd, content, title)
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
@@ -15,7 +15,7 @@
     
     <body>
         <div id="head-wrap">
-            <h1><a href="/">${ basename(rd.target.root) }</a></h1>
+            <h1><a href="/">${ basename(rd.target.root) }</a> $:{ title }</a></h1>
         </div>
         <div id="main-wrap">
             $:{ content }
--- a/review/web_ui.py	Thu Oct 22 19:54:20 2009 -0400
+++ b/review/web_ui.py	Mon Nov 09 19:55:40 2009 -0500
@@ -40,8 +40,8 @@
 
 def render_in_base(fn):
     def _fn(*args, **kwargs):
-        content = fn(*args, **kwargs)
-        return render.base(_rd, content)
+        title, content = fn(*args, **kwargs)
+        return render.base(_rd, content, title)
     return _fn
 
 class index:
@@ -50,13 +50,17 @@
         rev_max = _rd.target['tip'].rev()
         rev_min = rev_max - LOG_PAGE_LEN if rev_max >= LOG_PAGE_LEN else 0
         revs = (_rd.target[r] for r in xrange(rev_max, rev_min, -1))
-        return render.index(_rd, revs)
+        return ('', render.index(_rd, revs))
     
 
 class review:
     @render_in_base
     def GET(self, node_short):
-        return render.review(_rd, _rd[node_short])
+        title = '/ %s:%s &ndash; %s' % (
+            _rd[node_short].target[node_short].rev(),
+            node_short,
+            _rd[node_short].target[node_short].description().splitlines()[0])
+        return (title, render.review(_rd, _rd[node_short]))
     
     def POST(self, node_short):
         i = web.input()