diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-17 23:52:19 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-17 23:52:19 +0900 |
| commit | 9918d26666e0b7ac466a692d7ebb3d397a405ea8 (patch) | |
| tree | 4c3b1c3cfa36f6f1237fd67744dfeba535cee9e3 | |
| parent | 5216789b90514001fcf5e5f64c644374242ed196 (diff) | |
ScheduleInteractive.astro: 日別一覧にパブリックコメント受付中を表示
受付期間中の日付を選ぶと、その日の予定の上に「パブリックコメント受付中(12月15日まで)」と対象計画・担当を表示する。期間は src/data/schedule/pubcomments.json で管理する。
| -rw-r--r-- | src/components/ScheduleInteractive.astro | 26 | ||||
| -rw-r--r-- | src/data/schedule/pubcomments.json | 23 | ||||
| -rw-r--r-- | src/styles/custom.css | 32 |
3 files changed, 79 insertions, 2 deletions
diff --git a/src/components/ScheduleInteractive.astro b/src/components/ScheduleInteractive.astro index 4c31d99..9b596e2 100644 --- a/src/components/ScheduleInteractive.astro +++ b/src/components/ScheduleInteractive.astro @@ -1,6 +1,8 @@ <script> // URLは src/data/schedule/config.ts で一元管理している(ページ移転時はそこだけ変える) import { parseDates, applyExclusions, toKey, keyToDate, entryDates, mainStartMonth, normalizeDigits } from '@/lib/schedule-dates'; + // パブリックコメントの受付期間(日別一覧に「受付中」を出すために使う) + import pubcomments from '@/data/schedule/pubcomments.json'; const CATEGORY_DEFS = [ { icon: '👶', label: '子育て' }, @@ -310,6 +312,26 @@ }); const title = `${date.getMonth() + 1}月${date.getDate()}日(${weekday})の予定`; + // その日がパブリックコメントの受付期間内なら、予定の一覧の上に知らせる。 + const activePubcomments = pubcomments.filter((p) => key >= p.from && key <= p.to); + let pubcommentHtml = ''; + if (activePubcomments.length) { + const until = activePubcomments + .map((p) => p.to) + .sort() + .slice(-1)[0]; + const [, untilMonth, untilDay] = until.split('-').map(Number); + pubcommentHtml = `<div class="schedule-day-pubcomment"> + <p class="schedule-day-pubcomment-title">📝 パブリックコメント受付中(${untilMonth}月${untilDay}日まで)</p> + <ul>${activePubcomments + .map( + (p) => + `<li><a class="schedule-day-pubcomment-link" href="${p.url}" target="_blank" rel="noopener noreferrer">${escapeHtml(p.title)}</a><span class="schedule-day-meta">${escapeHtml(p.contact)}</span></li>`, + ) + .join('')}</ul> + </div>`; + } + // 会場の地図(ScheduleMap)に、その日の予定を知らせる。 const detail = { date: key, @@ -324,7 +346,7 @@ document.dispatchEvent(new CustomEvent('schedule:day', { detail })); if (list.length === 0) { - detailsEl.innerHTML = `<h3>${title}</h3><p>この日の予定はありません。</p>`; + detailsEl.innerHTML = `<h3>${title}</h3>${pubcommentHtml}<p>この日の予定はありません。</p>`; return; } @@ -337,7 +359,7 @@ }) .join(''); - detailsEl.innerHTML = `<h3>${title}</h3><ul>${items}</ul>`; + detailsEl.innerHTML = `<h3>${title}</h3>${pubcommentHtml}<ul>${items}</ul>`; detailsEl.querySelectorAll('a.schedule-day-link').forEach((a) => { a.addEventListener('click', () => { const row = document.getElementById(a.getAttribute('href').slice(1)); diff --git a/src/data/schedule/pubcomments.json b/src/data/schedule/pubcomments.json new file mode 100644 index 0000000..3347ac9 --- /dev/null +++ b/src/data/schedule/pubcomments.json @@ -0,0 +1,23 @@ +[ + { + "title": "小平市第五期地域福祉計画(素案)(令和9年度~令和17年度)", + "from": "2026-11-16", + "to": "2026-12-15", + "url": "https://www.city.kodaira.tokyo.jp/pubcome/130/130689.html", + "contact": "福祉政策課 042-312-1365" + }, + { + "title": "小平市地域包括ケア推進計画(素案)", + "from": "2026-11-16", + "to": "2026-12-15", + "url": "https://www.city.kodaira.tokyo.jp/pubcome/131/131091.html", + "contact": "高齢者支援課計画担当 042-346-9823" + }, + { + "title": "小平市障がい者計画等(素案)", + "from": "2026-11-16", + "to": "2026-12-15", + "url": "https://www.city.kodaira.tokyo.jp/pubcome/130/130569.html", + "contact": "障がい者支援課相談支援制度担当 042-312-1385" + } +] diff --git a/src/styles/custom.css b/src/styles/custom.css index 956323e..db35dd8 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -2246,6 +2246,38 @@ td.sanpi-open .sanpi-title { color: var(--sl-color-gray-3); font-size: 0.9rem; } + +/* 日別一覧の上に出す「パブリックコメント受付中」 */ +.schedule-day-pubcomment { + margin: 0 0 0.8rem; + padding: 0.55rem 0.75rem; + background: #fff8e1; + border: 1px solid #f0d98c; + border-left: 4px solid #e8a400; + border-radius: 8px; +} +.schedule-day-pubcomment-title { + margin: 0 0 0.35rem; + font-weight: 700; + font-size: 0.88rem; +} +.schedule-day-pubcomment ul { + margin: 0; + padding: 0; + list-style: none; +} +.schedule-day-pubcomment li { + margin: 0.15rem 0; + font-size: 0.85rem; +} +.schedule-day-pubcomment-link { + text-decoration: underline; +} +:root[data-theme="dark"] .schedule-day-pubcomment { + background: #332a12; + border-color: #6b5a1f; + border-left-color: #e8a400; +} .schedule-filters { display: flex; flex-wrap: wrap; |
