Skip to content

Commit c0f6d95

Browse files
committed
fix for year in call_for_contributors
1 parent 25a1bca commit c0f6d95

File tree

15 files changed

+71
-65
lines changed

15 files changed

+71
-65
lines changed

src/server/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
accentless_sort,
1313
get_versioned_filename,
1414
)
15+
from datetime import datetime
1516
from .config import TEMPLATES_DIR, STATIC_DIR
1617
from . import csp, feature_policy
1718
import logging
@@ -72,6 +73,7 @@ def add_header(response):
7273
app.jinja_env.globals["year_live"] = year_live
7374
app.jinja_env.globals["get_versioned_filename"] = get_versioned_filename
7475
app.jinja_env.filters["accentless_sort"] = accentless_sort
76+
app.jinja_env.globals['now'] = datetime.now
7577

7678
talisman = Talisman(
7779
app,

src/templates/base/base.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,10 @@
634634
{% endblock %}
635635
{% endblock %}
636636

637+
{% block call_for_contributors %}
638+
https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062
639+
{% endblock %}
640+
637641
{% macro figure_dropdown(metadata, chapter_config, id, sheets_gid="", sql_file="", image="", caption="") %}
638642
{% if sheets_gid != "" or sql_file != "" or image != "" %}
639643
<div class="figure-dropdown nav-dropdown">

src/templates/en/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="en">
23+
<p>
2424
You’re viewing a previous edition of the Web Almanac.
2525
Check out the <a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">{{ DEFAULT_YEAR }} edition!</a>
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="en">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>Call for Contributors:</b></a> Help create the Web Almanac 2025 and be part of the team shaping this year’s edition!
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>Call for Contributors:</b></a> Help create the {{ now().year }} Web Almanac— be part of the team shaping this year’s edition!
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

src/templates/es/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="es">
23+
<p>
2424
Estás viendo una edición anterior del Web Almanac.
2525
¡Consulta <a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">a edición de {{ DEFAULT_YEAR }}!</a>
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="es">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>Convocatoria para colaboradores:</b></a> ¡Ayuda a crear el Web Almanac 2025 y forma parte del equipo que da forma a la edición de este año!
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>Convocatoria para colaboradores:</b></a> Ayuda a crear el Web Almanac {{ now().year }}— ¡sé parte del equipo que da forma a la edición de este año!
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

src/templates/fr/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="fr">
23+
<p>
2424
Vous consultez une édition précédente du Web Almanac.
2525
Découvrez <a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">l’édition {{ DEFAULT_YEAR }}!</a>
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="fr">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>Appel à contributions:</b></a> Aidez à créer le Web Almanac 2025 et faites partie de léquipe qui façonne lédition de cette année !
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>Appel à contributions:</b></a> Aidez à créer le Web Almanac {{ now().year }} — faites partie de l'équipe qui façonne l'édition de cette année !
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

src/templates/hi/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="hi">
23+
<p>
2424
आप वेब पंचांग का पिछला संस्करण देख रहे हैं।
2525
<a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">{{ DEFAULT_YEAR }} संस्करण</a> देखें!
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="hi">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>योगदानकर्ताओं के लिए आह्वान:</b></a> Web Almanac 2025 बनाने में मदद करें और इस वर्ष के संस्करण को आकार देने वाली टीम का हिस्सा बनें!
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>योगदानकर्ताओं के लिए आह्वान:</b></a> {{ now().year }} Web Almanac बनाने में मदद करेंइस वर्ष की संस्करण को आकार देने वाली टीम का हिस्सा बनें!
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

src/templates/it/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="it">
23+
<p>
2424
Stai visualizzando un’edizione precedente del Web Almanac.
2525
Dai un’occhiata all’<a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">edizione del {{ DEFAULT_YEAR }}!</a>
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="it">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>Chiamata per i contributori:</b></a> Aiuta a creare il Web Almanac 2025 ed entra a far parte del team che darà forma all’edizione di quest’anno!
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>Chiamata per i contributori:</b></a> Aiuta a creare il Web Almanac {{ now().year }}— entra a far parte del team che darà forma all’edizione di quest’anno!
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

src/templates/ja/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="ja">
23+
<p>
2424
ご覧になっているのは、Web Almanac の以前の版です。
2525
<a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">{{ DEFAULT_YEAR }} 年版</a>をご覧ください。
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="ja">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>コントリビューター募集中:</b></a> Web Almanac 2025 の作成に参加して、今年のエディションを形作るチームの一員になりましょう!
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>コントリビューター募集中:</b></a> {{ now().year }} Web Almanac の作成にご協力ください— 今年のエディションを形作るチームの一員になりましょう!
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

src/templates/nl/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="nl">
23+
<p>
2424
U bekijkt een eerdere editie van de Web Almanac.
2525
Bekijk de <a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">editie van {{ DEFAULT_YEAR }}!</a>
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="nl">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>Oproep aan bijdragers:</b></a> Help mee met het maken van de Web Almanac 2025 en word onderdeel van het team dat deze editie vormgeeft!
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>Oproep aan bijdragers:</b></a> Help mee de Web Almanac {{ now().year }} te maken— en word onderdeel van het team dat deze editie vormgeeft!
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

src/templates/pt/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
{% block announcement_text -%}
2222
{%- if year < DEFAULT_YEAR -%}
23-
<p lang="pt">
23+
<p>
2424
Você está visualizando uma edição anterior do Web Almanac.
2525
Confira a <a href="/{{ lang }}/{{ DEFAULT_YEAR }}/{% if chapter_lang_exists(lang, DEFAULT_YEAR, slug) or page_lang_exists(lang, DEFAULT_YEAR, slug) %}{{ slug }}{% endif %}">edição de {{ DEFAULT_YEAR }}!</a>
2626
</p>
27-
{%- elif year == DEFAULT_YEAR -%}
28-
<p lang="pt">
29-
📣 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/discussions/4062">
30-
<b>Chamada para Contribuidores:</b></a> Ajude a criar o Web Almanac 2025 e faça parte da equipe que está moldando a edição deste ano!
27+
{%- elif self.call_for_contributors() | trim | length > 0 -%}
28+
<p>
29+
📣 <a href="{{ self.call_for_contributors() }}">
30+
<b>Chamada para Contribuidores:</b></a> Ajude a criar o Web Almanac de {{ now().year }} — faça parte da equipe que está moldando a edição deste ano!
3131
</p>
3232
{%- endif -%}
3333
{% endblock %}

0 commit comments

Comments
 (0)