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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
suchwow/suchwow/templates/index.html

54 lines
1.6 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 total_pages %}
<div class="page-btn">
{% for p in range(1, total_pages + 1) %}
<a href="{% if request.args.submitter %}/?submitter={{ request.args.submitter }}&{% else %}/?{% endif %}page={{ p }}" class="pure-button btn {% if p == page %}current-page-btn{% endif %}">{{ p }}</a>
{% endfor %}
</div>
{% endif %}
</div>
{% endblock %}