Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 70828b9

Browse files
authored
Display compatibility checker result in a dialog (#72)
1 parent 94275df commit 70828b9

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

grid-template.html

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,32 @@
8585
{% set column = loop.index0 %}
8686
{% if column <= row %}
8787
{% set result = results.get_result(row_package, col_package) %}
88-
<td class="{% if result.self %}self-{% endif %}{{ result.status | lower }}"
89-
><pre>{{ result.details }}</pre></td>
88+
{% set cellName = row | string + '-' + column | string %}
89+
{% if result.self%}
90+
{% set bgColorName = 'self-' + result.status | lower %}
91+
{% else %}
92+
{% set bgColorName = result.status | lower %}
93+
{% endif %}
94+
<td class="{{ bgColorName }}" onclick="showDialog('{{ cellName|safe }}', '{{ result|replace('\'', '\\\'')|safe }}')">
95+
<div id="{{ cellName }}" class="dialog" title="{{ row_package.friendly_name }} and {{ col_package.friendly_name }}">
96+
</div>
97+
</td>
9098
{% else %}
9199
<td><pre></pre></td>
92100
{% endif %}
93101
{% endfor %}
94102
</tr>
95103
{% endfor %}
96104
</table>
105+
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
106+
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
107+
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
108+
<script>
109+
function showDialog(cellName, result) {
110+
document.getElementById(cellName).innerHTML = "<p>" + result + "</p>";
111+
$('#' + cellName).dialog({
112+
width: 700});
113+
}
114+
</script>
97115
</body>
98116
</html>

0 commit comments

Comments
 (0)