This repository was archived by the owner on Oct 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdates.html
47 lines (44 loc) · 1.49 KB
/
updates.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{% extends "layout.html" %}
{% block body %}
<a class="rss" href="/rss.xml"><img src="/static/rss.png" /></a>
<h2>TrueCraft Updates</h2>
{% for post in posts %}
<h3>
<a href="{{ url_for("html.view_blog", id=post.id, title=post.title) }}">{{ post.title }}</a>
<small>{{ post.created.strftime("%b %d, %Y") }}</small>
</h3>
{% if post.image.endswith(".webm") %}
<video src="{{ post.image.split(' ')[1] }}" autoplay loop>
<img src="{{ post.image.split(' ')[0] }}" />
</video>
{% else %}
<img src="{{ post.image }}" />
{% endif %}
<p>{{ post.text | firstparagraph | markdown }} <a href="{{ url_for("html.view_blog", id=post.id, title=post.title) }}">Read more »</a></p>
{% endfor %}
<div class="text-center">
<ul class="pagination">
{% if page != 1 %}
<li>
<a href="/updates?page={{ page - 1 }}" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
{% endif %}
{% for i in range(1, total_pages + 2) %}
{% if i == page %}
<li class="active"><a href="/updates?page={{ i }}">{{ i }}</a></li>
{% else %}
<li><a href="/updates?page={{ i }}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% if page != total_pages %}
<li>
<a href="/updates?page={{ page + 1 }}" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
{% endif %}
</ul>
</div>
{% endblock %}