Fix comparison view
authorJoachim Breitner <mail@joachim-breitner.de>
Mon, 17 Aug 2015 15:39:26 +0000 (17:39 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 17 Aug 2015 15:39:26 +0000 (17:39 +0200)
This fixes #17. Thanks Simon for the high-quality bug report.

site/index.html
site/js/gipeda.js

index 0dca05c..e8e3a90 100644 (file)
@@ -527,9 +527,7 @@ html {
      {{/each}}</br>
       <a href="{{revisionLink rev1.summary.hash}}">{{> rev-id hash=rev1.summary.hash}}</a> <abbrv class="timeago" title="{{ iso8601 gitDate }}">{{ humanDate rev1.summary.gitDate}}</abbrv>:<br/>
      <strong>{{ rev1.summary.gitSubject }}</strong><br/>
-     {{#logLink rev1.summary.hash }}
-      <a href="{{link}}">buildlog</a>
-     {{/logLink}}
+     {{revisionInfo rev1.summary }}
     </p>
     <p class="text-center">
       ⁞<br/>
@@ -543,9 +541,7 @@ html {
      {{/each}}</br>
       <a href="{{revisionLink rev2.summary.hash}}">{{> rev-id hash=rev2.summary.hash}}</a> <abbrv class="timeago" title="{{ iso8601 gitDate }}">{{ humanDate rev2.summary.gitDate}}</abbrv>:<br/>
      <strong>{{ rev2.summary.gitSubject }}</strong><br/>
-     {{#logLink rev2.summary.hash }}
-      <a href="{{link}}">buildlog</a>
-     {{/logLink}}
+     {{revisionInfo rev2.summary }}
     </p>
     {{/if}} {{/if}}
    </div>
index 9b7ba8f..18c2703 100644 (file)
@@ -173,6 +173,13 @@ Handlebars.registerHelper('graphLink', function(benchName, hl1, hl2) {
     if (hl2 && typeof(hl2) == 'string') {hls.push(hl2)};
     return "#" + routes.graph.url(benchName,hls);
 });
+Handlebars.registerHelper('diffLink', function(rev1, rev2) {
+    if (data.settings.diffLink) {
+       return Handlebars.compile(data.settings.diffLink)({base: rev1, rev: rev2});
+    } else {
+       return 'javascript:alert("No diffLink defined in settings")';
+    }
+});
 Handlebars.registerHelper('revisionInfo', function(revSummary) {
     var ctxt = {};
     ctxt.rev = revSummary.hash;