changeset 1445:56281e086f38

hgweb: add strip and rstrip filters to handle summary
author TK Soh <teekaysoh@yahoo.com>
date Tue, 25 Oct 2005 14:57:14 -0700
parents f84ed9c6131d
children 4babaa52badf
files mercurial/hgweb.py templates/changelogentry-rss.tmpl templates/changelogentry.tmpl templates/changeset.tmpl templates/filelogentry-rss.tmpl templates/filelogentry.tmpl
diffstat 6 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Tue Oct 25 14:55:39 2005 -0700
+++ b/mercurial/hgweb.py	Tue Oct 25 14:57:14 2005 -0700
@@ -164,6 +164,8 @@
 
 common_filters = {
     "escape": cgi.escape,
+    "strip": lambda x: x.strip(),
+    "rstrip": lambda x: x.rstrip(),
     "age": age,
     "date": lambda x: util.datestr(x),
     "addbreaks": nl2br,
--- a/templates/changelogentry-rss.tmpl	Tue Oct 25 14:55:39 2005 -0700
+++ b/templates/changelogentry-rss.tmpl	Tue Oct 25 14:57:14 2005 -0700
@@ -1,7 +1,7 @@
 <item>
-    <title>#desc|firstline|escape#</title>
+    <title>#desc|strip|firstline|rstrip|escape#</title>
     <link>#url#?cs=#node|short#</link>
-    <description><![CDATA[#desc|escape|addbreaks#]]></description>
+    <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
     <author>#author|obfuscate#</author>
     <pubDate>#date|rfc822date#</pubDate>
 </item>
--- a/templates/changelogentry.tmpl	Tue Oct 25 14:55:39 2005 -0700
+++ b/templates/changelogentry.tmpl	Tue Oct 25 14:57:14 2005 -0700
@@ -1,7 +1,7 @@
 <table class="changelogEntry parity#parity#">
  <tr>
   <th class="age" width="15%">#date|age# ago:</th>
-  <th class="firstline">#desc|firstline|escape#</th>
+  <th class="firstline">#desc|strip|firstline|escape#</th>
  </tr>
  <tr>
   <th class="changesetRev">changeset #rev#:</th>
--- a/templates/changeset.tmpl	Tue Oct 25 14:55:39 2005 -0700
+++ b/templates/changeset.tmpl	Tue Oct 25 14:57:14 2005 -0700
@@ -11,7 +11,7 @@
 #archives%archiveentry#
 </div>
 
-<h2>changeset: #desc|escape|firstline#</h2>
+<h2>changeset: #desc|strip|escape|firstline#</h2>
 
 <table id="changesetEntry">
 <tr>
@@ -32,7 +32,7 @@
  <td class="files">#files#</td></tr>
 <tr>
  <th class="description">description:</th>
- <td class="description">#desc|escape|addbreaks#</td>
+ <td class="description">#desc|strip|escape|addbreaks#</td>
 </tr>
 </table>
 
--- a/templates/filelogentry-rss.tmpl	Tue Oct 25 14:55:39 2005 -0700
+++ b/templates/filelogentry-rss.tmpl	Tue Oct 25 14:57:14 2005 -0700
@@ -1,7 +1,7 @@
 <item>
-    <title>#desc|firstline|escape#</title>
+    <title>#desc|strip|firstline|rstrip|escape#</title>
     <link>#url#?f=#filenode|short#;file=#file#</link>
-    <description><![CDATA[#desc|escape|addbreaks#]]></description>
+    <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
     <author>#author|obfuscate#</author>
     <pubDate>#date|rfc822date#</pubDate>>
 </item>
--- a/templates/filelogentry.tmpl	Tue Oct 25 14:55:39 2005 -0700
+++ b/templates/filelogentry.tmpl	Tue Oct 25 14:57:14 2005 -0700
@@ -1,7 +1,7 @@
 <table class="parity#parity#" width="100%" cellspacing="0" cellpadding="0">
 <tr>
  <td align="right" width="15%"><b>#date|age# ago:&nbsp;</b></td>
- <td><b><a href="?cs=#node|short#">#desc|firstline|escape#</a></b></td></tr>
+ <td><b><a href="?cs=#node|short#">#desc|strip|firstline|escape#</a></b></td></tr>
 <tr>
  <td align="right">revision #filerev#:&nbsp;</td>
  <td><a href="?f=#filenode|short#;file=#file#">#filenode|short#</a>