Skip to content

Commit

Permalink
Merge remote-tracking branch 'horada112/align-matrix-axis-names-to-le…
Browse files Browse the repository at this point in the history
…ft' into merge-align-matrix-axis-names-to-left
  • Loading branch information
Ian Norton committed May 15, 2021
2 parents 9786479 + 07f046c commit fb7ce79
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
31 changes: 15 additions & 16 deletions junit2htmlreport/templates/matrix.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>
{% set n_reports = report_names.__len__() %}
{% if n_reports > 0 %}
<tr><!-- top row, stats and each matrix axis -->
<td colspan="2" rowspan="{{n_reports + 1}}"> <!-- stats -->
<td colspan="1" rowspan="{{n_reports + 2}}"> <!-- stats -->
<table class="stats-table">
{% for outcome in matrix.result_stats %}
<tr>
Expand All @@ -19,26 +19,24 @@ <h1>
{% endfor %}
</table>
</td>
<td colspan="{{n_reports + 1}}"></td>

<td colspan="{{n_reports}}" class="matrix-axis-name">
<a href="{{report_names[0]}}.html">{{matrix.short_axis(report_names[0])}}</a>
</td>
</tr>
{% endif %}
<!-- matrix column index - {{report_names}} -->
{% for i in range(n_reports - 1) %}
{% for i in range(n_reports) %}
<tr>
{% for n in range(1 + i) %}
<td class="matrix-axis-line"></td>
{% endfor %}
<td colspan="{{n_reports - 1 - i}}" class="matrix-axis-name">
<a href="{{report_names[i + 1]}}.html">{{matrix.short_axis(report_names[i + 1])}}</a>
<td colspan="{{n_reports + 1 - i}}" class="matrix-axis-name {% if (n_reports - i) % 2 == 0 %}matrix-even{% endif %}">
<a href="{{report_names[n_reports - 1 - i]}}.html">{{matrix.short_axis(report_names[n_reports - 1 - i])}}</a>
</td>
{% for n in range(i) %}
<td class="matrix-axis-line {% if (n_reports - n) % 2 != i % 2 %}matrix-even{% endif %}"></td>
{% endfor %}
</tr>
{% endfor %}
<tr>
{% for n in range(n_reports) %}
<td class="matrix-axis-line"></td>
{% for n in range(n_reports + 1) %}
<td class="matrix-axis-line {% if n % 2 == 0 %}matrix-even{% endif %}"></td>
{% endfor %}
</tr>

Expand All @@ -47,7 +45,7 @@ <h1>
<tr>
<th class="matrix-classname" colspan="2">{{classname}}</th>
{% for n in range(n_reports) %}
<td class="matrix-axis-line"></td>
<td class="matrix-axis-line {% if n % 2 == 1 %}matrix-even{% endif %}"></td>
{% endfor %}
</tr>
{% for casename in matrix.casenames[classname] %}
Expand All @@ -57,9 +55,10 @@ <h1>
<td class="matrix-casename matrix-result-combined">
{{ matrix.combined_result_list(classname, casename)[1] }}
</td>
{% for axis in report_names %}
{% for n in range(n_reports) %}
{% set axis = report_names[n] %}

<td class="matrix-axis-line">
<td class="matrix-axis-line {% if n % 2 == 1 %}matrix-even{% endif %}">
{% if axis in xcase %}
<a href="{{axis}}.html#{{xcase[axis].anchor()}}">
<span class="matrix-result matrix-result-{{xcase[axis].outcome()}}">
Expand All @@ -77,4 +76,4 @@ <h1>
{% endfor %}

</table>
{% endblock %}
{% endblock %}
7 changes: 6 additions & 1 deletion junit2htmlreport/templates/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ h1 {

.matrix-axis-name {
white-space: nowrap;
padding-left: 0.5em;
padding-right: 0.5em;
border-left: 1px solid black;
border-top: 1px solid black;
text-align: right;
}

.matrix-axis-line {
Expand Down Expand Up @@ -177,3 +178,7 @@ h1 {
.matrix-result-skipped {
background-color: lightyellow;
}

.matrix-even {
background-color: lightgray;
}

0 comments on commit fb7ce79

Please sign in to comment.