v0.5.85: move matches page summary next to pager.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
voson
2026-07-29 18:36:22 +08:00
co-authored by Cursor
parent b01552ee6e
commit ef31e43d6c
6 changed files with 56 additions and 28 deletions
+6
View File
@@ -4,6 +4,12 @@
## [Unreleased] ## [Unreleased]
## [0.5.85] - 2026-07-29
### Changed
- 「比赛」场次摘要「共 N 场 · 第 X/Y 页」移到底部分页区,与页码同栏。
## [0.5.84] - 2026-07-29 ## [0.5.84] - 2026-07-29
### Fixed ### Fixed
+1 -1
View File
@@ -51,7 +51,7 @@ from shared.paths import (
from serve_relations import WEB_DIR, build_payload from serve_relations import WEB_DIR, build_payload
SITE_VERSION = "0.5.84" SITE_VERSION = "0.5.85"
DEFAULT_OSS_BASE = "https://climperor.oss-cn-shanghai.aliyuncs.com" DEFAULT_OSS_BASE = "https://climperor.oss-cn-shanghai.aliyuncs.com"
+17 -9
View File
@@ -3732,7 +3732,6 @@ function renderMatchesPage() {
const body = $("#matches-body"); const body = $("#matches-body");
const originsEl = $("#matches-origins"); const originsEl = $("#matches-origins");
const playersEl = $("#matches-players"); const playersEl = $("#matches-players");
const sub = $("#matches-sub");
if (!body) return; if (!body) return;
const origin = MATCH_ORIGIN_FILTERS.some((o) => o.id === state.matchesOrigin) const origin = MATCH_ORIGIN_FILTERS.some((o) => o.id === state.matchesOrigin)
@@ -3813,7 +3812,6 @@ function renderMatchesPage() {
if (!hasData) { if (!hasData) {
body.innerHTML = body.innerHTML =
'<div class="rankings-empty">暂无比赛数据(请运行 python web/fetch_pro_matches.py</div>'; '<div class="rankings-empty">暂无比赛数据(请运行 python web/fetch_pro_matches.py</div>';
if (sub) sub.textContent = "";
return; return;
} }
@@ -3837,12 +3835,9 @@ function renderMatchesPage() {
} }
const start = (page - 1) * pageSize; const start = (page - 1) * pageSize;
const rows = allRows.slice(start, start + pageSize); const rows = allRows.slice(start, start + pageSize);
const summary = total
if (sub) {
sub.textContent = total
? `${total} 场 · 第 ${page}/${pageCount}` ? `${total} 场 · 第 ${page}/${pageCount}`
: ""; : "";
}
if (!rows.length) { if (!rows.length) {
body.innerHTML = state.matchesPlayerId body.innerHTML = state.matchesPlayerId
@@ -3854,9 +3849,8 @@ function renderMatchesPage() {
const wrap = document.createElement("div"); const wrap = document.createElement("div");
wrap.className = "matches-page-wrap"; wrap.className = "matches-page-wrap";
wrap.appendChild(buildMatchList(null, rows, { showHero: true })); wrap.appendChild(buildMatchList(null, rows, { showHero: true }));
if (pageCount > 1) {
wrap.appendChild( wrap.appendChild(
buildMatchesPager(page, pageCount, (next) => { buildMatchesFoot(summary, page, pageCount, (next) => {
state.matchesPage = next; state.matchesPage = next;
syncStateToUrl(); syncStateToUrl();
renderMatchesPage(); renderMatchesPage();
@@ -3864,10 +3858,24 @@ function renderMatchesPage() {
if (board) board.scrollTop = 0; if (board) board.scrollTop = 0;
}) })
); );
}
body.replaceChildren(wrap); body.replaceChildren(wrap);
} }
function buildMatchesFoot(summaryText, page, pageCount, onGo) {
const foot = document.createElement("div");
foot.className = "matches-foot";
if (summaryText) {
const summary = document.createElement("p");
summary.className = "matches-foot-summary";
summary.textContent = summaryText;
foot.appendChild(summary);
}
if (pageCount > 1) {
foot.appendChild(buildMatchesPager(page, pageCount, onGo));
}
return foot;
}
function buildMatchesPager(page, pageCount, onGo) { function buildMatchesPager(page, pageCount, onGo) {
const nav = document.createElement("nav"); const nav = document.createElement("nav");
nav.className = "matches-pager"; nav.className = "matches-pager";
+1 -1
View File
@@ -1,4 +1,4 @@
/* Local defaults; production export overwrites via export_relations_site.py. */ /* Local defaults; production export overwrites via export_relations_site.py. */
var SITE_VERSION = "0.5.84"; var SITE_VERSION = "0.5.85";
var ABILITY_VIDEO_BASE = ""; var ABILITY_VIDEO_BASE = "";
var STATIC_ASSET_BASE = ""; var STATIC_ASSET_BASE = "";
+5 -6
View File
@@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>DOTA2 上分帝</title> <title>DOTA2 上分帝</title>
<link rel="icon" href="/ui-icon/dota2_logo.png" type="image/png" /> <link rel="icon" href="/ui-icon/dota2_logo.png" type="image/png" />
<link rel="stylesheet" href="/style.css?v=0.5.84" /> <link rel="stylesheet" href="/style.css?v=0.5.85" />
<script src="/mobile-gate.js?v=0.5.84"></script> <script src="/mobile-gate.js?v=0.5.85"></script>
</head> </head>
<body> <body>
<div id="mobile-gate" class="mobile-gate" role="dialog" aria-labelledby="mobile-gate-title" aria-modal="true"> <div id="mobile-gate" class="mobile-gate" role="dialog" aria-labelledby="mobile-gate-title" aria-modal="true">
@@ -91,7 +91,6 @@
<aside class="rankings-aside" aria-label="比赛筛选"> <aside class="rankings-aside" aria-label="比赛筛选">
<div class="matches-origins" id="matches-origins" role="tablist" aria-label="职业或国服"></div> <div class="matches-origins" id="matches-origins" role="tablist" aria-label="职业或国服"></div>
<div class="matches-players" id="matches-players" role="tablist" aria-label="选择选手"></div> <div class="matches-players" id="matches-players" role="tablist" aria-label="选择选手"></div>
<p class="rankings-sub" id="matches-sub"></p>
</aside> </aside>
</div> </div>
</div> </div>
@@ -166,8 +165,8 @@
<section class="detail" id="detail" aria-live="polite"></section> <section class="detail" id="detail" aria-live="polite"></section>
<script src="/config.js?v=0.5.84"></script> <script src="/config.js?v=0.5.85"></script>
<script src="/router.js?v=0.5.84"></script> <script src="/router.js?v=0.5.85"></script>
<script src="/app.js?v=0.5.84"></script> <script src="/app.js?v=0.5.85"></script>
</body> </body>
</html> </html>
+16 -1
View File
@@ -2653,13 +2653,28 @@ body:has(#items-view:not(.hidden)) {
gap: 16px; gap: 16px;
width: 100%; width: 100%;
} }
.matches-foot {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 4px 0 8px;
}
.matches-foot-summary {
margin: 0;
font-size: 13px;
font-weight: 500;
color: var(--muted);
line-height: 1.4;
text-align: center;
}
.matches-pager { .matches-pager {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 6px; gap: 6px;
padding: 4px 0 8px; padding: 0;
} }
.matches-pager-btn { .matches-pager-btn {
min-width: 36px; min-width: 36px;