]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/blog/modules/post.html
339be0c0f47e518971804df9af6120d5a4bf7257
[ipfire.org.git] / src / templates / blog / modules / post.html
1 {% import ipfire.accounts as accounts %}
2
3 <div class="blog-post {% if "lightningwirelabs.com" in post.tags %}lightning-wire-labs{% end %}">
4 <div class="blog-header">
5 <h4 class="card-title">
6 <a href="https://blog.ipfire.org/post/{{ post.slug }}">
7 {{ post.title }}
8 </a>
9 </h4>
10
11 <p class="small text-muted">
12 {{ _("by") }}
13
14 {% if isinstance(post.author, accounts.Account) %}
15 <a href="/authors/{{ post.author.uid }}">{{ post.author.name }}</a>,
16 {% else %}
17 <strong>{{ post.author }}</strong>,
18 {% end %}
19
20 {% if post.is_published() %}
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 %}
27 {% elif post.published_at %}
28 <span class="text-danger">{{ _("Scheduled to be published %s") % locale.format_date(post.published_at, relative=False) }}</span>
29 {% else %}
30 {{ _("Not published") }}
31 {% end %}
32
33 {% if current_user and current_user == post.author %}
34 <a href="/post/{{ post.slug }}/edit">{{ _("Edit") }}</a>
35 {% end %}
36 </p>
37 </div>
38
39 <div class="blog-content">
40 {% raw post.html %}
41 </div>
42
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 <span class="fas fa-external-link-alt"></span>
47 </a>
48 {% end %}
49
50 {% if post.release %}
51 <a class="btn btn-primary" href="https://www.ipfire.org/download/{{ post.release.slug }}">
52 {{ _("Download %s now") % post.release }}
53 </a>
54 {% end %}
55
56 {% if post.release or "donate" in post.tags %}
57 <a class="btn btn-outline-primary ml-2" href="https://www.ipfire.org/donate">
58 <span class="fas fa-heart"></span> {{ _("Donate") }}
59 </a>
60 {% end %}
61 </div>
62
63 {% if not post.is_published() %}
64 <form action="/post/{{ post.slug }}/publish" method="POST">
65 {% raw xsrf_form_html() %}
66
67 <div class="btn-toolbar mt-5">
68 <button type="submit" class="btn btn-primary btn-block btn-lg">
69 {{ _("Publish") }}
70 </button>
71 </div>
72 </form>
73 {% end %}
74 </div>