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-05-06 16:53:18 +00:00
< h1 class = "title" > {% if title %}{{ title }}{% else %}Latest Memes{% endif %}< / h1 >
2021-05-06 17:47:04 +00:00
{% if request.args.content == 'latest_tipped' %}
2021-05-06 17:46:15 +00:00
< a href = "/" > View Latest Memes< / a >
2021-05-06 16:53:18 +00:00
{% else %}
2021-05-06 17:46:15 +00:00
< a href = "/?content=latest_tipped" > View Latest Tipped Posts< / a >
2021-05-06 16:53:18 +00:00
{% endif %}
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 %}
2021-05-05 08:50:54 +00:00
{% set post = post.show() %}
2021-04-27 04:21:23 +00:00
< div class = "column" >
< div class = "card" >
< div class = "card-image" >
< a href = "{{ url_for('post.read', id=post.id) }}" >
2021-05-05 08:50:54 +00:00
< img src = "{{ url_for('post.uploaded_file', filename=post.thumbnail_name) }}" alt = "Placeholder image" >
2021-04-27 04:21:23 +00:00
< / a >
< / 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 >
2021-05-06 17:46:15 +00:00
< p class = "subtitle is-6" > < a href = "/?submitter={{ post.submitter }}" > {{ post.submitter }}< / a > < / p >
2021-04-27 04:21:23 +00:00
< / div >
< / div >
< div class = "content" >
{{ post.text | truncate(60) }}
2021-05-05 08:50:54 +00:00
< p > < strong > {{ post.received_wow }} WOW received< / strong > < / p >
2021-04-27 04:21:23 +00:00
< time datetime = "2016-1-1" > {{ post.timestamp.year }}-{{ post.timestamp.month }}-{{ post.timestamp.day }} {{ post.timestamp.hour }}:{{ post.timestamp.minute }} UTC< / time >
2021-05-05 08:50:54 +00:00
< p > ({{ post.timestamp | humanize }})< / p >
2021-04-27 04:21:23 +00:00
< / 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-05-05 08:50:54 +00:00
{% if total_pages %}
< nav class = "pagination is-centered pb-4" role = "navigation" aria-label = "pagination" >
< ul class = "pagination-list" >
{% for p in range(1, total_pages + 1) %}
2021-05-06 17:46:15 +00:00
< 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 >
2021-05-05 08:50:54 +00:00
{% endfor %}
< / ul >
< / nav >
{% endif %}
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 %}