Files
libopenanal/templates/stat.html

84 lines
3.3 KiB
HTML
Raw Normal View History

2018-10-30 22:55:36 +10:00
{% extends "base.html" %}
{% block head %}
{{ super() }}
2018-10-30 22:55:36 +10:00
{% endblock %}
{% block content %}
{{ super() }}
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link" href="/">Users</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/conf">Conferences</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/stat">2ch.hk Stats</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<br>
<div class="row">
<div class="col-sm-12">
<h4>Summary</h4>
<b>Board: </b> {{ board }}<br>
<b>Threads: </b> {{ threads|length }}<br>
<b>Total posts: </b> {{ posts }}<br>
</div>
</div>
<hr>
<div class="container">
2018-10-30 22:55:36 +10:00
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4 offset-md-4">
<form action="/stat" method="get">
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Board" aria-label="Board" aria-describedby="button-stat"
name="board">
<div class="input-group-append">
<button class="btn btn-primary" type="submit" id="button-stat">Get stat</button>
</div>
</div>
</form>
2018-10-30 22:55:36 +10:00
</div>
</div>
</div>
<br>
<table class="table table-hover table-sm">
<thead>
2018-10-30 22:55:36 +10:00
<tr>
<th scope="col">#</th>
<th scope="col">Subject</th>
<th scope="col"><a href="./stat?board={{ board }}&order=posts&sorting={%- if sorting == 'ASC' -%}DESC{%- else -%}ASC{%- endif -%}">Posts</a>
2018-10-30 22:55:36 +10:00
</th>
<th scope="col"><a href="./stat?board={{ board }}&order=views&sorting={%- if sorting == 'ASC' -%}DESC{%- else -%}ASC{%- endif -%}">Views</a>
2018-10-30 22:55:36 +10:00
</th>
<th scope="col"><a href="./stat?board={{ board }}&order=score&sorting={%- if sorting == 'ASC' -%}DESC{%- else -%}ASC{%- endif -%}">Score</a>
2018-10-30 22:55:36 +10:00
</th>
<th scope="col"><a href="./stat?board={{ board }}&order=lasthit&sorting={%- if sorting == 'ASC' -%}DESC{%- else -%}ASC{%- endif -%}">Lasthit</a>
<th scope="col"><a href="./stat?board={{ board }}&order=timestamp&sorting={%- if sorting == 'ASC' -%}DESC{%- else -%}ASC{%- endif -%}">Age</a>
2018-10-30 22:55:36 +10:00
</th>
</tr>
</thead>
<tbody>
2018-10-30 22:55:36 +10:00
{% for thread in threads %}
<tr>
<th scope="row">{{ loop.index }}</th>
<td><a href="https://2ch.hk/{{board}}/res/{{ thread['num'] }}.html">{{ thread['subject'] }}</a></td>
<td>{{ thread['posts_count'] }}</td>
<td>{{ thread['views'] }}</td>
<td>{{ "%.2f"|format(thread['score']|float) }}</td>
<td data-toggle="tooltip" data-placement="right" title="Last hit: {{ thread['lasthit']|time }}">{{thread['lasthit']|readable_delta(now)}}
ago
</td>
<td data-toggle="tooltip" data-placement="right" title="Created: {{ thread['timestamp']|time }}">{{thread['timestamp']|readable_delta(thread['lasthit'])}}</td>
<td></td>
</tr>
2018-10-30 22:55:36 +10:00
{% endfor %}
</tbody>
</table>
2018-10-30 22:55:36 +10:00
{% endblock %}
{% block scripts %}
{{ super() }}
2018-10-30 22:55:36 +10:00
{% endblock %}