1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-22 14:24:27 +01:00
pywb/pywb/ui/query.html
Ilya Kreymer 71e8ada57d rewrite: add test for banner-only mode, rewriting w/o a head using local
'sample_no_head' file.
query.html: use client side rewriting for calendar dates
rewrite: remove unused decode stuff
2014-08-04 20:45:02 -07:00

52 lines
1.4 KiB
HTML

<html>
<head>
<script>
function ts_to_date(ts, is_gmt)
{
if (ts.length < 14) {
return ts;
}
var datestr = (ts.substring(0, 4) + "-" +
ts.substring(4, 6) + "-" +
ts.substring(6, 8) + "T" +
ts.substring(8, 10) + ":" +
ts.substring(10, 12) + ":" +
ts.substring(12, 14) + "-00:00");
var date = new Date(datestr);
if (is_gmt) {
return date.toGMTString();
} else {
return date.toLocaleString();
}
}
</script>
</head>
<body>
<h2>pywb Sample Calendar Results</h2>
<b>{{ cdx_lines | length }}</b> captures of <b>{{ url }}</b>
<table id="captures" style="border-spacing: 10px;">
<tr>
<th>Capture</th>
<th>Status</th>
<th>Original Url</th>
<th>Archive File</th>
</tr>
{% for cdx in cdx_lines %}
<tr style="{{ 'font-weight: bold' if cdx['mimetype'] != 'warc/revisit' else '' }}">
<td><a href="{{ prefix }}{{ cdx.timestamp }}/{{ cdx.original }}">
<script>document.write(ts_to_date("{{ cdx['timestamp']}}", true))</script>
</a></td>
<td>{{ cdx['statuscode'] }}</td>
<td>{{ cdx['original'] }}</td>
<td>{{ cdx['filename'] }}</td>
</tr>
{% endfor %}
</table>
<p>
<i><b>* Unique captures are bold.</b> Other captures are duplicates of a previous capture.</i>
</p>
</body>
</html>