]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/blog/modules/post.html
downloads: Move from "download" to "downloads"
[ipfire.org.git] / src / templates / blog / modules / post.html
1 {% import ipfire.accounts as accounts %}
2
3 <section 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="/blog/{{ 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="/blog/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 </p>
33 </div>
34
35 {% if not post.is_published() and post.is_editable(current_user) %}
36 <div class="row">
37 <div class="col-12 col-md-6 mb-3">
38 <div class="d-grid">
39 <a class="btn btn-success" href="/post/{{ post.slug }}/edit">
40 <span class="fas fa-edit mr-2"></span> {{ _("Edit") }}
41 </a>
42 </div>
43 </div>
44
45 <div class="col-12 col-md-6 mb-3">
46 <div class="d-grid">
47 <a class="btn btn-primary" href="/post/{{ post.slug }}/publish">
48 <span class="fas fa-book-reader mr-2"></span> {{ _("Publish") }}
49 </a>
50 </div>
51 </div>
52 </div>
53 {% end %}
54
55 <div class="blog-content">
56 {% raw post.html %}
57 </div>
58
59 <div class="btn-toolbar justify-content-center">
60 {% if "lightningwirelabs.com" in post.tags and post.link %}
61 <a class="btn btn-lwl" href="{{ post.link }}">
62 Go to Lightning Wire Labs <span class="fas fa-external-link-alt ml-2"></span>
63 </a>
64 {% end %}
65
66 {% if post.release %}
67 <a class="btn btn-primary" href="/downloads/{{ post.release.slug }}">
68 {{ _("Download") }}
69 </a>
70 {% end %}
71
72 {% if post.release or "donate" in post.tags %}
73 <a class="btn btn-outline-primary ml-2" href="/donate">
74 {{ _("Donate") }}
75 </a>
76 {% end %}
77 </div>
78 </section>