[% BLOCK history_table_headfoot %]
[% SET cell = type == 'head' ? 'th' : 'td' %]
+[%# FIXME: should c.req.arguments.0 be path instead? %]
<tr>
+<[% cell %] colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]','[% c.req.arguments.0 %]');return false;">Compare</a></[% cell %]>
<[% cell %]>sha1</[% cell %]>
<[% cell %]>time</[% cell %]>
<[% cell %]>message</[% cell %]>
<[% cell %]>actions</[% cell %]>
</tr>
[% END %]
+<form name="theform">
<table class='listing'>
<thead>[% PROCESS history_table_headfoot type = 'head' %]</thead
<tbody>
[% FOREACH line IN log_lines %]
<tr [% "class='invert'" IF loop.count % 2 %]>
+ <td><input type="radio" name="sha1_a" value="[% line.sha1 %]" [% "checked" IF loop.count == 2 %] /></td>
+ <td><input type="radio" name="sha1_b" value="[% line.sha1 %]" [% "checked" IF loop.count == 1 %]/></td>
<td class='sha1' title='[% line.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = line.sha1.substr(0, 7) %]</td>
<td class='time-since' title='[% line.authored_time %]'>[% time_since(line.authored_time) %]</td>
</td>
</tr>
[% END %]
+ <tr>
+ <td colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]');return false;">Compare</a></td>
+ <td colspan="5"></td>
+</tr>
</tbody>
</table>
+</form>
[%
INCLUDE 'inc/log_pager.tt2';
%]
[% BLOCK shortlog_table_headfoot %]
[% SET cell = type == 'head' ? 'th' : 'td' %]
<tr>
+ <[% cell %] colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]');return false;">Compare</a></[% cell %]>
<[% cell %]>ID (sha1)</[% cell %]>
<[% cell %]>Last change</[% cell %]>
<[% cell %]>Message</[% cell %]>
</tr>
[% END %]
+<form name="theform">
<table class='listing'>
<thead>[% PROCESS shortlog_table_headfoot type = 'head' %]</thead>
<tbody>
[% FOREACH line IN log_lines %]
<tr [% "class='invert'" IF loop.count % 2 %]>
+ <td><input type="radio" name="sha1_a" value="[% line.sha1 %]" [% "checked" IF loop.count == 2 %] /></td>
+ <td><input type="radio" name="sha1_b" value="[% line.sha1 %]" [% "checked" IF loop.count == 1 %]/></td>
<td class='sha1' title='[% line.sha1 %]'>[% INCLUDE 'inc/chroma_hash.tt2' sha1 = line.sha1.substr(0, 7) %]</td>
<td class='time-since' title='[% line.authored_time %]'>[% time_since(line.authored_time) %]</td>
<td>
</td>
</tr>
[% END %]
+<tr>
+ <td colspan="2"><a href="#" onclick="compareDiffs('[% Repository.name %]');return false;">Compare</a></td>
+ <td colspan="5"></td>
+</tr>
</tbody>
</table>
+</form>
[% INCLUDE 'inc/log_pager.tt2' %]
#debug_holder{
- display:none;
+ adisplay:none;
clear:both;
padding-top:30px;
/* nav tabs */
#nav_logs{
- width:80%;
+ width:100%;
clear:both;
float:right;
margin:-5px 10px 0 0;
th a{
color:#fff;
}
+th a:hover{
+ color:#f0f0f0;
+}
.summary tr{
background-color:#FAFAFA;
border-bottom:1px solid #fff;
.summary td{
vertical-align:middle !important;
}
+tr{
+ background-color:#fff;
+}
+thead tr{
+ background-color:transparent !important;
+}
tr.invert{
background-color:#f0f0f0;
}
padding:10px;
border:1px solid #ddd;
background-color:#f0f0f0;
+ min-height:40px;
}
.diff-head{
background-color:#666;
--- /dev/null
+function compareDiffs(repo, path){
+ var f = document.theform;
+ if(!repo){
+ var repo = "";
+ }
+ if(!path){
+ var path = "";
+ }
+ var sha1,sha2;
+ for(var i=0,len=f.length;i<len;i++){
+ if(f[i].name == "sha1_a"){
+ if(f[i].checked){
+ sha1 = f[i].value;
+ }
+ }
+ if(f[i].name == "sha1_b"){
+ if(f[i].checked){
+ sha2 = f[i].value;
+ }
+ }
+ }
+ //document.location.href = [% c.uri_for("/" + repo + "/"+ sha1 + "/diff/" + sha2 + "/" + path) %];
+ document.location.href = "/" + repo + "/"+ sha1 + "/diff/" + sha2 + "/" + path;
+}
<link rel="stylesheet" type="text/css" href="[% c.uri_for('/core.css') %]" />
<link rel="shortcut icon" href="[% c.uri_for('/static/git-favicon.png') %]" type="image/png" />
+ <script type="text/javascript">
+ // FIXME: this should be in an external js file once c.uri_for works in js files
+ function compareDiffs(repo, path){
+ var f = document.theform;
+ if(!repo){
+ var repo = "";
+ }
+ if(!path){
+ var path = "";
+ }
+ var sha1,sha2;
+ for(var i=0,len=f.length;i<len;i++){
+ if(f[i].name == "sha1_a"){
+ if(f[i].checked){
+ sha1 = f[i].value;
+ }
+ }
+ if(f[i].name == "sha1_b"){
+ if(f[i].checked){
+ sha2 = f[i].value;
+ }
+ }
+ }
+ document.location.href = "[% c.uri_for("/") %]" + repo + "/"+ sha1 + "/diff/" + sha2 + "/" + path;
+ }
+ </script>
</head>
<body>
[% USE Dumper %]
<pre>
[% Repository.path %]
- [%# Dumper.dump(c.req.path) %]
+ [%# Dumper.dump(c.req.arguments.0) %]
</pre>
</div>