From fc5200e319cd373cec56ebd453ef595a2ea52bc9 Mon Sep 17 00:00:00 2001
From: Runxi Yu
Date: Mon, 11 Nov 2024 21:56:26 +0800
Subject: Snacks
---
sjdbmk/menu.py | 6 +++---
sjdbmk/weekly.py | 2 ++
templates/template.html | 41 +++++++++++++++++++++++++++--------------
3 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/sjdbmk/menu.py b/sjdbmk/menu.py
index 85d8589..d966ee5 100644
--- a/sjdbmk/menu.py
+++ b/sjdbmk/menu.py
@@ -170,9 +170,9 @@ def parse_snacks(datetime_target: datetime.datetime) -> dict[str, list[str]]:
raise ValueError("snacks not found")
i += 2
return {
- "Morning": row[i][2:7],
- "Afternoon": row[i + 1][2:7],
- "Evening": row[i + 2][2:7],
+ "Morning": [a.value for a in rows[i][2:7]],
+ "Afternoon": [a.value for a in rows[i + 1][2:7]],
+ "Evening": [a.value for a in rows[i + 2][2:7]],
}
# parse_meal_table(rows, i)
diff --git a/sjdbmk/weekly.py b/sjdbmk/weekly.py
index fa73d55..565e8c8 100644
--- a/sjdbmk/weekly.py
+++ b/sjdbmk/weekly.py
@@ -91,6 +91,7 @@ def generate(
the_week_ahead_aod_page_number,
)
menu_data = menu.parse_menus(datetime_target)
+ snack_data = menu.parse_snacks(datetime_target)
logger.info("Packing final data")
final_data = {
@@ -98,6 +99,7 @@ def generate(
"community_time": community_time,
"aods": aods,
"menu": menu_data,
+ "snacks": snack_data,
}
logger.info("Dumping data to: %s" % output_filename)
diff --git a/templates/template.html b/templates/template.html
index 769b1c1..055bef6 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -62,15 +62,7 @@
{{weekday_chinese}}快乐!感谢您支持每日公告。请注意,每日公告只是每周展望的补充,并不代表官方信息。我们不对信息的准确性和有效性承担责任。请填写相应表格以分享灵感或退订。
-
- Daily Bulletin Project Info 每日公告项目信息
-
- The Daily Bulletin project has returned. Last year, it was maintained by Albert Tan, who departed the school. The bulletin is now maintained by Runxi Yu with the automated build system (GitHub).
-
-
- Note: This version of the Daily Bulletin is still in beta. Importantly, this version has not been approved officially by the school administration, and is unfit for wider distribution. Only a number of people who the maintainer is sufficiently familiar with are receiving the bulletins currently.
-
-
+
{% if community_time %}
Community Time 午休时间
{% endif %}
+
+ Calendar Events 日历事件
+
+ We are planning to include content from the Songjiang Shared Calendar here, but the APIs are rather cumbersome to work with. This is a placeholder.
+
+
+
Delicious Dinings 今日佳肴
- {% if days_after_this == -1 %}
- Note: The machine-readable menus emailed to the Daily Bulletin staff do not contain end-of-week dinner and weekend meals.
- {% endif %}
- I am aware that the menu currently looks a bit ugly; I am not experienced in webpage layout at all. HTML/CSS experts wanted!
Daily Inspiration 每日灵感
{% if inspiration_type %}
@@ -416,7 +429,7 @@
{% endif %}
- (Actually, we have inspirations, the system is just kind-of broken and I’m a bit too busy to fix it for now.)
+ (Daily inspirations are still broken. Sorry!)
{% if on_this_day_html_en or on_this_day_html_zh %}
--
cgit v1.2.3