Skip to content

Commit b509843

Browse files
committed
Move coffee order page URL
1 parent 0df7e49 commit b509843

8 files changed

Lines changed: 19 additions & 19 deletions

File tree

app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ def history_date(date: str):
155155
RATINGS = ["🔥 夯", "👑 顶级", "🧑‍💻 人上人", "😐 NPC", "💩 拉完了"]
156156

157157

158-
# ── 咖啡投票 ──────────────────────────────────────────────────────────────
159-
@app.get("/coffee_vote", response_class=HTMLResponse)
160-
def coffee_vote_page():
158+
# ── 咖啡点单 ──────────────────────────────────────────────────────────────
159+
@app.get("/coffee_order", response_class=HTMLResponse)
160+
def coffee_order_page():
161161
tmpl_file = TMPL_DIR / "coffee_vote.html"
162162
return tmpl_file.read_text(encoding="utf-8")
163163

@@ -227,7 +227,7 @@ def cancel_coffee_vote(week: str, body: dict = {}):
227227

228228
@app.get("/refresh")
229229
def refresh_coffee_votes(token: str = ""):
230-
"""隐藏入口:把当前投票存档到 archive/ 后清空,然后跳回投票页。需 token。"""
230+
"""隐藏入口:把当前点单存档到 archive/ 后清空,然后跳回点单页。需 token。"""
231231
if token != ADMIN_TOKEN:
232232
raise HTTPException(status_code=403, detail="Forbidden")
233233
import datetime as dt
@@ -246,7 +246,7 @@ def refresh_coffee_votes(token: str = ""):
246246
)
247247
votes_file.unlink()
248248

249-
return RedirectResponse(url="/coffee_vote", status_code=303)
249+
return RedirectResponse(url="/coffee_order", status_code=303)
250250

251251

252252
# ── 海报轮播 ──────────────────────────────────────────────────────────────

build_static.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ def rewrite_html(html: str, path_from_site_root: str) -> str:
6262
replacements = [
6363
(r'href="/"', f'href="{prefix}index.html"'),
6464
(r'href="/papers"', f'href="{prefix}papers/index.html"'),
65-
(r'href="/coffee_vote"', f'href="{prefix}coffee_vote/index.html"'),
66-
(r'href="/coffee_vote_test"', f'href="{prefix}coffee_vote_test/index.html"'),
65+
(r'href="/coffee_order"', f'href="{prefix}coffee_order/index.html"'),
66+
(r'href="/coffee_order_test"', f'href="{prefix}coffee_order_test/index.html"'),
6767
(r'href="/poster"', f'href="{prefix}poster/index.html"'),
6868
(r"href='/papers'", f"href='{prefix}papers/index.html'"),
69-
(r"href='/coffee_vote'", f"href='{prefix}coffee_vote/index.html'"),
70-
(r"href='/coffee_vote_test'", f"href='{prefix}coffee_vote_test/index.html'"),
69+
(r"href='/coffee_order'", f"href='{prefix}coffee_order/index.html'"),
70+
(r"href='/coffee_order_test'", f"href='{prefix}coffee_order_test/index.html'"),
7171
(r"href='/poster'", f"href='{prefix}poster/index.html'"),
7272
(r"fetch('/ratings/' + arxivId)", "Promise.resolve({json: async () => ({ratings: {}})})"),
7373
(r"fetch('/thoughts/' + arxivId)", "Promise.resolve({json: async () => ({entries: []})})"),
@@ -188,8 +188,8 @@ def render_site(site_dir: Path) -> None:
188188
all_papers_by_id.setdefault(paper["arxiv_id"], paper)
189189

190190
write_page(site_dir, "poster/index.html", (TMPL_DIR / "poster.html").read_text(encoding="utf-8"))
191-
write_page(site_dir, "coffee_vote/index.html", (TMPL_DIR / "coffee_vote.html").read_text(encoding="utf-8"))
192-
write_page(site_dir, "coffee_vote_test/index.html", (TMPL_DIR / "coffee_vote_test.html").read_text(encoding="utf-8"))
191+
write_page(site_dir, "coffee_order/index.html", (TMPL_DIR / "coffee_vote.html").read_text(encoding="utf-8"))
192+
write_page(site_dir, "coffee_order_test/index.html", (TMPL_DIR / "coffee_vote_test.html").read_text(encoding="utf-8"))
193193

194194

195195
def main() -> None:

templates/coffee_vote.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
<div class="nav-tabs">
309309
<a class="nav-tab" href="/">HOME</a>
310310
<a class="nav-tab" href="/papers">论文</a>
311-
<a class="nav-tab active" href="/coffee_vote">咖啡点单</a>
311+
<a class="nav-tab active" href="/coffee_order">咖啡点单</a>
312312
<a class="nav-tab" href="/poster">海报</a>
313313
</div>
314314

templates/coffee_vote_test.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@
150150
<div class="nav-tabs">
151151
<a class="nav-tab" href="/">HOME</a>
152152
<a class="nav-tab" href="/papers">论文</a>
153-
<a class="nav-tab" href="/coffee_vote">咖啡点单</a>
153+
<a class="nav-tab" href="/coffee_order">咖啡点单</a>
154154
<a class="nav-tab" href="/poster">海报</a>
155-
<a class="nav-tab active" href="/coffee_vote_test">Supabase Test</a>
155+
<a class="nav-tab active" href="/coffee_order_test">Supabase Test</a>
156156
</div>
157157

158158
<main>

templates/home.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<div class="nav-tabs">
173173
<a class="nav-tab active" href="/">HOME</a>
174174
<a class="nav-tab" href="/papers">论文</a>
175-
<a class="nav-tab" href="/coffee_vote">咖啡点单</a>
175+
<a class="nav-tab" href="/coffee_order">咖啡点单</a>
176176
<a class="nav-tab" href="/poster">海报</a>
177177
</div>
178178

@@ -192,7 +192,7 @@ <h1>Astro Papers, Coffee, and Research Sparks</h1>
192192
</p>
193193
<div class="quick-links">
194194
<a href="/papers">看本周论文</a>
195-
<a href="/coffee_vote">点咖啡</a>
195+
<a href="/coffee_order">点咖啡</a>
196196
<a href="/poster">看海报</a>
197197
</div>
198198
<div class="details">

templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310

311311
<div class="nav-tabs">
312312
<a class="nav-tab active" href="/">论文</a>
313-
<a class="nav-tab" href="/coffee_vote">咖啡点单</a>
313+
<a class="nav-tab" href="/coffee_order">咖啡点单</a>
314314
<a class="nav-tab" href="/poster">海报</a>
315315
</div>
316316

templates/papers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
<div class="nav-tabs">
312312
<a class="nav-tab" href="/">HOME</a>
313313
<a class="nav-tab active" href="/papers">论文</a>
314-
<a class="nav-tab" href="/coffee_vote">咖啡点单</a>
314+
<a class="nav-tab" href="/coffee_order">咖啡点单</a>
315315
<a class="nav-tab" href="/poster">海报</a>
316316
</div>
317317

templates/poster.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
<div class="nav-tabs">
220220
<a class="nav-tab" href="/">HOME</a>
221221
<a class="nav-tab" href="/papers">论文</a>
222-
<a class="nav-tab" href="/coffee_vote">咖啡点单</a>
222+
<a class="nav-tab" href="/coffee_order">咖啡点单</a>
223223
<a class="nav-tab active" href="/poster">海报</a>
224224
</div>
225225

0 commit comments

Comments
 (0)