<section class="hero is-medium">
<div class="hero-body">
<div class="container">
- <div class="columns is-vcentered">
- <div class="column">
- <h1 class="title">
- IPFire <span class="has-text-primary">Blog</span>
- </h1>
-
- <h5 class="subtitle is-5">
- {% if q %}
- {{ _("Search Results for '%s'") % q }}
- {% else %}
- Releases, security updates, and stories from the IPFire community
- {% end %}
- </h5>
- </div>
-
- {# Encourage people to subscribe #}
- {% if not current_user or not current_user.consents_to_promotional_emails %}
- <div class="column is-one-quarter">
- <div class="card">
- <div class="card-content">
- <div class="block">
- <p class="heading">
- Newsletter
- </p>
-
- <p>
- <small>
- Get new posts and release notes delivered
- straight to your inbox. No spam.
- </small>
- </p>
- </div>
-
- {# Show a button to sign up for anonymous users #}
- {% if not current_user %}
- <div class="block">
- <a class="button is-primary is-small is-fullwidth wrap-text" href="/join">
- <span class="icon">
- <i class="fa-solid fa-envelope"></i>
- </span>
- <span>{{ _("Join Now & Subscribe") }}</span>
- </a>
- </div>
-
- {# Show a button to subscribe if users are logged in, but not yet subscribed #}
- {% elif current_user and not current_user.consents_to_promotional_emails %}
- <div class="block">
- <a class="button is-success is-fullwidth" href="/subscribe">
- <span class="icon">
- <i class="fa-solid fa-envelope"></i>
- </span>
- <span>{{ _("Subscribe") }}</span>
- </a>
- </div>
- {% end %}
- </div>
- </div>
- </div>
+ <h1 class="title">
+ IPFire <span class="has-text-primary">Blog</span>
+ </h1>
+
+ <h5 class="subtitle is-5">
+ {% if q %}
+ {{ _("Search Results for '%s'") % q }}
+ {% else %}
+ Releases, security updates, and stories from the IPFire community
{% end %}
- </div>
+ </h5>
</div>
</div>
</section>
</div>
{% end %}
- {% module BlogList(posts, latest=latest_post) %}
+ {% module BlogList(posts, latest=latest_post, encourage_to_subscribe=not q) %}
{# Show links to older years... #}
{% module BlogHistoryNavigation() %}
-{% for post in posts %}
+{% for i, post in enumerate(posts) %}
{# Highlight the latest post #}
{% set highlighted = (post == latest) %}
</div>
</div>
</div>
+
+ {# Encourage people to subscribe #}
+ {% if encourage_to_subscribe %}
+ {% if i == 0 %}
+ {% if not current_user or not current_user.consents_to_promotional_emails %}
+ <div class="columns">
+ <div class="column is-two-thirds">
+ <p>
+ <strong>
+ {{ _("Sign Up To Our Newsletter")}}
+ </strong>
+ </p>
+
+ <p>
+ <small>
+ Get new posts and release notes delivered
+ straight to your inbox. No spam.
+ </small>
+ </p>
+ </div>
+
+ {# Show a button to sign up for anonymous users #}
+ {% if not current_user %}
+ <div class="column is-one-third">
+ <a class="button is-primary is-fullwidth wrap-text" href="/join">
+ <span class="icon">
+ <i class="fa-solid fa-envelope"></i>
+ </span>
+
+ <span>
+ {{ _("Join Now & Subscribe") }}
+ </span>
+ </a>
+ </div>
+
+ {# Show a button to subscribe if users are logged in, but not yet subscribed #}
+ {% elif current_user and not current_user.consents_to_promotional_emails %}
+ <div class="column is-one-third">
+ <a class="button is-success is-fullwidth" href="/subscribe">
+ <span class="icon">
+ <i class="fa-solid fa-envelope"></i>
+ </span>
+
+ <span>
+ {{ _("Subscribe") }}
+ </span>
+ </a>
+ </div>
+ {% end %}
+ </div>
+ {% end %}
+ {% end %}
+ {% end %}
{% end %}
class ListModule(ui_modules.UIModule):
- def render(self, posts, latest=None, show_author=True):
- return self.render_string("blog/modules/list.html",
- posts=posts, latest=latest, show_author=show_author)
+ def render(self, posts, latest=None, show_author=True, encourage_to_subscribe=False):
+ return self.render_string("blog/modules/list.html", posts=posts, latest=latest,
+ show_author=show_author, encourage_to_subscribe=encourage_to_subscribe)
class TagModule(ui_modules.UIModule):