85 lines
2.1 KiB
HTML
85 lines
2.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>{% block title %}{{title}}{% endblock %}</title>
|
|
<link rel="stylesheet" type="text/css" href="{%block css %}styles.css{%endblock%}">
|
|
{% block scripts %}
|
|
<script src="jquery-latest.js"></script>
|
|
<script src="jquery.tablesorter.min.js"></script>
|
|
<script src="script.js"></script>
|
|
{% endblock scripts %}
|
|
</head>
|
|
<body>
|
|
{% block header %}<h1>{{title}}</h1>{% endblock %}
|
|
{% block info %}<p class="info">Last updated {{timestamp}}</p>{% endblock %}
|
|
{% block namefilter %}
|
|
<div id="namefilter">
|
|
<input type="text" id="namefilterinput" value="" placeholder="name filter" autofocus >
|
|
</div>
|
|
<script>
|
|
|
|
var namefilter = (function (opts) {
|
|
var timeout_id = null,
|
|
filter_value = '',
|
|
delay = (opts && opts.delay) || 1000;
|
|
function update() {
|
|
// console.log("update", filter_value);
|
|
var pat = new RegExp(filter_value, "i");
|
|
$("tbody tr").each(function () {
|
|
var n = $(".pad_name", this).text();
|
|
// console.log("n", n);
|
|
if (filter_value == "" || n.match(pat) !== null) {
|
|
$(this).show();
|
|
} else {
|
|
$(this).hide();
|
|
}
|
|
})
|
|
}
|
|
var ret = function (val) {
|
|
filter_value = val;
|
|
if (timeout_id !== null) {
|
|
window.clearTimeout(timeout_id);
|
|
timeout_id = null;
|
|
}
|
|
timeout_id = window.setTimeout(update, delay)
|
|
}
|
|
return ret;
|
|
})();
|
|
|
|
$("#namefilterinput").bind("keyup", function (e) { namefilter($(this).val()); })
|
|
|
|
$(document).ready(function()
|
|
{
|
|
$("table.listing").tablesorter();
|
|
}
|
|
);
|
|
|
|
</script>
|
|
{% endblock %}
|
|
|
|
<table class="listing tablesorter">
|
|
<thead>
|
|
<tr>
|
|
<th>link</th>
|
|
<th>pad name (click to view archived page)</th>
|
|
<th>group</th>
|
|
<th>last edited</th>
|
|
<th>size</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for pad in pads %}
|
|
<tr>
|
|
<td class="pad_url"><a class="edit" href="{{ pad.url }}">edit</a></td>
|
|
<td class="pad_name"><a href="{{ pad.html_path }}">{{ pad.pad_name }}</a></td>
|
|
<td class="pad_group">{{ pad.group_name|default(pad.group_id) }}</td>
|
|
<td class="pad_last_edited">{{ pad.last_edited_str }}</td>
|
|
<td class="pad_size">{{ pad.text_length_human }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html>
|