Patchwork [2,of,2,V4] hgweb, paper: add (Atom) subscribe links to the repository index

login
register
mail settings
Submitter Angel Ezquerra
Date Dec. 20, 2012, 10:33 p.m.
Message ID <3966b50841edb1adbe0d.1356042816@Angel-PC.localdomain>
Download mbox | patch
Permalink /patch/229/
State Accepted
Commit 2efc6536ea43618042494eb22ab1c27dbe5508ba
Headers show

Comments

Angel Ezquerra - Dec. 20, 2012, 10:33 p.m.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1356027732 -3600
# Node ID 3966b50841edb1adbe0d06a0a042e28ca7d14f80
# Parent  f23502de9cfbcc24c8c6a450dad7eacad40d65f2
hgweb, paper: add (Atom) subscribe links to the repository index

This is similar to the subscribe links that already exist in other templates.
Rather than the usual RSS and Atom links a single feed icon linking to the
atom-log is shown.
Matt Mackall - Dec. 20, 2012, 10:39 p.m.
On Thu, 2012-12-20 at 23:33 +0100, Angel Ezquerra wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra at gmail.com>
> # Date 1356027732 -3600
> # Node ID 3966b50841edb1adbe0d06a0a042e28ca7d14f80
> # Parent  f23502de9cfbcc24c8c6a450dad7eacad40d65f2
> hgweb, paper: add (Atom) subscribe links to the repository index

Queued for default, thanks.

Patch

diff --git a/mercurial/templates/paper/index.tmpl b/mercurial/templates/paper/index.tmpl
--- a/mercurial/templates/paper/index.tmpl
+++ b/mercurial/templates/paper/index.tmpl
@@ -18,6 +18,7 @@ 
         <th><a href="?sort={sort_contact}">Contact</a></th>
         <th><a href="?sort={sort_lastchange}">Last modified</a></th>
         <th>&nbsp;</th>
+        <th>&nbsp;</th>
     </tr>
     {entries%indexentry}
 </table>
diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
--- a/mercurial/templates/paper/map
+++ b/mercurial/templates/paper/map
@@ -213,6 +213,13 @@ 
     <td>{contact|obfuscate}</td>
     <td class="age">{lastchange|rfc822date}</td>
     <td class="indexlinks">{archives%indexarchiveentry}</td>
+    <td>
+        {if(isdirectory, '',
+            '<a href="{url}atom-log" title="subscribe to repository atom feed">
+                <img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="subscribe to repository atom feed">
+            </a>'
+            )}
+    </td>
   </tr>\n'
 indexarchiveentry = '<a href="{url}archive/{node|short}{extension|urlescape}">&nbsp;&darr;{type|escape}</a>'
 index = index.tmpl