From b19673a947c94eb4febc929182c3a565bd3b5852 Mon Sep 17 00:00:00 2001 From: ng0 Date: Mon, 4 Nov 2019 21:55:28 +0000 Subject: ev: generate list of protocols. --- locale/de/LC_MESSAGES/messages.po | 13 ++++----- locale/en/LC_MESSAGES/messages.po | 8 ++---- locale/es/LC_MESSAGES/messages.po | 10 ++----- locale/fr/LC_MESSAGES/messages.po | 10 ++----- locale/it/LC_MESSAGES/messages.po | 10 ++----- template.py | 59 ++++++++------------------------------- template/ev.html.j2 | 27 ++++-------------- 7 files changed, 35 insertions(+), 102 deletions(-) diff --git a/locale/de/LC_MESSAGES/messages.po b/locale/de/LC_MESSAGES/messages.po index 7e910520..38c3fce9 100644 --- a/locale/de/LC_MESSAGES/messages.po +++ b/locale/de/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-11-04 21:36+0000\n" +"POT-Creation-Date: 2019-11-04 21:53+0000\n" "PO-Revision-Date: 2018-02-24 17:42\n" "Last-Translator: Torsten Grothoff \n" "Language-Team: German \n" @@ -627,15 +627,11 @@ msgstr "" msgid "Official Meeting Notes" msgstr "Offizielle Protokolle" -#: template/ev.html.j2:74 -msgid "2013-12 (constitutional meeting)" -msgstr "2013-12 (Gründungstreffen)" - -#: template/ev.html.j2:99 +#: template/ev.html.j2:84 msgid "Support Us!" msgstr "Unterstützung anbieten!" -#: template/ev.html.j2:101 +#: template/ev.html.j2:86 msgid "" "Everybody is welcome to support us via donations. For financial " "contributions, Europeans are able to donate via SEPA. We hope to setup " @@ -1985,6 +1981,9 @@ msgstr "" msgid "Videos related to GNUnet" msgstr "" +#~ msgid "2013-12 (constitutional meeting)" +#~ msgstr "2013-12 (Gründungstreffen)" + #, fuzzy #~| msgid "IRC Archive" #~ msgid "IRC archive" diff --git a/locale/en/LC_MESSAGES/messages.po b/locale/en/LC_MESSAGES/messages.po index 09659044..c10ac148 100644 --- a/locale/en/LC_MESSAGES/messages.po +++ b/locale/en/LC_MESSAGES/messages.po @@ -584,15 +584,11 @@ msgstr "" msgid "Official Meeting Notes" msgstr "" -#: template/ev.html.j2:74 -msgid "2013-12 (constitutional meeting)" -msgstr "" - -#: template/ev.html.j2:99 +#: template/ev.html.j2:84 msgid "Support Us!" msgstr "" -#: template/ev.html.j2:101 +#: template/ev.html.j2:86 msgid "" "Everybody is welcome to support us via donations. For financial " "contributions, Europeans are able to donate via SEPA. We hope to setup " diff --git a/locale/es/LC_MESSAGES/messages.po b/locale/es/LC_MESSAGES/messages.po index dd8bd2cf..10c7a34f 100644 --- a/locale/es/LC_MESSAGES/messages.po +++ b/locale/es/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-11-04 21:36+0000\n" +"POT-Creation-Date: 2019-11-04 21:53+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -610,15 +610,11 @@ msgstr "" msgid "Official Meeting Notes" msgstr "" -#: template/ev.html.j2:74 -msgid "2013-12 (constitutional meeting)" -msgstr "" - -#: template/ev.html.j2:99 +#: template/ev.html.j2:84 msgid "Support Us!" msgstr "" -#: template/ev.html.j2:101 +#: template/ev.html.j2:86 msgid "" "Everybody is welcome to support us via donations. For financial " "contributions, Europeans are able to donate via SEPA. We hope to setup " diff --git a/locale/fr/LC_MESSAGES/messages.po b/locale/fr/LC_MESSAGES/messages.po index caeafa93..287614d0 100644 --- a/locale/fr/LC_MESSAGES/messages.po +++ b/locale/fr/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-11-04 21:36+0000\n" +"POT-Creation-Date: 2019-11-04 21:53+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -604,15 +604,11 @@ msgstr "" msgid "Official Meeting Notes" msgstr "" -#: template/ev.html.j2:74 -msgid "2013-12 (constitutional meeting)" -msgstr "" - -#: template/ev.html.j2:99 +#: template/ev.html.j2:84 msgid "Support Us!" msgstr "" -#: template/ev.html.j2:101 +#: template/ev.html.j2:86 msgid "" "Everybody is welcome to support us via donations. For financial " "contributions, Europeans are able to donate via SEPA. We hope to setup " diff --git a/locale/it/LC_MESSAGES/messages.po b/locale/it/LC_MESSAGES/messages.po index 7392708a..5e8c71d1 100644 --- a/locale/it/LC_MESSAGES/messages.po +++ b/locale/it/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-11-04 21:36+0000\n" +"POT-Creation-Date: 2019-11-04 21:53+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -604,15 +604,11 @@ msgstr "" msgid "Official Meeting Notes" msgstr "" -#: template/ev.html.j2:74 -msgid "2013-12 (constitutional meeting)" -msgstr "" - -#: template/ev.html.j2:99 +#: template/ev.html.j2:84 msgid "Support Us!" msgstr "" -#: template/ev.html.j2:101 +#: template/ev.html.j2:86 msgid "" "Everybody is welcome to support us via donations. For financial " "contributions, Europeans are able to donate via SEPA. We hope to setup " diff --git a/template.py b/template.py index 87dbcb3c..5cae5bdc 100755 --- a/template.py +++ b/template.py @@ -191,12 +191,19 @@ def copy_static(locale, indict): print(locale + "/" + key + " ...to... " + locale + "/" + value) -# fileop(in, out, "copy") +# TODO: Move the lists elsewhere? + +meetingnotes = [ + { "year": "2013", "date": "2013-12-27" }, + { "year": "2014", "date": "2014-12-28" }, + { "year": "2015", "date": "2015-12-29" }, + { "year": "2016", "date": "2016-12-28" }, + { "year": "2017", "date": "2017-12-27" }, + { "year": "2018", "date": "2018-12-27" }, +] # At this moment in time, constructing this list dynamically would be -# too much pointless code. In fact all of what we use in jinja is -# no real use of jinja yet and furthermore we would be better off -# just using static html + css + some awk and other base tools. +# too much pointless code. newsposts = [ { "page": "2019-0.11.8.html", @@ -718,6 +725,7 @@ def generate_site(root): content = tmpl.render(lang=locale, lang_full=langs_full[locale], url=url, + meetingnotesdata=meetingnotes, newsdata=newsposts, videosdata=videoslist, self_localized=self_localized, @@ -764,46 +772,3 @@ def main(): if __name__ == "__main__": main() - -# for in_file in glob.glob("news/*.j2"): -# name, ext = re.match(r"(.*)\.([^.]+)$", in_file.rstrip(".j2")).groups() -# tmpl = env.get_template(in_file) - -# def self_localized(other_locale): -# """ -# Return URL for the current page in another locale. -# """ -# return "../" + other_locale + "/" + in_file.replace('news/', -# '').rstrip(".j2") - -# def url_localized(filename): -# return "../" + locale + "/" + filename - -# def svg_localized(filename): -# lf = filename + "." + locale + ".svg" -# if locale == "en" or not os.path.isfile(lf): -# return "../" + filename + ".svg" -# else: -# return "../" + lf - -# def url(x): -# # TODO: look at the app root environment variable -# # TODO: check if file exists -# return "../" + x - -# for f in glob.glob("locale/*/"): -# locale = os.path.basename(f[:-1]) -# content = tmpl.render(lang=locale, -# lang_full=langs_full[locale], -# url=url, -# self_localized=self_localized, -# url_localized=url_localized, -# svg_localized=svg_localized, -# filename=name + "." + ext) -# out_name = "./rendered/" + locale + "/news/" + in_file.replace('news/', '').rstrip(".j2") -# outdir = Path("rendered") -# langdir = outdir / locale / "news" -# langdir.mkdir(parents=True, exist_ok=True) -# # os.makedirs("./rendered/" + locale + "/news/", exist_ok=True) -# with codecs.open(out_name, "w", encoding='utf-8') as f: -# f.write(content) diff --git a/template/ev.html.j2 b/template/ev.html.j2 index 70c2ad81..ba138df9 100644 --- a/template/ev.html.j2 +++ b/template/ev.html.j2 @@ -69,28 +69,13 @@

{{ _("Official Meeting Notes") }}

-

-

    -
  • {{ _("2013-12 (constitutional meeting)") }} - (txt) -
  • -
  • 2014-12 - (txt) -
  • -
  • 2015-12 - (txt) -
  • -
  • 2016-12 - (txt) +
      + {% for item in meetingnotesdata %} +
    • + {{ item['year'] }}: (Protocol: txt)
    • -
    • 2017-12 - (txt) -
    • -
    • 2018-12 - (txt) -
    • -
    -

    + {% endfor %} +
-- cgit v1.2.3