+++ /dev/null
-{% import ipfire.accounts as accounts %}
-
-<section class="blog-post {% if "lightningwirelabs.com" in post.tags %}lightning-wire-labs{% end %}">
- <div class="blog-header">
- <h4 class="card-title">
- <a href="/blog/{{ post.slug }}">
- {{ post.title }}
- </a>
- </h4>
-
- <p class="small text-muted">
- {{ _("by") }}
-
- {% if isinstance(post.author, accounts.Account) %}
- <a href="/users/{{ post.author.uid }}">{{ post.author.name }}</a>,
- {% else %}
- <strong>{{ post.author }}</strong>,
- {% end %}
-
- {% if post.is_published() %}
- {% if post.updated_at and post.updated_at > post.published_at %}
- {{ locale.format_date(post.published_at, shorter=True, relative=False) }},
- {{ _("Updated %s") % locale.format_date(post.updated_at, shorter=True) }}
- {% else %}
- {{ locale.format_date(post.published_at, shorter=True, relative=False) }}
- {% end %}
- {% elif post.published_at %}
- <span class="text-danger">{{ _("Scheduled to be published %s") % locale.format_date(post.published_at, relative=False) }}</span>
- {% else %}
- {{ _("Not published") }}
- {% end %}
- </p>
- </div>
-
- {% if not post.is_published() and post.is_editable(current_user) %}
- <div class="row">
- <div class="col-12 col-md-6 mb-3">
- <div class="d-grid">
- <a class="btn btn-success" href="/post/{{ post.slug }}/edit">
- <span class="fas fa-edit mr-2"></span> {{ _("Edit") }}
- </a>
- </div>
- </div>
-
- <div class="col-12 col-md-6 mb-3">
- <div class="d-grid">
- <a class="btn btn-primary" href="/post/{{ post.slug }}/publish">
- <span class="fas fa-book-reader mr-2"></span> {{ _("Publish") }}
- </a>
- </div>
- </div>
- </div>
- {% end %}
-
- <div class="blog-content">
- {% raw post.html %}
- </div>
-
- <div class="btn-toolbar justify-content-center">
- {% if "lightningwirelabs.com" in post.tags and post.link %}
- <a class="btn btn-lwl" href="{{ post.link }}">
- Go to Lightning Wire Labs <span class="fas fa-external-link-alt ml-2"></span>
- </a>
- {% end %}
-
- {% if post.release %}
- <a class="btn btn-primary" href="/downloads/{{ post.release.slug }}">
- {{ _("Download") }}
- </a>
- {% end %}
-
- {% if post.release or "donate" in post.tags %}
- <a class="btn btn-outline-primary ml-2" href="/donate">
- {{ _("Donate") }}
- </a>
- {% end %}
- </div>
-</section>
def render(self, posts, relative=False, show_author=True):
return self.render_string("blog/modules/list.html",
posts=posts, relative=relative, show_author=show_author)
-
-
-class PostModule(ui_modules.UIModule):
- def render(self, post):
- return self.render_string("blog/modules/post.html", post=post)