Render Gold post-match pages from held read-only review data (by Codex)

This commit is contained in:
Codex authored and Codex committed 2026-10-27 09:12:36 +01:00
1 parent 86f248bbd5
commit 3f1a44b320
13 files changed
+1392 -13

No files matched your search

+2 -6
View File
@@ -137,6 +137,7 @@ std::string App::live_dialog_markup(const Json &owner) {
return "<div class=\"live-dialog-layer\"><div id=\"live-dialog\" class=\"live-dialog\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"live-dialog-heading\">" + body + "</div></div>";
}
std::string App::render_live() {
if(live_review_) return render_postmatch();
if (!live_.available()) return "";
if (auto *node = element("live-ticker")) live_ticker_scroll_ = live_reset_ticker_ ? 0 : node->GetScrollTop();
if (auto *node = element("live-detail-body")) live_detail_scroll_ = live_reset_detail_ ? 0 : node->GetScrollTop();
@@ -152,12 +153,6 @@ std::string App::render_live() {
const auto &value = live_score_by_id(frame, match.at("id"));
return "<div class=\"live-scoreline\">" + live_text(match.at("home").at("name"), "live-team-name home") + live_badge(match.at("home"), 58) + live_text(live_score_text(value.at("score")), "live-score") + live_badge(match.at("away"), 58) + live_text(match.at("away").at("name"), "live-team-name away") + "</div>";
};
if (live_review_) {
out += "<section class=\"live-review live-panel\"><h2>" + live_text("Die Demoaufzeichnung ist abgeschlossen.") + "</h2><p class=\"live-note\">" + live_text("Diese Ergebnisse und Berichte sind vorgegeben. Datum, Tabellen, Konten und Saisonfortschritt der Quelle wurden nicht verändert.") + "</p>";
for (const auto &match : fixture.at("matches")) out += "<article class=\"live-review-card\" data-live-result=\"" + esc(match.at("id").get<std::string>()) + "\">" + scoreline(match) + "<p>" + live_text("1:0 · Führung der Heimelf | Halbzeit 1:0 | 1:1 · Ausgleich | 2:1 · Endstand nach " + std::to_string(fixture.at("duration").get<int>()) + " Minuten") + "</p></article>";
out += "</section><footer class=\"live-bottom\"><div class=\"live-bottom-actions\">" + btn("live-back", "Zum Desktop", "", "id=\"live-back\"") + "</div>" + live_text("Kein Saisonfortschritt · keine Spielwertänderung", "live-bottom-note") + btn("live-review-back", "Zum Ticker", "", "id=\"live-review-back\"") + "</footer></section>";
return out;
}
out += "<div id=\"live-underlay\" class=\"live-body\"><div class=\"live-left\"><section class=\"live-panel live-overview\"><nav class=\"live-coverage\">";
for (const auto &[id, text] : std::array<std::pair<const char *, const char *>, 3>{{{"all", "Alle Spiele"}, {"single", "Einzelspiel"}, {"conference", "Konferenz"}}})
out += btn("live-coverage", text, live_coverage_ == id ? "selected" : "", "id=\"live-coverage-" + std::string(id) + "\" data-id=\"" + id + "\"");
@@ -195,6 +190,7 @@ std::string App::render_live() {
return out + live_dialog_markup(owner) + "</section>";
}
void App::live_after_render() {
if(live_review_){postmatch_after_render();return;}
if (scene_ != "live" || !live_restore_scroll_) return;
live_restore_scroll_ = false;
if (auto *node = element("live-ticker")) node->SetScrollTop(live_ticker_scroll_);