diff kallithea/templates/compare/compare_cs.html @ 5165:6ec5fd198084

pullrequest/compare: add logical changeset index to clarify the order Is the parent-most changeset in a changeset the one at the top or at the bottom? When the revision numbers are not shown, it is not obvious to determine this. This commit adds a logical changeset index to the commit list in a pullrequest or compare view. The index starts at 1 (the parent-most commit) and has no relation whatsoever with the commit hash or revision number.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Sun, 10 May 2015 21:51:44 +0200
parents b3299a079fa6
children 5d161c096260
line wrap: on
line diff
--- a/kallithea/templates/compare/compare_cs.html	Mon May 18 17:22:04 2015 +0200
+++ b/kallithea/templates/compare/compare_cs.html	Sun May 10 21:51:44 2015 +0200
@@ -36,6 +36,21 @@
               </div>
           %endif
         </td>
+        <td class="changeset-logical-index">
+          <%
+              num_cs = len(c.cs_ranges)
+              index = num_cs - cnt
+              if index == 1:
+                  title = _('First (oldest) changeset in this list')
+              elif index == num_cs:
+                  title = _('Last (most recent) changeset in this list')
+              else:
+                  title = _('Position in this list of changesets')
+          %>
+          <span class="tooltip" title="${title}">
+            ${index}
+          </span>
+        </td>
         <td style="width: 140px"><span class="tooltip" title="${h.tooltip(h.age(cs.date))}">${cs.date}</span></td>
         <td><div class="gravatar" commit_id="${cs.raw_id}">${h.gravatar(h.email_or_none(cs.author), size=14)}</div></td>
         <td><div class="author">${h.person(cs.author)}</div></td>