added compare diffs feature and fixed a couple of css issues
[catagits/Gitalist.git] / root / wrapper.tt2
index e42e8d9..27abff8 100755 (executable)
    
        <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>