From 6de625ae9fdc1d19d9aa3908fd5ebdcc4a2aa359 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Sun, 1 Nov 2026 21:38:18 +0900 Subject: hp-archive: カテゴリの件数をボタンからページ下部へ移動 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - フィルターボタンはラベルだけにし、件数の内訳はご注意の末尾に表示 - 件数は表から実行時に集計する --- src/components/ScheduleInteractive.astro | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/ScheduleInteractive.astro b/src/components/ScheduleInteractive.astro index e02b32a..cb33ce9 100644 --- a/src/components/ScheduleInteractive.astro +++ b/src/components/ScheduleInteractive.astro @@ -521,7 +521,7 @@ filtersEl.innerHTML = buttonDefs .map( (b) => - `` + `` ) .join(''); filtersEl.querySelectorAll('.schedule-filter-btn').forEach((btn) => { @@ -529,7 +529,20 @@ }); } + // 件数はフィルターのボタンには出さず、ページ下部にまとめて表示する。 + function renderCategorySummary() { + const summaryEl = document.getElementById('schedule-category-summary'); + if (!summaryEl) return; + const councilCount = entries.filter(isCouncil).length; + const fields = CATEGORY_DEFS.map((c) => `${c.label}${counts[c.icon] || 0}件`).join('、'); + summaryEl.textContent = + `現在の登録件数は、審議会等(会議)${meetingEntries.length}件(うち市議会${councilCount}件)、` + + `イベント${eventEntries.length}件の合計${entries.length}件です。` + + `分野別では、${fields}です(会議とイベントの両方を含みます)。`; + } + buildFilters(); + renderCategorySummary(); applyFilter(); renderCalendar(); if (selectedDate) showDayDetails(selectedDate); -- cgit v1.3.1