changeset 5809:93b512845dab stable

changelog: fix range selection from changelog in git repos (Issue #190) The Mercurial backend can handle short revision ids so the problem does not occur with hg repositories. Git needs the full hash.
author domruf <dominikruf@gmail.com>
date Mon, 22 Feb 2016 10:18:27 +0100
parents 8a9d93838882
children 81057be7a5c1
files kallithea/templates/changelog/changelog.html
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/changelog/changelog.html	Tue Apr 19 19:53:16 2016 +0200
+++ b/kallithea/templates/changelog/changelog.html	Mon Feb 22 10:18:27 2016 +0100
@@ -182,27 +182,26 @@
                     if ($checked_checkboxes.length > 0) {
                         $checked_checkboxes.first().parent('td').append($singlerange);
                         var singlerange = $singlerange.prop('checked');
-                        var rev_end = $checked_checkboxes.first().prop('name').substr(0, 12);
+                        var rev_end = $checked_checkboxes.first().prop('name');
                         if ($checked_checkboxes.length > 1 || singlerange) {
-                            var rev_start = $checked_checkboxes.last().prop('name').substr(0, 12);
+                            var rev_start = $checked_checkboxes.last().prop('name');
                             $('#rev_range_container').prop('href',
                                 pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}',
                                                                 'revision': rev_start + '...' + rev_end}));
                             $('#rev_range_container').html(
-                                 _TM['Show Selected Changesets {0} &rarr; {1}'].format(rev_start, rev_end));
+                                 _TM['Show Selected Changesets {0} &rarr; {1}'].format(rev_start.substr(0, 12), rev_end.substr(0, 12)));
                             $('#rev_range_container').show();
                             $('#open_new_pr').prop('href', pyroutes.url('pullrequest_home',
                                                                         {'repo_name': '${c.repo_name}',
                                                                          'rev_start': rev_start,
                                                                          'rev_end': rev_end}));
-                            $('#open_new_pr').html(_TM['Open New Pull Request for {0} &rarr; {1}'].format(rev_start, rev_end));
+                            $('#open_new_pr').html(_TM['Open New Pull Request for {0} &rarr; {1}'].format(rev_start.substr(0, 12), rev_end.substr(0, 12)));
                         } else {
                             $('#open_new_pr').prop('href', pyroutes.url('pullrequest_home',
                                                                         {'repo_name': '${c.repo_name}',
                                                                          'rev_end': rev_end}));
-                            $('#open_new_pr').html(_TM['Open New Pull Request from {0}'].format(rev_end));
+                            $('#open_new_pr').html(_TM['Open New Pull Request from {0}'].format(rev_end.substr(0, 12)));
                         }
-
                         $('#rev_range_clear').show();
                         $('#compare_fork').hide();