hgweb: add file sizes to manifest browsing
authorMatt Mackall <mpm@selenic.com>
Tue, 10 Oct 2006 00:07:46 -0500
changeset 3305 0708bdb4987a
parent 3304 98ec107ce723
child 3306 5c9806554d65
hgweb: add file sizes to manifest browsing
mercurial/hgweb/hgweb_mod.py
templates/gitweb/manifest.tmpl
templates/gitweb/map
templates/manifest.tmpl
templates/map
--- a/mercurial/hgweb/hgweb_mod.py	Mon Oct 09 23:46:05 2006 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Tue Oct 10 00:07:46 2006 -0500
@@ -430,9 +430,9 @@
                     continue
 
                 yield {"file": full,
-                       "filenode": hex(fnode),
                        "parity": self.stripes(parity),
                        "basename": f,
+                       "size": ctx.filectx(full).size(),
                        "permissions": mf.execf(full)}
                 parity += 1
 
--- a/templates/gitweb/manifest.tmpl	Mon Oct 09 23:46:05 2006 -0500
+++ b/templates/gitweb/manifest.tmpl	Tue Oct 10 00:07:46 2006 -0500
@@ -23,6 +23,7 @@
 <table cellspacing="0">
 <tr class="light">
 <td style="font-family:monospace">drwxr-xr-x</td>
+<td style="font-family:monospace"></td>
 <td><a href="{url}file/#node|short##up|urlescape#{getentries}">[up]</a></td>
 <td class="link">&nbsp;</td>
 </tr>
--- a/templates/gitweb/map	Mon Oct 09 23:46:05 2006 -0500
+++ b/templates/gitweb/map	Tue Oct 10 00:07:46 2006 -0500
@@ -14,8 +14,8 @@
 searchentry = changelogentry.tmpl
 changeset = changeset.tmpl
 manifest = manifest.tmpl
-manifestdirentry = '<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td><a href="#url#file/#node|short##path|urlescape#{getentries}">#basename|escape#/</a></td><td class="link"><a href="#url#file/#node|short##path|urlescape#{getentries}">manifest</a></td></tr>'
-manifestfileentry = '<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td class="list"><a class="list" href="#url#file/#node|short#/#file|urlescape#{getentries}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{getentries}">file</a> | <a href="#url#log/#node|short#/#file|urlescape#{getentries}">revisions</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{getentries}">annotate</a></td></tr>'
+manifestdirentry = '<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td style="font-family:monospace"></td><td><a href="#url#file/#node|short##path|urlescape#{getentries}">#basename|escape#/</a></td><td class="link"><a href="#url#file/#node|short##path|urlescape#{getentries}">manifest</a></td></tr>'
+manifestfileentry = '<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td style="font-family:monospace" align=right>#size#</td><td class="list"><a class="list" href="#url#file/#node|short#/#file|urlescape#{getentries}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{getentries}">file</a> | <a href="#url#log/#node|short#/#file|urlescape#{getentries}">revisions</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{getentries}">annotate</a></td></tr>'
 filerevision = filerevision.tmpl
 fileannotate = fileannotate.tmpl
 filelog = filelog.tmpl
--- a/templates/manifest.tmpl	Mon Oct 09 23:46:05 2006 -0500
+++ b/templates/manifest.tmpl	Tue Oct 10 00:07:46 2006 -0500
@@ -16,7 +16,9 @@
 <table cellpadding="0" cellspacing="0">
 <tr class="parity1">
   <td><tt>drwxr-xr-x</tt>&nbsp;
+  <td>&nbsp;
   <td><a href="#url#file/#node|short##up|urlescape#{getentries}">[up]</a>
+</tr>
 #dentries%manifestdirentry#
 #fentries%manifestfileentry#
 </table>
--- a/templates/map	Mon Oct 09 23:46:05 2006 -0500
+++ b/templates/map	Tue Oct 10 00:07:46 2006 -0500
@@ -14,8 +14,8 @@
 searchentry = changelogentry.tmpl
 changeset = changeset.tmpl
 manifest = manifest.tmpl
-manifestdirentry = '<tr class="parity#parity#"><td><tt>drwxr-xr-x</tt>&nbsp;<td><a href="#url#file/#node|short##path|urlescape#{getentries}">#basename|escape#/</a>'
-manifestfileentry = '<tr class="parity#parity#"><td><tt>#permissions|permissions#</tt>&nbsp;<td><a href="#url#file/#node|short#/#file|urlescape#{getentries}">#basename|escape#</a>'
+manifestdirentry = '<tr class="parity#parity#"><td><tt>drwxr-xr-x</tt>&nbsp;<td>&nbsp;<td><a href="#url#file/#node|short##path|urlescape#{getentries}">#basename|escape#/</a>'
+manifestfileentry = '<tr class="parity#parity#"><td><tt>#permissions|permissions#</tt>&nbsp;<td align=right><tt>#size#</tt>&nbsp;<td><a href="#url#file/#node|short#/#file|urlescape#{getentries}">#basename|escape#</a>'
 filerevision = filerevision.tmpl
 fileannotate = fileannotate.tmpl
 filediff = filediff.tmpl