added search history table

This commit is contained in:
Xevion
2019-07-02 20:39:50 -05:00
parent e9a00f5683
commit 4bbc17ec52
6 changed files with 37 additions and 16 deletions

View File

@@ -7,14 +7,33 @@
<div class="column">
<div class="card">
<div class="card-header">
{% set result_count = current_user.search_history.all() | length %}
<div class="card-header-title">
<h1 class="title">Search History</h1>
</div>
<div>Search History</div>
<div style="padding: 0.3rem; font-weight: 100; font-size: 80%">{{ result_count }} result{% if result_count > 1 %}s{% endif %} found</div>
</div>
</div>
<div class="card-content">
{% for post in current_user.search_history %}
Post : {{ post }}
{% endfor %}
<table class="table">
<thead>
<tr>
<th><abbr title="Search ID">ID</abbr></th>
<th>Exact URL</th>
<th>Query Arguments</th>
<th><abbr title="in UTC time">Timestamp</abbr></th>
</tr>
</thead>
<tbody>
{% for post in current_user.search_history | reverse %}
<tr>
<td>{{ post.id }}</td>
<td>{{ post.exact_url }}</td>
<td>{{ post.query_args }}</td>
<td>{{ post.timestamp }} </td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>