mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
Display relative date of test on branch page
This commit is contained in:
parent
a2766028df
commit
6254259b73
1 changed files with 19 additions and 0 deletions
|
@ -61,6 +61,8 @@
|
||||||
|
|
||||||
.canvasjs-chart-credit { display: none; }
|
.canvasjs-chart-credit { display: none; }
|
||||||
|
|
||||||
|
.daysAgo { font-size: 12px; width:100px; }
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -83,6 +85,7 @@
|
||||||
{% for test in data.tests %}
|
{% for test in data.tests %}
|
||||||
<th class="ci-test-title"><div><span>{{ test }}</span></div></th>
|
<th class="ci-test-title"><div><span>{{ test }}</span></div></th>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<th class="ci-test-title"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -97,6 +100,8 @@
|
||||||
</td>
|
</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<td class="daysAgo" timestamp="{{ test_results['date'] }}">
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -144,5 +149,19 @@ chart.render();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function daysAgo(timestamp) {
|
||||||
|
var difference = Math.round(+new Date()/1000) - timestamp;
|
||||||
|
var daysDifference = Math.round(difference/60/60/24);
|
||||||
|
//return (new Date(timestamp*1000));
|
||||||
|
return "(" + daysDifference + " days ago)";
|
||||||
|
}
|
||||||
|
$(".daysAgo").each(function () {
|
||||||
|
console.log($(this));
|
||||||
|
var t = $(this).attr("timestamp");
|
||||||
|
$(this).text(daysAgo(t));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue