diff --git a/content/pages/worklog/argos.md b/content/pages/worklog/argos.md index f232485..6061bb5 100644 --- a/content/pages/worklog/argos.md +++ b/content/pages/worklog/argos.md @@ -1,8 +1,8 @@ --- title: Argos save_as: argos/index.html -template: worklog total_days: 8 +template: worklog --- ## Jeudi 23 Novembre 2023 (0h, 1h bénévoles, 3/5) diff --git a/content/pages/worklog/idlv.md b/content/pages/worklog/idlv.md new file mode 100644 index 0000000..ebd8f08 --- /dev/null +++ b/content/pages/worklog/idlv.md @@ -0,0 +1,61 @@ +--- +title: IDLV, site web vers ghost +save_as: idlv-ghost/index.html +total_days: 2 +template: worklog +--- + +## 30 Octobre 2023 (0h, 1h bénévoles, 2/5) + +Incorporation des changements de Charly + +## 13 Septembre 2023 (0h, 3h bénévoles, 3/5) + +Incorporation des changements suite à discussion + +## 20 Juillet 2023 (0h, 1h bénévoles, 1/5) + +(Depuis les vacances) + +Réponse à un mail de Charly + +## 23 Juin 2023 (1h, 1h bénévoles, 3/5) + +Ajout de la fonctionnalité de galerie. + +## 22 Juin 2023 (1h, 2/5) + +Mail + recherches photoswipe ghost. + +## 06 Juin 2023 (3h, 4/5) + +- Déploiement sur Alwaysdata. +- Discussion avec leur support. +- Copie des données déjà importées +- Création des comptes pour Marin et Laura + + +## 05 Juin 2023 (4h, 5/5) + +(Dans le train) + +- Fini l'intégration du thème (quasiment) +- Importé quelques posts (mais c'est très long) et toutes les pages du site actuel. +- Me renseigner sur le fonctionnement de l'export de données dans Ghost. Il faudra faire un vrai backup des données et des fichiers. + +## 01 Juin 2023 (3h, 5/5) + +(Dans le train) + +- Commencé le thème. Mieux compris le fonctionnement de Hugo (ma foi, c'est barré). +- Modifié le thème de base de Ghost pour reprendre l'aspect du site actuel. +- Me familiariser avec scss. +- Comprendre qu'il est possible de faire un yarn dev pour que les modifications du thème en local se retrouvent sur l'interface. + +## 25 Mai 2023 (2h, 4/5) + +- Installation de Ghost localement. +- Récupération de l'ancien site. Se rendre compte que les templates ne sont pas à jour. +- Conditions tarifaires de AlwaysData : 7€/mois payés annuellement (=84€HT = 100,8€ à l'année) +- Lu [la doc de Handlebar](https://handlebarsjs.com/guide/block-helpers.html#raw-blocks) et de Ghost pour les templates https://ghost.org/docs/themes/structure/ +- Fait un test d'installation de Ghost sur Alwaysdata diff --git a/mnmlist/templates/worklog.html b/mnmlist/templates/worklog.html index f3c1bd2..df687e9 100644 --- a/mnmlist/templates/worklog.html +++ b/mnmlist/templates/worklog.html @@ -13,13 +13,17 @@ {% set percentage_value = (percentage / 100.0) %} {% set full_blocks = ((percentage_value * total_blocks) | round(0, 'floor') ) | int %} {% set empty_blocks = total_blocks - full_blocks %} -
+
{# Display full blocks #} {% for i in range(full_blocks) %}▓{% endfor %} {# Display empty blocks #} {% for i in range(empty_blocks) %}░{% endfor %} - {{ percentage }}% ({{ page.metadata.worklog['done_hours'] }}h / {{ page.metadata.worklog['total_hours'] }} prévues) + {{ percentage }}% ({{ page.metadata.worklog['payed_hours'] }}h / {{ page.metadata.worklog['total_hours'] }} prévues)
+ {% endif %}
diff --git a/simplereader.py b/simplereader.py index 45ef1d4..e134daa 100644 --- a/simplereader.py +++ b/simplereader.py @@ -15,7 +15,7 @@ locale.setlocale(locale.LC_TIME, "fr_FR") class WorklogPreprocessor(Preprocessor): pattern = re.compile( r""" - (\w+)\s+ # Day name + (?:(\w+)\s+)? # Day name (\d{1,2})\s+ # Day number ([\wéû]+)\s+ # Month name (\d{4})\s+ # Year @@ -63,19 +63,21 @@ class WorklogPreprocessor(Preprocessor): "volunteer_hours": volunteer_hours, "happyness": happiness, } + displayed_date = date.strftime("%A %d %B %Y") # Replace the line with just the date - new_lines.append(f"## 🗓️ {day_of_week} {day} {month} {year}") + new_lines.append(f"## 🗓️ {displayed_date}") else: new_lines.append(line) return new_lines def compute_data(self, metadata): - done_hours = sum([item["payed_hours"] for item in self.data.values()]) - + payed_hours = sum([item["payed_hours"] for item in self.data.values()]) + volunteer_hours = sum([item["volunteer_hours"] for item in self.data.values()]) data = dict( data=self.data, - done_hours=done_hours, + payed_hours=payed_hours, + volunteer_hours=volunteer_hours, template="worklog", ) @@ -84,7 +86,7 @@ class WorklogPreprocessor(Preprocessor): data.update( dict( total_hours=total_hours, - percentage=round(done_hours / total_hours * 100), + percentage=round(payed_hours / total_hours * 100), ) )