]> git.ipfire.org Git - ipfire.org.git/blame - src/templates/blog/modules/post.html
blog: Show better release time for drafts
[ipfire.org.git] / src / templates / blog / modules / post.html
CommitLineData
cdf85ee7
MT
1{% import ipfire.accounts as accounts %}
2
92fe6b3f 3<div class="blog-post {% if "lightningwirelabs.com" in post.tags %}lightning-wire-labs{% end %}">
4b2975d2
MT
4 <div class="blog-header">
5 <h5 class="mb-0">
6 <a href="https://blog.ipfire.org/post/{{ post.slug }}">
7 {{ post.title }}
8 </a>
9 </h5>
f91dfcc7 10
4b2975d2 11 <p class="small text-muted">
cdf85ee7
MT
12 {{ _("by") }}
13
14 {% if isinstance(post.author, accounts.Account) %}
c1cec959 15 <a href="/authors/{{ post.author.uid }}">{{ post.author.name }}</a>,
cdf85ee7 16 {% else %}
c1cec959
MT
17 <strong>{{ post.author }}</strong>,
18 {% end %}
cdf85ee7 19
52de8ae0 20 {% if post.is_published() %}
b228bd7c
MT
21 {% if post.updated_at and post.updated_at > post.published_at %}
22 {{ locale.format_date(post.published_at, shorter=True, relative=False) }},
23 {{ _("Updated %s") % locale.format_date(post.updated_at, shorter=True) }}
24 {% else %}
25 {{ locale.format_date(post.published_at, shorter=True, relative=False) }}
26 {% end %}
52de8ae0
MT
27 {% elif post.published_at %}
28 <span class="text-danger">{{ _("Scheduled to be published %s") % locale.format_date(post.published_at, relative=False) }}</span>
df157ede
MT
29 {% else %}
30 {{ _("Not published") }}
31 {% end %}
541c952b
MT
32
33 {% if current_user and current_user == post.author %}
34 <a href="/post/{{ post.slug }}/edit">{{ _("Edit") }}</a>
35 {% end %}
4b2975d2
MT
36 </p>
37 </div>
f91dfcc7 38
4b2975d2
MT
39 <div class="blog-content">
40 {% raw post.html %}
41 </div>
1e76fec4 42
0e7c23da
MT
43 <div class="btn-toolbar justify-content-center">
44 {% if "lightningwirelabs.com" in post.tags and post.link %}
45 <a class="btn btn-lwl" href="{{ post.link }}">
46 Go to Lightning Wire Labs <!-- XXX icon -->
47 </a>
48 {% end %}
49
50 {% if post.release %}
984e4e7b
MT
51 <a class="btn btn-primary" href="https://www.ipfire.org/download/{{ post.release.slug }}">
52 {{ _("Download %s now") % post.release }} <!-- XXX icon -->
53 </a>
ab4c98cf 54 {% end %}
984e4e7b 55
ab4c98cf 56 {% if post.release or "donate" in post.tags %}
984e4e7b
MT
57 <a class="btn btn-outline-primary ml-2" href="https://www.ipfire.org/donate">
58 <svg class="icon i_heart"><use xlink:href="#heart"/></svg> {{ _("Donate") }}
59 </a>
0e7c23da
MT
60 {% end %}
61 </div>
f91dfcc7 62</div>