changeset 4298:33a58b74bbc3

pull requests: include 'detailed view' and ancestor information in ajax chunk, open diff in another window
author Mads Kiilerich <madski@unity3d.com>
date Fri, 28 Jun 2013 11:50:13 +0200
parents 7a5977429125
children 29aa65c9638d
files kallithea/templates/compare/compare_cs.html kallithea/templates/pullrequests/pullrequest.html
diffstat 2 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/compare/compare_cs.html	Fri Jun 28 11:50:13 2013 +0200
+++ b/kallithea/templates/compare/compare_cs.html	Fri Jun 28 11:50:13 2013 +0200
@@ -40,12 +40,26 @@
         </tr>
     %endfor
     </table>
-    %if c.ancestor:
-      <div class="ancestor">${_('Ancestor')}:
+    %if c.as_form:
+      <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
+      ## links should perhaps use ('rev', c.org_rev) instead ...
+      ${h.link_to(_('Show merge diff'),
+        h.url('compare_url',
+          repo_name=c.org_repo.repo_name,
+          org_ref_type=c.org_ref_type, org_ref_name=c.org_ref_name,
+          other_repo=c.other_repo.repo_name,
+          other_ref_type=c.other_ref_type, other_ref_name=c.other_ref_name,
+          merge='1'),
+        )}
+      </div>
+      <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
+        ${_('Common ancestor')}:
+        %if c.ancestor:
         ${h.link_to(h.short_id(c.ancestor),h.url('changeset_home',repo_name=c.repo_name,revision=c.ancestor))}
+        %else:
+        ${_('No common ancestor found - repositories are unrelated')}
+        %endif
       </div>
-    %endif
-    %if c.as_form:
       ${h.hidden('ancestor_rev',c.ancestor)}
       ${h.hidden('merge_rev',c.cs_ranges[-1].raw_id)}
     %endif
--- a/kallithea/templates/pullrequests/pullrequest.html	Fri Jun 28 11:50:13 2013 +0200
+++ b/kallithea/templates/pullrequests/pullrequest.html	Fri Jun 28 11:50:13 2013 +0200
@@ -124,9 +124,6 @@
         <div style="float:left;padding:0px 30px 30px 30px">
            ## overview pulled by ajax
            <div style="float:left" id="pull_request_overview"></div>
-           <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none">
-                <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a>
-           </div>
         </div>
         <div style="clear:both;"></div>
 
@@ -199,9 +196,6 @@
 
       YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}";
       ypjax(url,'pull_request_overview');
-
-      YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ...
-      YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
   }
 
   ## refresh automatically when something changes (org_repo can't change)