]> arthur.barton.de Git - bup.git/blobdiff - lib/web/list-directory.html
Convert 'bup web' directory listing to use tornado templates.
[bup.git] / lib / web / list-directory.html
diff --git a/lib/web/list-directory.html b/lib/web/list-directory.html
new file mode 100644 (file)
index 0000000..49c1971
--- /dev/null
@@ -0,0 +1,34 @@
+<!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 {{ escape(path) }}</title>
+    <style type="text/css">
+      body, table { font-family: sans-serif }
+      #breadcrumb { margin: 10px 0; }
+      .dir-name { text-align: left }
+      .dir-size { text-align: right }
+    </style>
+  </head>
+  <body>
+    <div id="breadcrumb">
+      {% for (display, part_path) in breadcrumbs[:-1] %}
+        <a href="{{ url_escape(part_path) }}">{{ escape(display) }}</a> /
+      {% end %}
+      <strong>{{ escape(breadcrumbs[-1][0]) }}</strong>
+    </div>
+    <table>
+      <tr>
+        <th class="dir-name">Name</th>
+        <th class="dir-size">Size</th>
+      </tr>
+      {% for (display, link, size) in dir_contents %}
+        <tr>
+          <td class="dir-name"><a href="{{ url_escape(link) }}">{{ escape(display) }}</a></td>
+          <td class="dir-size">{% if size != None %}{{ size }}{% else %}&nbsp;{% end %}</td>
+        </tr>
+      {% end %}
+    </table>
+  </body>
+</html>
+