From c1f3008d03a933b76580a47547ef971aa4e639d7 Mon Sep 17 00:00:00 2001
From: Tony Arcieri <tony.arcieri@gmail.com>
Date: Thu, 14 Mar 2013 10:04:18 -0700
Subject: [PATCH] Redesigned directory pages (WIP)

This is an initial conversion of the directory pages from the old style
to the new style which is based on Twitter Bootstrap.

Still some remaining work to be done. You can see a screenshot here:

http://i.imgur.com/MPEngGx.png
---
 src/allmydata/web/directory.py    |   4 +-
 src/allmydata/web/directory.xhtml | 135 +++++++++++++++++++-----------
 2 files changed, 87 insertions(+), 52 deletions(-)

diff --git a/src/allmydata/web/directory.py b/src/allmydata/web/directory.py
index 21f6d429..ec170e8b 100644
--- a/src/allmydata/web/directory.py
+++ b/src/allmydata/web/directory.py
@@ -686,14 +686,14 @@ class DirectoryAsHTML(rend.Page):
                 T.input(type='hidden', name='t', value='unlink'),
                 T.input(type='hidden', name='name', value=name),
                 T.input(type='hidden', name='when_done', value="."),
-                T.input(type='submit', value='unlink', name="unlink"),
+                T.input(type='submit', _class='btn', value='unlink', name="unlink"),
                 ]
 
             rename = T.form(action=here, method="get")[
                 T.input(type='hidden', name='t', value='rename-form'),
                 T.input(type='hidden', name='name', value=name),
                 T.input(type='hidden', name='when_done', value="."),
-                T.input(type='submit', value='rename/relink', name="rename"),
+                T.input(type='submit', _class='btn', value='rename/relink', name="rename"),
                 ]
 
         ctx.fillSlots("unlink", unlink)
diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml
index 540da00d..ee94d581 100644
--- a/src/allmydata/web/directory.xhtml
+++ b/src/allmydata/web/directory.xhtml
@@ -1,50 +1,85 @@
-<html xmlns:n="http://nevow.com/ns/nevow/0.1"><head>
-  <title n:render="title"></title>
-  <link href="/tahoe.css" rel="stylesheet" type="text/css"/>
-  <link href="/icon.png" rel="shortcut icon" />
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head><body class="tahoe-directory-page">
-
-<h1 n:render="header"></h1>
-
-<div class="toolbar">
-  <div class="toolbar-item" n:render="welcome" />
-  <div class="toolbar-item"><a href=".">Refresh</a></div>
-
-  <div class="toolbar-item"><a href="?t=info">More info on this directory</a></div>
-  <div class="toolbar-item" n:render="show_readonly" />
-</div>
-
-<div n:render="try_children">
-  <table class="tahoe-directory" n:render="sequence" n:data="children">
-    <tr n:pattern="header">
-      <th>Type</th>
-      <th>Filename</th>
-      <th>Size</th>
-      <th>Times</th>
-      <th></th>
-      <th></th>
-      <th></th>
-    </tr>
-    <tr n:pattern="item" n:render="row">
-      <td><n:slot name="type"/></td>
-      <td><n:slot name="filename"/></td>
-      <td align="right"><n:slot name="size"/></td>
-      <td><n:slot name="times"/></td>
-      <td><n:slot name="unlink"/></td>
-      <td><n:slot name="rename"/></td>
-      <td><n:slot name="info"/></td>
-    </tr>
-
-    <tr n:pattern="empty"><td colspan="9" class="empty-marker">This directory is empty.</td></tr>
-
-  </table>
-</div>
-
-<div class="tahoe-directory-footer">
-  <div n:render="forms"/>
-
-  <div class="results" n:render="results"/>
-</div>
-
-</body></html>
+<!DOCTYPE html>
+<html lang="en" xmlns:n="http://nevow.com/ns/nevow/0.1">
+  <head>
+    <meta charset="utf-8"/>
+    <title n:render="title"></title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+    <meta name="description" content="Tahoe-LAFS is a free and open cloud storage engine"/>
+    <meta name="author" content="Tahoe-LAFS"/>
+
+    <!-- Le styles -->
+    <link href="/css/bootstrap.css" rel="stylesheet"/>
+    <link href="/css/bootstrap-responsive.css" rel="stylesheet"/>
+    <link href="/css/new-tahoe.css" rel="stylesheet"/>
+
+    <!-- Le fav and touch icons -->
+    <link rel="shortcut icon" href="/icon.png" />
+  </head>
+
+  <body>
+    <div class="navbar navbar-fixed-top">
+      <div class="navbar-inner">
+        <div class="container-fluid">
+          <a class="brand" href="/"><img src="/img/logo.png" alt="Tahoe-LAFS"/></a>
+        </div>
+      </div>
+    </div>
+
+    <div class="container-fluid">
+      <div class="row-fluid">
+        <div class="span3">
+          <div class="well sidebar-nav">
+            <ul class="nav nav-list">
+              <li class="toolbar-item" n:render="welcome" />
+              <li class="toolbar-item"><a href=".">Refresh</a></li>
+              <li class="toolbar-item"><a href="?t=info">More info on this directory</a></li>
+              <li class="toolbar-item" n:render="show_readonly" />
+            </ul>
+          </div>
+        </div>
+        <div class="span9">
+          <h1 n:render="header"></h1>
+
+          <div n:render="try_children">
+            <table class="table table-striped tahoe-directory" n:render="sequence" n:data="children">
+              <tr n:pattern="header">
+                <th>Type</th>
+                <th>Filename</th>
+                <th>Size</th>
+                <th>Times</th>
+                <th></th>
+                <th></th>
+                <th></th>
+              </tr>
+              <tr n:pattern="item" n:render="row">
+                <td><n:slot name="type"/></td>
+                <td><n:slot name="filename"/></td>
+                <td align="right"><n:slot name="size"/></td>
+                <td><n:slot name="times"/></td>
+                <td><n:slot name="unlink"/></td>
+                <td><n:slot name="rename"/></td>
+                <td><n:slot name="info"/></td>
+              </tr>
+
+              <tr n:pattern="empty"><td colspan="9" class="empty-marker">This directory is empty.</td></tr>
+
+            </table>
+          </div>
+
+          <div class="tahoe-directory-footer">
+            <div n:render="forms"/>
+
+            <div class="results" n:render="results"/>
+          </div>
+        </div><!--/span-->
+      </div><!--/row-->
+
+      <hr/>
+
+      <footer>
+        <p>&#169; <a href="http://tahoe-lafs.org/">Tahoe-LAFS 2013</a></p>
+      </footer>
+
+    </div><!--/.fluid-container-->
+  </body>
+</html>
\ No newline at end of file
-- 
2.45.2