aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-08 09:21:59 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-08 09:21:59 +0900
commitaefd89227ce390d5220563d8112fc026ea3c7e45 (patch)
tree1cd18e4ca3ca6eb47e9aacd5ce6c6041f3fd1f97 /src/components
parent78115e6ea1728cff51cdf65d13f14666cacd300e (diff)
水飲み場: 「手洗いのみ」の区別を復元し、表示に注記する
kodaira-parks.json: 移行前の「水飲み・手洗い」と「手洗い」の 区別をgit履歴から復元する ParksTable.astro / ParkMap.astro: 手洗いだけの場合は 「水飲み場(水飲水栓なし)」と表示する
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ParkMap.astro8
-rw-r--r--src/components/ParksTable.astro8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/components/ParkMap.astro b/src/components/ParkMap.astro
index 5a1a530..910f6d1 100644
--- a/src/components/ParkMap.astro
+++ b/src/components/ParkMap.astro
@@ -1252,16 +1252,22 @@
.filter((s) => DISASTER_KEEP.test(s))
.join("、");
// 水飲み場は「水飲み場x1」のように、手洗いも含めて数を示す。
+ // 水飲み専用の水栓がなく手洗いだけの場合は(水飲水栓なし)と添える。
const waterText = (value: string) => {
const text = String(value || "").trim();
if (!text) return "水飲み場なし";
if (/[??]/.test(text)) return "水飲み場?";
let total = 0;
+ let hasDrink = false;
+ let hasWash = false;
for (const part of text.split(/[、,]/)) {
const nums = [...part.matchAll(/[x×](\d+)/g)].map((m) => Number(m[1]));
if (nums.length) total += nums.reduce((a, b) => a * b, 1);
+ if (/水飲/.test(part)) hasDrink = true;
+ if (/手洗/.test(part)) hasWash = true;
}
- return total > 0 ? `水飲み場x${total}` : "水飲み場";
+ const label = !hasDrink && hasWash ? "水飲み場(水飲水栓なし)" : "水飲み場";
+ return total > 0 ? `${label}x${total}` : label;
};
const water = waterText(String(rec?.["水飲み場"] || ""));
// ○/〇 などの表記は「〜あり」にして意味が分かるようにする。
diff --git a/src/components/ParksTable.astro b/src/components/ParksTable.astro
index 81a93e2..92b21c9 100644
--- a/src/components/ParksTable.astro
+++ b/src/components/ParksTable.astro
@@ -173,11 +173,17 @@ const waterText = (value: string) => {
if (!text) return "";
if (/[??]/.test(text)) return "水飲み場?";
let total = 0;
+ let hasDrink = false;
+ let hasWash = false;
for (const part of text.split(/[、,]/)) {
const nums = [...part.matchAll(/[x×](\d+)/g)].map((m) => Number(m[1]));
if (nums.length) total += nums.reduce((a, b) => a * b, 1);
+ if (/水飲/.test(part)) hasDrink = true;
+ if (/手洗/.test(part)) hasWash = true;
}
- return total > 0 ? `水飲み場x${total}` : "水飲み場";
+ // 水飲み専用の水栓がなく、手洗いだけの場合はその旨を添える。
+ const label = !hasDrink && hasWash ? "水飲み場(水飲水栓なし)" : "水飲み場";
+ return total > 0 ? `${label}x${total}` : label;
};
function disasterText(value: string): string {
return value