]> git.ipfire.org Git - ipfire.org.git/blame - src/templates/blog/modules/post.html
blog: Allow deleting posts
[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 4 <div class="blog-header">
53a70dd6 5 <h4 class="card-title">
4b2975d2
MT
6 <a href="https://blog.ipfire.org/post/{{ post.slug }}">
7 {{ post.title }}
8 </a>
53a70dd6 9 </h4>
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>
914238a5 35 <a href="/post/{{ post.slug }}/delete">{{ _("Delete") }}</a>
541c952b 36 {% end %}
4b2975d2
MT
37 </p>
38 </div>
f91dfcc7 39
4b2975d2
MT
40 <div class="blog-content">
41 {% raw post.html %}
42 </div>
1e76fec4 43
0e7c23da
MT
44 <div class="btn-toolbar justify-content-center">
45 {% if "lightningwirelabs.com" in post.tags and post.link %}
46 <a class="btn btn-lwl" href="{{ post.link }}">
5bd8950c 47 Go to Lightning Wire Labs <span class="fas fa-external-link-alt"></span>
0e7c23da
MT
48 </a>
49 {% end %}
50
51 {% if post.release %}
984e4e7b 52 <a class="btn btn-primary" href="https://www.ipfire.org/download/{{ post.release.slug }}">
5bd8950c 53 {{ _("Download %s now") % post.release }}
984e4e7b 54 </a>
ab4c98cf 55 {% end %}
984e4e7b 56
ab4c98cf 57 {% if post.release or "donate" in post.tags %}
984e4e7b 58 <a class="btn btn-outline-primary ml-2" href="https://www.ipfire.org/donate">
04e3763d 59 <span class="fas fa-heart"></span> {{ _("Donate") }}
984e4e7b 60 </a>
0e7c23da
MT
61 {% end %}
62 </div>
9ea64cef
MT
63
64 {% if not post.is_published() %}
65 <form action="/post/{{ post.slug }}/publish" method="POST">
66 {% raw xsrf_form_html() %}
67
68 <div class="btn-toolbar mt-5">
69 <button type="submit" class="btn btn-primary btn-block btn-lg">
70 {{ _("Publish") }}
71 </button>
72 </div>
73 </form>
74 {% end %}
f91dfcc7 75</div>