diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-01 21:38:18 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-01 21:38:18 +0900 |
| commit | 6de625ae9fdc1d19d9aa3908fd5ebdcc4a2aa359 (patch) | |
| tree | ee92495849e15039f59b3dd74387629b20fe8717 /src/components/ScheduleInteractive.astro | |
| parent | a53a7446d6c536992c96ca667cbab8a2136a7776 (diff) | |
hp-archive: カテゴリの件数をボタンからページ下部へ移動
- フィルターボタンはラベルだけにし、件数の内訳はご注意の末尾に表示
- 件数は表から実行時に集計する
Diffstat (limited to 'src/components/ScheduleInteractive.astro')
| -rw-r--r-- | src/components/ScheduleInteractive.astro | 15 |
1 files changed, 14 insertions, 1 deletions
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) => - `<button type="button" class="schedule-filter-btn" data-category="${b.category}" aria-pressed="${b.category === activeCategory}">${b.icon ? `${b.icon} ` : ''}${b.label} (${b.count})</button>` + `<button type="button" class="schedule-filter-btn" data-category="${b.category}" aria-pressed="${b.category === activeCategory}">${b.icon ? `${b.icon} ` : ''}${b.label}</button>` ) .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); |
