Skip to content
This repository was archived by the owner on Feb 3, 2021. It is now read-only.

Commit 489688c

Browse files
author
Anthony Parsons
committed
Make clickable table rows use real hyperlinks
Keeps the existing functionality, but makes the site usable without JS and more accessible with it (middle click etc.)
1 parent 1a85781 commit 489688c

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

js/cpandatesters.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
jQuery(document).ready(function($) {
22
$(".clickableRow").click(function() {
3-
if ($(this).attr("href"))
4-
window.document.location = $(this).attr("href");
5-
else if ($(this).attr("data-toggle")) {
6-
var elem = $($(this).attr("data-toggle"));
3+
var queryAttr;
4+
if (queryAttr = $(this).find("a").attr("href"))
5+
window.document.location = queryAttr;
6+
else if (queryAttr = $(this).attr("data-toggle")) {
7+
var elem = $(queryAttr);
78
if(elem.hasClass("out")) {
89
elem.fadeIn();
910
elem.removeClass("out");

views/dist-line.tt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% my ($x, $q, $url) = @_;
2-
<tr class="clickableRow" href="/<%= $url %>">
2+
<tr class="clickableRow">
33
<td>
44
<div class="progress progress-top" title="MoarVM">
55
<div class="progress-bar progress-bar-success" style="width: <%= $q<moar><pass> %>%"></div>
@@ -12,7 +12,7 @@
1212
<div class="progress-bar progress-bar-danger" style="width: <%= $q<jvm><fail> %>%"></div>
1313
</div>
1414
</td>
15-
<td><%= $x<distname> %></td>
15+
<td><a href="/<%= $url %>"><%= $x<distname> %></a></td>
1616
<td><%= $x<distauth> || '&lt;unknown&gt;' %></td>
1717
<td></td>
1818
</tr>

views/recent-line.tt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% my ($x) = @_;
2-
<tr class="clickableRow" href="/reports/<%= $x<id> %>.html">
2+
<tr class="clickableRow">
33
<td>
44
<div class="progress" style="margin-bottom: 0">
55
<div class="progress-bar progress-bar-<%=
@@ -12,7 +12,7 @@
1212
</div>
1313
</div>
1414
</td>
15-
<td><%= $x<distname> %></td>
15+
<td><a href="/reports/<%= $x<id> %>.html"><%= $x<distname> %></a></td>
1616
<td><%= $x<distver> %></td>
1717
<td><%= $x<compver> %></td>
1818
<td><%= $x<backend> %></td>

views/report-line.tt

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
% my ($x) = @_;
2-
<tr class="clickableRow" href="/reports/<%= $x<id> %>.html">
2+
<tr class="clickableRow">
33
<td>
4-
<div class="progress" style="margin-bottom: 0">
5-
<div class="progress-bar progress-bar-<%=
6-
do given $x<grade> {
7-
when 'PASS' { 'success' }
8-
when 'FAIL' { 'danger' }
9-
default { 'warning' }
10-
} %>" style="width: 100%">
11-
<span><%= $x<grade> %></span>
4+
<a href="/reports/<%= $x<id> %>.html">
5+
<div class="progress" style="margin-bottom: 0">
6+
<div class="progress-bar progress-bar-<%=
7+
do given $x<grade> {
8+
when 'PASS' { 'success' }
9+
when 'FAIL' { 'danger' }
10+
default { 'warning' }
11+
} %>" style="width: 100%">
12+
<span><%= $x<grade> %></span>
13+
</div>
1214
</div>
13-
</div>
15+
</a>
1416
</td>
1517
<td><%= $x<compver> %></td>
1618
<td><%= $x<backend> %></td>

0 commit comments

Comments
 (0)