You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.7 KiB

{% extends 'base.html' %}
{% block content %}
<div class="container" style="text-align:center;">
<h3>Leaderboards</h3>
<a href="{{ url_for('post.top') }}"><button class="btn btn-warning">Top Posts</button></a>
<a href="{{ url_for('leaderboard.leaderboard') }}"><button class="btn btn-warning">Top Posters</button></a>
<hr>
<div class="title">
<h3>{% block title %}Latest Posts{% endblock %}</h3>
</div>
{% if posts %}
<table class="table table-striped">
<tr>
<th>Date</th>
<th>ID</th>
<th>Title</th>
<th>Thumbnail</th>
<th>Submitter</th>
</tr>
{% for post in posts %}
<tr>
<td>{{ post.timestamp.strftime('%Y-%m-%d %H:%M') }}</td>
<td>{{ post.id }}</td>
<td><a href="{{ url_for('post.read', id=post.id) }}">{{ post.title }}</a></td>
<td>
<a href="{{ url_for('post.read', id=post.id) }}">
<img src="{{ url_for('post.uploaded_file', filename=post.get_thumbnail_name()) }}" width=200 style="max-height:200px;">
</a>
</td>
<td><a href="/?submitter={{ post.submitter }}">{{ post.submitter }}</a></td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No posts yet!</p>
{% endif %}
{% if page %}
{% if page > 1 %}
<a href="{% if request.args.submitter %}/?submitter={{ request.args.submitter }}&{% else %}/?{% endif %}page={{ page - 1 }}" style="padding:1em;">Back</a>
{% endif %}
{% if page < total_pages and total_pages > 0 %}
<a href="{% if request.args.submitter %}/?submitter={{ request.args.submitter }}&{% else %}/?{% endif %}page={{ page + 1 }}" style="padding:1em;">Next</a>
{% endif %}
{% endif %}
</div>
{% endblock %}