]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/blog/modules/post.html
blog: Allow to edit and create new posts
[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 <h5 class="mb-0">
6 <a href="https://blog.ipfire.org/post/{{ post.slug }}">
7 {{ post.title }}
8 </a>
9 </h5>
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 {{ locale.format_date(post.published_at, shorter=True, relative=False) }}
21
22 {% if current_user and current_user == post.author %}
23 <a href="/post/{{ post.slug }}/edit">{{ _("Edit") }}</a>
24 {% end %}
25 </p>
26 </div>
27
28 <div class="blog-content">
29 {% raw post.html %}
30 </div>
31
32 <div class="btn-toolbar justify-content-center">
33 {% if "lightningwirelabs.com" in post.tags and post.link %}
34 <a class="btn btn-lwl" href="{{ post.link }}">
35 Go to Lightning Wire Labs <!-- XXX icon -->
36 </a>
37 {% end %}
38
39 {% if post.release %}
40 <a class="btn btn-primary" href="https://www.ipfire.org/download/{{ post.release.slug }}">
41 {{ _("Download %s now") % post.release }} <!-- XXX icon -->
42 </a>
43 {% end %}
44
45 {% if post.release or "donate" in post.tags %}
46 <a class="btn btn-outline-primary ml-2" href="https://www.ipfire.org/donate">
47 <svg class="icon i_heart"><use xlink:href="#heart"/></svg> {{ _("Donate") }}
48 </a>
49 {% end %}
50 </div>
51 </div>