Skip to content

Commit 7bc1744

Browse files
committed
Fix header navigation and bilingual student pricing
1 parent c48d50d commit 7bc1744

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function renderMenu() {
106106
elements.menuGrid.innerHTML = visibleItems.map((item) => {
107107
const price = item.single_price
108108
? `<strong class="regular-price">NTD ${item.price_non_ntust_twd}</strong><span class="single-price-label">${inlineBilingual("單一價格", "Single price")}</span>`
109-
: `<strong class="regular-price">NTD ${item.price_non_ntust_twd}</strong><span class="member-price">${inlineBilingual(`NTUST 學生職員價 NTD ${item.price_ntust_twd}`, `NTUST student & staff NTD ${item.price_ntust_twd}`)}</span>`;
109+
: `<strong class="regular-price">NTD ${item.price_non_ntust_twd}</strong><span class="member-price"><span class="zh">NTUST 學生職員價 NTD ${item.price_ntust_twd}</span><span class="en">NTUST student & staff NTD ${item.price_ntust_twd}</span></span>`;
110110
return `<article class="menu-card">
111111
<div>
112112
<p class="menu-store">${inlineBilingual(item.store_name_zh, item.store_name_en)}</p>

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
<body data-language="both">
2121
<a class="skip-link" href="#main">跳至主要內容 / Skip to content</a>
2222
<header class="site-header">
23-
<a class="wordmark" href="#top" aria-label="COSCUP 2026 NTUST Food List">
23+
<a class="wordmark" href="https://coscup.org/2026/" aria-label="COSCUP 2026 首頁 Back to COSCUP 2026">
2424
<img class="site-logo" src="https://coscup.org/2026/_ipx/w_3072&amp;f_png/coscup_logo_white.png" alt="COSCUP × UbuCon Asia">
2525
<span class="wordmark-kicker">MENU</span>
2626
</a>
2727
<div class="header-actions">
2828
<nav class="site-nav" aria-label="主要導覽 Main navigation">
29+
<a href="#top"><span class="zh">本頁頂端</span><span class="en">Top</span></a>
2930
<a href="#stores"><span class="zh">店家</span><span class="en">Stores</span></a>
3031
<a href="#menu"><span class="zh">找餐點</span><span class="en">Menu</span></a>
3132
<a href="#open-data"><span class="zh">開放資料</span><span class="en">Open data</span></a>
@@ -45,6 +46,7 @@
4546
</summary>
4647
<div class="mobile-menu__panel">
4748
<nav aria-label="手機導覽 Mobile navigation">
49+
<a href="#top"><span class="zh">本頁頂端</span><span class="en">Top</span></a>
4850
<a href="#stores"><span class="zh">店家</span><span class="en">Stores</span></a>
4951
<a href="#menu"><span class="zh">找餐點</span><span class="en">Menu</span></a>
5052
<a href="#open-data"><span class="zh">開放資料</span><span class="en">Open data</span></a>

scripts/validate_site.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ const oPassItems = menu.items.filter((item) => item.store_id === "o-pass-chicken
2828
if (oPassItems.filter((item) => item.muslim_friendly).length !== 12) throw new Error("Expected 12 item-level Muslim-friendly labels for O-Pass Chicken");
2929
if (oPassItems.some((item) => /pork/i.test(item.dish_name_en) && item.muslim_friendly)) throw new Error("Pork dishes must not be labeled Muslim-friendly");
3030
if (!oPassItems.some((item) => item.dish_name_en === "Signature Pork Rice Bowl (Small)")) throw new Error("Original Signature Pork translation is missing");
31-
for (const anchor of ["stores", "menu", "open-data", "thanks"]) {
31+
for (const anchor of ["top", "stores", "menu", "open-data", "thanks"]) {
3232
if (!html.includes(`id="${anchor}"`)) throw new Error(`Missing page section: ${anchor}`);
3333
}
3434
for (const headerClass of ["site-logo", "site-nav", "mobile-menu", "language-select"]) {
3535
if (!html.includes(`class="${headerClass}`)) throw new Error(`Missing COSCUP-style header element: ${headerClass}`);
3636
}
3737
if (html.includes("清真友善店家") || html.includes("Muslim-friendly store")) throw new Error("Store-level Muslim-friendly filter label must not appear");
38+
if (!html.includes('href="https://coscup.org/2026/"')) throw new Error("The header logo must return to COSCUP 2026");
39+
if (!html.includes('href="#top"><span class="zh">本頁頂端</span><span class="en">Top</span>')) throw new Error("The header must provide a separate top-of-page action");
3840
if (!html.includes("一般價最高預算") || !app.includes('class="regular-price"') || !app.includes("item.price_non_ntust_twd")) throw new Error("Regular price must be the primary website price");
41+
if (!app.includes('class="member-price"><span class="zh">NTUST 學生職員價')) throw new Error("Bilingual NTUST prices must render on separate lines");
3942
for (const asset of ["styles.css", "app.js", "data/menu.csv", "data/menu.json", "data/stores.json"]) {
4043
if (!html.includes(asset)) throw new Error(`Missing page asset link: ${asset}`);
4144
}

styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ input[type="range"] { width: 100%; accent-color: var(--ink); }
382382
.price-box .regular-price { display: block; font-size: 24px; line-height: 1.05; letter-spacing: -.03em; }
383383
.price-box .member-price, .price-box .single-price-label { display: block; margin-top: 7px; color: #5c6266; font-size: 10px; font-weight: 800; line-height: 1.3; }
384384
.price-box .member-price .zh, .price-box .member-price .en,
385-
.price-box .single-price-label .zh, .price-box .single-price-label .en { color: inherit; }
385+
.price-box .single-price-label .zh, .price-box .single-price-label .en { display: block; color: inherit; }
386386
.show-more { margin: 34px auto 0; }
387387
.show-more:not([hidden]) { display: flex; }
388388
.empty-state { grid-column: 1 / -1; padding: 60px 20px; border: 2px dashed var(--ink); border-radius: var(--radius); text-align: center; }

0 commit comments

Comments
 (0)