2020-07-15 08:18:13 +00:00
{% extends 'base.html' %}
2020-08-08 06:12:33 +00:00
{% block content %}
2020-07-16 07:41:19 +00:00
2020-08-08 06:12:33 +00:00
< div class = "container" style = "text-align:center;" >
2020-07-16 07:41:19 +00:00
2021-04-27 04:21:23 +00:00
<!-- <h3>Leaderboards</h3>
2021-03-08 07:41:15 +00:00
< 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 >
2021-04-27 04:21:23 +00:00
< hr > -->
2021-03-08 07:41:15 +00:00
2021-04-27 04:21:23 +00:00
< h1 class = "title" > Latest Posts< / h1 >
2020-07-16 07:41:19 +00:00
2021-04-27 04:21:23 +00:00
< section class = "section" >
2020-08-10 06:59:45 +00:00
{% if posts %}
2021-04-27 04:21:23 +00:00
{% for row in posts | batch(4) %}
< div class = "columns" >
{% for post in row %}
< div class = "column" >
< div class = "card" >
< div class = "card-image" >
< figure class = "image is-192x192" >
< a href = "{{ url_for('post.read', id=post.id) }}" >
< img src = "{{ url_for('post.uploaded_file', filename=post.get_thumbnail_name()) }}" alt = "Placeholder image" >
< / a >
< / figure >
< / div >
< div class = "card-content" >
< div class = "media" >
< div class = "media-content" >
< p class = "title is-4" >
< a href = "{{ url_for('post.read', id=post.id) }}" > {{ post.title }}< / a >
< / p >
< p class = "subtitle is-6" > < a href = "/?submitter={{ post.submitter }}" > {{ post.submitter }}< / a > < / p >
< / div >
< / div >
< div class = "content" >
{{ post.text | truncate(60) }}
<!-- <br> -->
< p > < strong > {{ post.get_received_wow() }} WOW received< / strong > < / p >
< time datetime = "2016-1-1" > {{ post.timestamp.year }}-{{ post.timestamp.month }}-{{ post.timestamp.day }} {{ post.timestamp.hour }}:{{ post.timestamp.minute }} UTC< / time >
< / div >
< / div >
< / div >
< / div >
{% endfor %}
< / div >
2020-08-10 06:59:45 +00:00
{% endfor %}
{% else %}
< p > No posts yet!< / p >
{% endif %}
2021-04-27 04:21:23 +00:00
< / section >
2020-07-16 07:41:19 +00:00
2021-04-17 07:44:26 +00:00
{% if total_pages %}
2021-04-27 04:21:23 +00:00
< nav class = "pagination is-centered pb-4" role = "navigation" aria-label = "pagination" >
< ul class = "pagination-list" >
{% for p in range(1, total_pages + 1) %}
< a href = "{% if request.args.submitter %}/?submitter={{ request.args.submitter }}&{% else %}/?{% endif %}page={{ p }}" class = "pagination-link {% if p == page %}current-page-btn{% endif %}" > {{ p }}< / a >
{% endfor %}
< / ul >
< / nav >
2021-04-17 07:44:26 +00:00
{% endif %}
2020-08-08 06:12:33 +00:00
2021-04-27 04:21:23 +00:00
2020-08-08 06:12:33 +00:00
< / div >
2020-07-28 20:31:07 +00:00
{% endblock %}