]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
webish: display timestamps
authorBrian Warner <warner@allmydata.com>
Mon, 11 Feb 2008 22:13:18 +0000 (15:13 -0700)
committerBrian Warner <warner@allmydata.com>
Mon, 11 Feb 2008 22:13:18 +0000 (15:13 -0700)
src/allmydata/web/directory.xhtml
src/allmydata/webish.py

index 99cf926abba68924b3aac30121a133f40c66a610..e902a217e397bf1d8c14f575ebcb0d501c676440 100644 (file)
@@ -27,6 +27,7 @@
     <td>Filename</td>
     <td>Type</td>
     <td>Size</td>
+    <td>Times</td>
     <td>other representations</td>
     <td></td>
     <td></td>
@@ -38,6 +39,7 @@
     <td><n:slot name="filename"/></td>
     <td><n:slot name="type"/></td>
     <td><n:slot name="size"/></td>
+    <td><n:slot name="times"/></td>
     <td><n:slot name="data"/></td>
     <td><n:slot name="delete"/></td>
     <td><n:slot name="overwrite"/></td>
index b03a511b9c20321f2a949f11b4848e503424895e..7341a3f6a34e66aace6a4aabf0ce25cfd205c84c 100644 (file)
@@ -205,6 +205,21 @@ class Directory(rend.Page):
         ctx.fillSlots("overwrite", self.build_overwrite(ctx, (name, target)))
         ctx.fillSlots("check", check)
 
+        times = []
+        TIME_FORMAT = "%H:%M:%S %d-%b-%Y"
+        if "ctime" in metadata:
+            ctime = time.strftime(TIME_FORMAT,
+                                  time.localtime(metadata["ctime"]))
+            times.append("c: " + ctime)
+        if "mtime" in metadata:
+            mtime = time.strftime(TIME_FORMAT,
+                                  time.localtime(metadata["mtime"]))
+            if times:
+                times.append(T.br())
+                times.append("m: " + mtime)
+        ctx.fillSlots("times", times)
+
+
         # build the base of the uri_link link url
         uri_link = "/uri/" + urllib.quote(target.get_uri())