aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-01 20:56:50 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-01 20:56:50 +0900
commitf734d21b06d97ec1171422a304649eb508848967 (patch)
tree750cfa0467356c72ce6bccdec3b7353866632e52 /src/components
parentbae1df8dd99c26d5a74dd6dbc63d24aa0ab8f441 (diff)
hp-archive: フィルターに「市議会」を追加
- 会議名に「小平市議会」を含む行だけを表示する絞り込みを追加 - 絞り込み中の表示に内部キーが出ていたのを修正
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ScheduleInteractive.astro14
1 files changed, 13 insertions, 1 deletions
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 = `<span class="schedule-table-status-text">${text}</span>`;
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,