]> arthur.barton.de Git - bup.git/commitdiff
web: Make output follow html4 standard
authorGabriel Filion <lelutin@gmail.com>
Wed, 21 Jul 2010 02:45:36 +0000 (22:45 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Wed, 21 Jul 2010 04:09:16 +0000 (00:09 -0400)
Add a doctype to specify which HTML version to use, in our case use the
HTML4.01 transitional doctype.

Close the second <th> tag so that it doesn't appear as 3 columns.

Add a charset definition in the head of the document.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
cmd/web-cmd.py

index 9b9b7f155ff1d8967ab92c068f83a17347c8560a..c4e019c7a751e2b5c4d42ee747e1a393c62362ba 100755 (executable)
@@ -42,11 +42,12 @@ class BupRequestHandler(tornado.web.RequestHandler):
         self.set_header("Content-Type", "text/html")
 
         displaypath = cgi.escape(path)
-        self.write("""
+        self.write("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
   <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Directory listing for %(displaypath)s</title>
-    <style>
+    <style type="text/css">
       body, table { font-family: sans-serif }
       #breadcrumb { margin: 10px 0; }
       .dir-name { text-align: left }
@@ -70,7 +71,7 @@ class BupRequestHandler(tornado.web.RequestHandler):
     <table>
       <tr>
         <th class="dir-name">Name</th>
-        <th class="dir-size">Size<th>
+        <th class="dir-size">Size</th>
       </tr>
 """)
         for sub in n: