headline/view/templates/index.html
bain 9800a0825d Add full-text search to the main page. The user can now search for parts
of the changed headline. The search uses each word (text separated by
space) as a separate query (logical OR). The user can use quotes to
specify that they want to keep multiple words as a single query.
2023-08-16 10:28:20 +02:00

80 lines
2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
{% include 'parts/head.html' %}
<style>
/* Longer name hidden by default */
span.long {
display: none;
}
/* On hover, hide the short name */
.expanded:hover span.short {
display: none;
}
/* On hover, display the longer name. */
.expanded:hover span.long {
display: block;
}
</style>
</head>
<body>
<div class="container">
<form>
<div class="d-flex">
<input class="m-2 form-control" type="text" id="search" name="search" value="{{ search|e }}" />
<input class="m-2 btn btn-primary" type="submit" formenctype="application/x-www-form-urlencoded" formmethod="get" value="Hledat" />
</div>
</form>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Detection time</th>
<th>Source</th>
<th>Diff</th>
<th>Original</th>
<th>Changed</th>
</tr>
</thead>
<tbody>
{% for diff in diffs %}
<tr>
<td>{{ diff.diff_time }}</td>
<td><a href='{{ diff.article_url }}' target="_blank">{{ diff.feed_name }}</a></td>
<td>{{ diff.diff_html|safe }}</td>
<td class="expanded">
<span class="short">{{ diff.title_orig|truncate(15) }} </span>
<span class="long">{{ diff.title_orig }} </span>
</td>
<td class="expanded">
<span class="short">{{ diff.title_new|truncate(15) }} </span>
<span class="long">{{ diff.title_new}} </span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="container text-center">
<div class="row">
<div class="col">
{{ pagination.links }}
</div>
<div class="col">
{{ pagination.info }}
</div>
</div>
</div>
</div>
{% include 'parts/footer.html' %}
</body>
</html>