From f734d21b06d97ec1171422a304649eb508848967 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Sun, 1 Nov 2026 20:56:50 +0900 Subject: hp-archive: フィルターに「市議会」を追加 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 会議名に「小平市議会」を含む行だけを表示する絞り込みを追加 - 絞り込み中の表示に内部キーが出ていたのを修正 --- src/components/ScheduleInteractive.astro | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/components/ScheduleInteractive.astro') diff --git a/src/components/ScheduleInteractive.astro b/src/components/ScheduleInteractive.astro index 3295125..e02b32a 100644 --- a/src/components/ScheduleInteractive.astro +++ b/src/components/ScheduleInteractive.astro @@ -11,6 +11,10 @@ { icon: '🤝', label: '交流・地域' }, ]; const MEETING_ICON = '🏛️'; + // 市議会の予定は審議会等と同じアイコンなので、会議名で見分ける。 + const COUNCIL_KEY = 'council'; + const isCouncil = (e: { type: string; name: string }) => + e.type === 'meeting' && e.name.includes('小平市議会'); const WEEKDAYS = ['日', '月', '火', '水', '木', '金', '土']; const WEEKDAY_MAP = { 日: 0, 月: 1, 火: 2, 水: 3, 木: 4, 金: 5, 土: 6 }; @@ -242,6 +246,7 @@ function matchesCategory(e) { if (activeCategory === 'all') return true; + if (activeCategory === COUNCIL_KEY) return isCouncil(e); if (activeCategory === MEETING_ICON) return e.type === 'meeting'; return e.category === activeCategory; } @@ -400,6 +405,7 @@ } function categoryLabel(category) { + if (category === COUNCIL_KEY) return '市議会'; if (category === MEETING_ICON) return '審議会等'; const def = CATEGORY_DEFS.find((c) => c.icon === category); return def ? def.label : '交流・地域'; @@ -427,7 +433,7 @@ const filtered = activeCategory !== 'all'; status.classList.toggle('is-filtered', filtered); const text = filtered - ? `${tableLabel}:「${activeCategory} ${categoryLabel(activeCategory)}」で絞り込み中:${visible}件/全${total}件` + ? `${tableLabel}:「${activeCategory === COUNCIL_KEY ? categoryLabel(activeCategory) : `${activeCategory} ${categoryLabel(activeCategory)}`}」で絞り込み中:${visible}件/全${total}件` : `${tableLabel}:全${total}件を表示しています(絞り込みなし)`; status.innerHTML = `${text}`; if (filtered) { @@ -499,6 +505,12 @@ label: '審議会等', count: meetingEntries.length, }, + { + category: COUNCIL_KEY, + icon: MEETING_ICON, + label: '市議会', + count: entries.filter(isCouncil).length, + }, ...CATEGORY_DEFS.map((c) => ({ category: c.icon, icon: c.icon, -- cgit v1.3.1