diff --git a/kallithea/templates/changelog/changelog_table.html b/kallithea/templates/changelog/changelog_table.html --- a/kallithea/templates/changelog/changelog_table.html +++ b/kallithea/templates/changelog/changelog_table.html @@ -1,7 +1,8 @@ ## Render changelog table with id 'changesets' with the range of changesets, ## statuses, and comments. ## Optionally, pass a js snippet to run whenever a table resize is triggered. -<%def name="changelog(repo_name, cs_range, cs_statuses, cs_comments, show_checkbox=False, show_branch=True, resize_js='')"> +<%def name="changelog(repo_name, cs_range, cs_statuses, cs_comments, show_checkbox=False, show_branch=True, show_index=False, resize_js='')"> + <% num_cs = len(cs_range) %>
+ <% + 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') + %> + + ${index} + + | + %endif
%if cs_statuses.get(cs.raw_id):
%if cs_statuses.get(cs.raw_id)[2]:
diff --git a/kallithea/templates/compare/compare_cs.html b/kallithea/templates/compare/compare_cs.html
--- a/kallithea/templates/compare/compare_cs.html
+++ b/kallithea/templates/compare/compare_cs.html
@@ -1,4 +1,5 @@
-## Changesets table !
+## Changesets table with graph
+<%namespace name="changelog_table" file="/changelog/changelog_table.html"/>
%if not c.cs_ranges:
${_('No changesets')}
@@ -28,68 +29,9 @@
-
-
%if c.is_ajax_preview:
diff --git a/kallithea/tests/functional/test_compare.py b/kallithea/tests/functional/test_compare.py
--- a/kallithea/tests/functional/test_compare.py
+++ b/kallithea/tests/functional/test_compare.py
@@ -6,8 +6,8 @@ from kallithea.tests.fixture import Fixt
fixture = Fixture()
-def _commit_ref(sha, msg):
- return ''' ''' % msg
+def _commit_ref(repo_name, sha, msg):
+ return ''' ''' % (repo_name, sha, msg)
class TestCompareController(TestController):
@@ -65,8 +65,8 @@ class TestCompareController(TestControll
response.mustcontain("""Showing 2 commits""")
response.mustcontain("""1 file changed with 2 insertions and 0 deletions""")
- response.mustcontain(_commit_ref(cs1.raw_id, 'commit2'))
- response.mustcontain(_commit_ref(cs2.raw_id, 'commit3'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs1.raw_id, 'commit2'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs2.raw_id, 'commit3'))
response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id))
response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
@@ -116,8 +116,8 @@ class TestCompareController(TestControll
response.mustcontain("""Showing 2 commits""")
response.mustcontain("""1 file changed with 2 insertions and 0 deletions""")
- response.mustcontain(_commit_ref(cs1.raw_id, 'commit2'))
- response.mustcontain(_commit_ref(cs2.raw_id, 'commit3'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs1.raw_id, 'commit2'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs2.raw_id, 'commit3'))
response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id))
response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
@@ -175,8 +175,8 @@ class TestCompareController(TestControll
response.mustcontain("""Showing 2 commits""")
response.mustcontain("""1 file changed with 2 insertions and 0 deletions""")
- response.mustcontain(_commit_ref(cs1.raw_id, 'commit2'))
- response.mustcontain(_commit_ref(cs2.raw_id, 'commit3'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs1.raw_id, 'commit2'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs2.raw_id, 'commit3'))
response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id))
response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
@@ -234,8 +234,8 @@ class TestCompareController(TestControll
response.mustcontain("""Showing 2 commits""")
response.mustcontain("""1 file changed with 2 insertions and 0 deletions""")
- response.mustcontain(_commit_ref(cs1.raw_id, 'commit2'))
- response.mustcontain(_commit_ref(cs2.raw_id, 'commit3'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs1.raw_id, 'commit2'))
+ response.mustcontain(_commit_ref(repo2.repo_name, cs2.raw_id, 'commit3'))
response.mustcontain("""r1:%s""" % (repo2.repo_name, cs1.raw_id, cs1.short_id))
response.mustcontain("""r2:%s""" % (repo2.repo_name, cs2.raw_id, cs2.short_id))
@@ -302,9 +302,9 @@ class TestCompareController(TestControll
response.mustcontain("""Showing 3 commits""")
response.mustcontain("""1 file changed with 3 insertions and 0 deletions""")
- response.mustcontain(_commit_ref(cs2.raw_id, 'commit3'))
- response.mustcontain(_commit_ref(cs3.raw_id, 'commit4'))
- response.mustcontain(_commit_ref(cs4.raw_id, 'commit5'))
+ response.mustcontain(_commit_ref(repo1.repo_name, cs2.raw_id, 'commit3'))
+ response.mustcontain(_commit_ref(repo1.repo_name, cs3.raw_id, 'commit4'))
+ response.mustcontain(_commit_ref(repo1.repo_name, cs4.raw_id, 'commit5'))
response.mustcontain("""r2:%s""" % (repo1.repo_name, cs2.raw_id, cs2.short_id))
response.mustcontain("""r3:%s""" % (repo1.repo_name, cs3.raw_id, cs3.short_id))
@@ -368,9 +368,9 @@ class TestCompareController(TestControll
response.mustcontain("""Showing 3 commits""")
response.mustcontain("""1 file changed with 3 insertions and 0 deletions""")
- response.mustcontain(_commit_ref(cs3.raw_id, 'commit4'))
- response.mustcontain(_commit_ref(cs4.raw_id, 'commit5'))
- response.mustcontain(_commit_ref(cs5.raw_id, 'commit6'))
+ response.mustcontain(_commit_ref(repo1.repo_name, cs3.raw_id, 'commit4'))
+ response.mustcontain(_commit_ref(repo1.repo_name, cs4.raw_id, 'commit5'))
+ response.mustcontain(_commit_ref(repo1.repo_name, cs5.raw_id, 'commit6'))
response.mustcontain("""r3:%s""" % (repo1.repo_name, cs3.raw_id, cs3.short_id))
response.mustcontain("""r4:%s""" % (repo1.repo_name, cs4.raw_id, cs4.short_id))
|