Show line-ups before kickoff, bind form and table widgets, rewrite the press wording

- Live ticker: the paused live state carries both starting elevens; the ticker lists
  them until the first report. A single match no longer gets an empty strip above the
  score, repeated status lines are gone, whistles carry no club badge, dates are
  written out.
- Desk: "Die letzten Spiele" and the table place curve are fed by the engine
  (desktop-widgets read: recent, rankCurve) and belong to the default layout; the own
  crest widget is bound.
- News: the German press templates are rewritten to one plain sentence each (the
  catalogue accepts a single sentence now); the reference snapshots follow, and the
  catalogue test can rewrite them with --update. Mailbox texts show world spellings
  of clubs and players and the euro sign.
- Small type raised in advertising, lineup, news, toto, transfer and others; the
  transfer market column no longer runs under its scrollbar.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-14 12:36:33 +01:00
1 parent bd20960f90
commit 9708b720b2
33 files changed
+418 -373

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <array>
#include <chrono>
#include <string>
namespace bmh::modern_ui {
// An ISO date (2027-01-02) as the interface writes it: "Sa., 2. Januar 2027".
// Anything else is returned unchanged.
inline std::string ui_long_date(const std::string &iso) {
if (iso.size() != 10 || iso[4] != '-' || iso[7] != '-') return iso;
for (size_t i : {0u, 1u, 2u, 3u, 5u, 6u, 8u, 9u}) if (iso[i] < '0' || iso[i] > '9') return iso;
const int y = std::stoi(iso.substr(0, 4)), m = std::stoi(iso.substr(5, 2)), d = std::stoi(iso.substr(8, 2));
const auto ymd = std::chrono::year_month_day{std::chrono::year(y), std::chrono::month(unsigned(m)), std::chrono::day(unsigned(d))};
if (!ymd.ok()) return iso;
static constexpr std::array<const char *, 12> months{"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"};
static constexpr std::array<const char *, 7> weekdays{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."};
return std::string(weekdays[std::chrono::weekday{std::chrono::sys_days(ymd)}.c_encoding()]) + ", " + std::to_string(d) + ". " + months[size_t(m - 1)] + " " + std::to_string(y);
}
} // namespace bmh::modern_ui
+2
View File
@@ -147,6 +147,8 @@ Json default_desktop() {
objects["crest"] = object(8, 0, 2, 2, true, true);
objects["opponent-crest"] = object(10, 0, 2, 2, true, true);
objects["warnings"] = object(6, 2, 4, 2, true, true);
objects["own-curve"] = object(2, 4, 4, 2, true, true);
objects["results"] = object(6, 4, 4, 2, true, true);
objects["trash"] = object(14, 6, 1, 1, true, true);
for (const auto &route : desktop_routes()) {
const auto id = "app-" + route;
+2 -1
View File
@@ -318,7 +318,8 @@ Json engine_live_progress(const Json &previous, const Json &state, const Json &b
} catch (const std::exception &) {}
out["matches"].push_back({{"id", id}, {"home", home}, {"away", away}, {"owners", owners}, {"competition", competition},
{"attendance", m.value("attendance", Json())}, {"weather", m.value("weather", Json())}});
{"attendance", m.value("attendance", Json())}, {"weather", m.value("weather", Json())},
{"lineups", m.value("lineups", Json())}});
}
if (out.at("owners").empty() || out.at("matches").empty()) return failure("live_no_human_match");
}
+4 -6
View File
@@ -50,15 +50,13 @@ NewsCatalog engine_news_catalogue(const NewsCatalog &base) {
{"parameters", p},
{"guards", Json::array()},
{"de",
{{"headline", result ? "Ergebnis in {{competition}}"
{{"headline", result ? "{{competition}}: {{score}} gegen {{opponent}}"
: "{{team}} gewinnt {{competition}}"},
{"sentences",
result ? Json::array({"{{team}} und {{opponent}} treffen in "
"{{competition}} aufeinander.",
"Das Ergebnis lautet {{score}}."})
result ? Json::array({"{{team}} spielt {{score}} gegen "
"{{opponent}}."})
: Json::array(
{"{{team}} hat {{competition}} gewonnen.",
"Der Wettbewerb endet mit {{team}} als Sieger."})}}},
{"{{team}} hat {{competition}} gewonnen."})}}},
{"en",
{{"headline", result ? "Result in {{competition}}"
: "{{team}} win {{competition}}"},
+3 -1
View File
@@ -63,7 +63,7 @@ void App::engine_render() {
const auto &team = desk.at("team"), &person = desk.at("manager");
out = "<div class=\"desktop-layer\"><div class=\"info-bar\"><div class=\"identity\">" + engine_widget_crest(team, 82) +
"<span><strong>" + esc(engine_text(team.at("name"))) + "</strong><small>" + esc(engine_text(person.at("name"))) +
"</small></span></div><div class=\"info-date\">" + esc(meta.at("date").get<std::string>()) + "<small>" +
"</small></span></div><div class=\"info-date\">" + esc(ui_long_date(meta.at("date").get<std::string>())) + "<small>Saison " +
esc(meta.at("season").at("label").get<std::string>()) + "</small></div><div class=\"info-cash\"><small>Guthaben</small><strong id=\"engine-cash\" class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" +
esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div></div>";
bool lineup_available = false;
@@ -115,6 +115,8 @@ void App::engine_render() {
} else if (id == "account") {
const auto savings = bank_available ? engine_data_.at("bank").at("data").at("accounts").at("deposit") : desk.at("accounts").at("savings");
body = widget_heading("Vereinskasse", false) + "<div class=\"desk-account-main\"><span>Guthaben</span><strong class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" + esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div><div class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" + (savings.is_null() ? std::string("—") : esc(engine_price(savings))) + "</strong></div>" + btn("engine-ticket", glyph("ticket", 36) + "<span><span>Eintritt</span><strong>" + (ticket_available ? esc(engine_price(engine_data_.at("stadium").at("data").at("ticketPrice"))) : std::string("—")) + "</strong></span>", "desk-ticket", "id=\"account-ticket\" " + std::string(ticket_available && engine_fresh_ && !engine_busy_ ? "" : "disabled")) + "</div>";
} else if (id == "crest") {
body = widget_heading("Dein Verein", false) + "<div class=\"center\" style=\"padding:30dp;\">" + engine_widget_crest(team, 220) + "<p>" + esc(engine_text(team.at("name"))) + "</p></div>";
} else if (id == "opponent-crest" && desk.at("nextFixture").is_object()) {
const auto &next = desk.at("nextFixture");
const auto &other = next.at(next.at("home").at("id") == team.at("id") ? "away" : "home");
+3 -1
View File
@@ -58,6 +58,8 @@ Json engine_widgets_projection(const Json &bundle) {
return {{"own", summary(d.at("own"))},
{"opponent", opponent},
{"warnings", warnings},
{"fixture", fixture}};
{"fixture", fixture},
{"recent", d.value("recent", Json::array())},
{"rankCurve", d.value("rankCurve", Json::array())}};
}
} // namespace bmh::modern_ui
+31 -1
View File
@@ -12,9 +12,39 @@ std::string App::engine_widget(const std::string &id, const Json &o) {
return engine_news_value_.is_object() ? render_news_widget(o)
: std::string();
if (id != "warnings" && id != "competition" && id != "own-summary" &&
id != "opponent-summary")
id != "opponent-summary" && id != "results" && id != "own-curve")
return {};
const auto data = engine_widgets_projection(engine_data_);
if (id == "results") {
// the last recorded matches, newest on the right; nothing to show before the first one
const auto &rows = data.at("recent");
if (!rows.is_array() || rows.empty())
return widget_heading("Letzte Spiele", false) + "<div class=\"desk-fixture center\"><span>Noch kein Spiel gespielt.</span></div>";
const int w = o.at("w");
const bool wide = o.at("h") == 224;
int won = 0, drawn = 0, lost = 0;
std::string out = widget_heading(rows.size() == 1 ? "Letztes Spiel" : "Die letzten " + std::to_string(rows.size()) + " Spiele", false) + "<div class=\"desk-form\">";
for (const auto &row : rows) {
const auto form = row.value("form", std::string("U"));
++(form == "S" ? won : form == "N" ? lost : drawn);
out += "<div><span class=\"form-" + esc(form) + "\" style=\"width:" + scalar(wide ? 50 : w * .08) + "dp;height:" + scalar(wide ? 50 : w * .08) +
"dp;font-size:" + scalar(wide ? 28 : std::max(28., w * .04)) + "dp;\"><span>" + esc(form) + "</span></span><strong style=\"font-size:" +
scalar(wide ? 29 : std::max(28., w * .035)) + "dp;\">" + esc(row.value("score", std::string())) + "</strong></div>";
}
const auto count = [](int n, const char *one, const char *many) { return std::to_string(n) + " " + (n == 1 ? one : many); };
return out + "</div>" + (wide ? std::string() : "<p class=\"desk-card-note\">" + count(won, "Sieg", "Siege") + " · " + std::to_string(drawn) + " Unentschieden · " + count(lost, "Niederlage", "Niederlagen") + "</p>");
}
if (id == "own-curve") {
const auto &places = data.at("rankCurve");
if (!places.is_array() || places.size() < 2)
return widget_heading("Tabellenplatz", false) + "<div class=\"desk-fixture center\"><span>Die Kurve beginnt nach dem zweiten Spieltag.</span></div>";
// widget_curve draws from the widget values; lend it the engine's series
const Json kept = widget_data_;
widget_data_ = {{"own_curve", places}};
const auto curve = widget_curve(id, o, o.at("w"), o.at("h"));
widget_data_ = kept;
return widget_heading("Tabellenplatz", false) + curve;
}
if (id == "warnings")
return widget_warnings(data.at("warnings"), o);
if (id == "own-summary" || id == "opponent-summary") {
+27 -7
View File
@@ -199,10 +199,29 @@ std::string App::live_ticker_events(const Json &frame, size_t &shown) {
if (live_filter_ == "yellow" && kind != "yellow" && kind != "red" && kind != "second_yellow") continue;
if (live_filter_ == "highlights" && kind != "goal" && kind != "chance" && kind != "miss" && kind != "red" && kind != "second_yellow") continue;
const auto &match = live_match_by_id(fixture.at("matches"), event.at("match_id"));
out += "<article class=\"live-event " + std::string(kind == "goal" ? "is-goal" : "") + "\" data-live-event=\"" + esc(event.at("id").get<std::string>()) + "\">" + live_text(std::to_string(event.at("minute").get<int>()) + "′", "live-event-time") + live_badge(match.at(event.at("side").get<std::string>()), 54) +
out += "<article class=\"live-event " + std::string(kind == "goal" ? "is-goal" : "") + "\" data-live-event=\"" + esc(event.at("id").get<std::string>()) + "\">" + live_text(std::to_string(event.at("minute").get<int>()) + "′", "live-event-time") + (kind == "kickoff" || kind == "interval" || kind == "fulltime" ? "<div class=\"live-badge\" style=\"width:54dp;height:54dp;\"></div>" : live_badge(match.at(event.at("side").get<std::string>()), 54)) +
"<div class=\"live-event-copy\">" + (fixture.at("source") == "engine-recording" && fixture.at("matches").size() == 1 ? std::string() : live_text(match.at("home").at("name").get<std::string>() + " · " + match.at("away").at("name").get<std::string>(), "live-event-owners")) + "<h3>" + live_text(event.at("headline")) + "</h3><p>" + live_text(event.at("body")) + "</p></div>" + live_text(live_score_text(event.at("score")), "live-event-score") + "</article>";
++shown;
}
if (!shown && fixture.at("source") == "engine-recording" && live_filter_ == "all" && frame.at("events").empty()) {
// before the first report: who starts
for (const auto &match : fixture.at("matches")) {
if (live_coverage_ == "single" && match.at("id") != live_selected_match_) continue;
if (!match.contains("lineups") || !match.at("lineups").is_object()) continue;
std::string columns;
for (const auto *side : {"home", "away"}) {
const auto names = match.at("lineups").value(side, Json());
columns += "<div class=\"live-lineup-side\"><h3>" + live_text(match.at(side).at("name")) + "</h3>";
if (names.is_array() && !names.empty()) {
size_t number = 0;
for (const auto &name : names) columns += "<div class=\"live-lineup-row\">" + live_text(std::to_string(++number), "live-roster-number") + live_text(name.get<std::string>(), "live-roster-name") + "</div>";
} else columns += "<p>" + live_text("Aufstellung nicht bekannt.") + "</p>";
columns += "</div>";
}
out += "<div class=\"live-lineups\">" + columns + "</div>";
}
if (!out.empty()) return out;
}
if (!shown) out += "<p class=\"live-note\">" + live_text(fixture.at("source") == "engine-recording" ? "Noch keine Meldungen." : "Für diesen Filter liegt noch keine Demomeldung vor.") + "</p>";
return out;
}
@@ -219,34 +238,35 @@ std::string App::render_live() {
const auto phase_text = live_.finished() ? "Beendet" : phase == "interval" ? "Halbzeit" : live_.speed() ? (recorded ? (phase == "extra_time" ? "Verlängerung" : phase == "shootout" ? "Elfmeterschießen" : "Spiel läuft") : "Aufzeichnung läuft") : (recorded ? "Pausiert" : "Gemeinsam pausiert");
const auto arrow = [&](bool right) { const auto color = theme_ == "silver" ? "#376b84" : theme_ == "matchday" ? "#efb2aa" : "#b5dbd2"; return picture(renderer_.diagram(right ? "live-arrow-right" : "live-arrow-left", "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"" + std::string(right ? "M7 4l6 6-6 6" : "M13 4l-6 6 6 6") + "\" fill=\"none\" stroke=\"" + color + "\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>", 72), 36, 36); };
std::string out = "<section id=\"live-stage\" class=\"live-stage\" data-source=\"" + std::string(recorded ? "engine-recording" : "ui-demo-fixture") + "\" data-fixture-id=\"" + esc(fixture.at("fixture_id").get<std::string>()) + "\"><header class=\"live-header\"><div>" + (recorded ? std::string() : live_text("SPIELTAG · LIVE-TICKER", "live-eyebrow")) +
"<h1>" + live_text(live_review_ ? "Ergebnisse & Bericht" : fixture.at("role") == "national" ? "Deutschland · Demo-Länderspiel" : fixture.at("surface") == "indoor" ? "Hallenpartien · 40 Minuten" : recorded ? fixture.at("matches").front().value("competition", std::string("Spieltag")) : std::string("Gemeinsamer Spieltag")) + "</h1></div>" + live_text(recorded ? fixture.value("date", std::string()) : std::string("UI-Demo · vorgegebene Ergebnisse"), "live-demo-tag") + "</header>";
"<h1>" + live_text(live_review_ ? "Ergebnisse & Bericht" : fixture.at("role") == "national" ? "Deutschland · Demo-Länderspiel" : fixture.at("surface") == "indoor" ? "Hallenpartien · 40 Minuten" : recorded ? fixture.at("matches").front().value("competition", std::string("Spieltag")) : std::string("Gemeinsamer Spieltag")) + "</h1></div>" + live_text(recorded ? ui_long_date(fixture.value("date", std::string())) : std::string("UI-Demo · vorgegebene Ergebnisse"), "live-demo-tag") + "</header>";
const auto scoreline = [&](const Json &match) {
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>";
};
out += "<div id=\"live-underlay\" class=\"live-body\"><div class=\"live-left\"><section class=\"live-panel live-overview\"><nav class=\"live-coverage\">";
out += "<div id=\"live-underlay\" class=\"live-body\"><div class=\"live-left\"><section class=\"live-panel live-overview\"><nav class=\"live-coverage" + std::string(recorded && fixture.at("matches").size() == 1 ? " solo" : "") + "\">";
if (!(recorded && fixture.at("matches").size() == 1))
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 + "\"");
if (live_coverage_ == "single" && fixture.at("matches").size() > 1) out += btn("live-match-prev", arrow(false), "live-match-arrow", "id=\"live-match-prev\" aria-label=\"Vorherige Tickerpartie\"") + btn("live-match-next", arrow(true), "live-match-arrow", "id=\"live-match-next\" aria-label=\"Nächste Tickerpartie\"");
out += live_text(std::to_string(minute) + ":00", "live-clock") + "</nav><div class=\"live-cards " + std::string(fixture.at("matches").size() == 1 || live_coverage_ == "single" ? "single" : "") + "\">";
if (!(recorded && fixture.at("matches").size() == 1)) out += live_text(std::to_string(minute) + ":00", "live-clock");
out += "</nav><div class=\"live-cards " + std::string(fixture.at("matches").size() == 1 || live_coverage_ == "single" ? "single" : "") + "\">";
for (const auto &match : fixture.at("matches")) {
if (live_coverage_ == "single" && match.at("id") != live_selected_match_) continue;
std::string names;
for (const auto &id : match.at("owners")) for (const auto &person : fixture.at("owners")) if (person.at("id") == id) { if (!names.empty()) names += " · "; names += person.at("name").get<std::string>(); }
out += "<button data-action=\"live-match\" class=\"live-game " + std::string(match.at("id") == live_selected_match_ ? "active" : "") + "\" data-live-match=\"" + esc(match.at("id").get<std::string>()) + "\" data-id=\"" + esc(match.at("id").get<std::string>()) + "\">" + (recorded && fixture.at("owners").size() == 1 ? std::string() : live_text(names, "live-owners")) + scoreline(match) + live_text(std::to_string(minute) + "′ · " + (match.at("owners").size() > 1 ? std::string("Zwei menschliche Manager") : recorded ? match.value("competition", std::string("Eine menschliche Mannschaft")) : std::string("Eine menschliche Mannschaft")), "live-card-caption") + live_text(live_match_info_text(match, fixture.at("surface") == "indoor"), "live-match-info") + "</button>";
out += "<button data-action=\"live-match\" class=\"live-game " + std::string(match.at("id") == live_selected_match_ ? "active" : "") + "\" data-live-match=\"" + esc(match.at("id").get<std::string>()) + "\" data-id=\"" + esc(match.at("id").get<std::string>()) + "\">" + (recorded && fixture.at("owners").size() == 1 ? std::string() : live_text(names, "live-owners")) + scoreline(match) + live_text(recorded && fixture.at("matches").size() == 1 ? std::string(phase_text) + (live_.finished() || minute < 1 ? "" : " · " + std::to_string(minute) + ". Minute") : std::to_string(minute) + "′ · " + (match.at("owners").size() > 1 ? std::string("Zwei menschliche Manager") : recorded ? match.value("competition", std::string("Eine menschliche Mannschaft")) : std::string("Eine menschliche Mannschaft")), "live-card-caption") + live_text(live_match_info_text(match, fixture.at("surface") == "indoor"), "live-match-info") + "</button>";
}
out += "</div></section><section class=\"live-panel live-ticker\"><header class=\"live-panel-heading\"><h2>" + live_text(recorded ? "Ticker" : "Gemeinsamer Live-Ticker") + "</h2>" + (recorded && fixture.at("owners").size() == 1 ? std::string() : live_text(live_coverage_ == "single" ? "Gewählte Partie" : "Alle Manager", "live-small")) + "</header><nav class=\"live-filters\">";
for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 4>{{{"all", "Alles"}, {"highlights", "Highlights"}, {"goal", "Tore"}, {"yellow", "Karten"}}}) out += btn("live-filter", label, live_filter_ == id ? "selected" : "", "id=\"live-filter-" + std::string(id) + "\" data-id=\"" + id + "\"");
out += "</nav><div id=\"live-ticker\" class=\"live-event-list\" tabindex=\"0\" aria-label=\"Gemeinsamer Ereignisverlauf\">";
size_t shown = 0;
out += live_ticker_events(frame, shown);
out += "</div><footer class=\"live-ticker-footer\">" "<span id=\"live-event-count\" class=\"live-small\">" + esc(std::to_string(shown) + (live_.fixture().at("source") == "engine-recording" ? (shown == 1 ? " Meldung" : " Meldungen") : " Meldungen · feste Aufzeichnung")) + "</span>" + "<span id=\"live-phase-status\" class=\"live-small\">" + esc(phase_text) + "</span></footer></section></div><aside id=\"live-detail\" class=\"live-detail live-panel\"><header class=\"live-panel-heading\"><div class=\"live-detail-heading\"><h2>" + "<span id=\"live-owner-team\">" + esc(owner.at("team").at("name").get<std::string>()) + "</span></h2><p><span id=\"live-owner-name\">" + esc(owner.at("name").get<std::string>()) + "</span>" + "</p></div><nav class=\"live-team-switch\" aria-label=\"Managerdetails wechseln\">" +
out += "</div><footer class=\"live-ticker-footer\">" "<span id=\"live-event-count\" class=\"live-small\">" + esc(recorded && !shown ? std::string() : std::to_string(shown) + (live_.fixture().at("source") == "engine-recording" ? (shown == 1 ? " Meldung" : " Meldungen") : " Meldungen · feste Aufzeichnung")) + "</span>" + "<span id=\"live-phase-status\" class=\"live-small\">" + esc(recorded ? std::string() : std::string(phase_text)) + "</span></footer></section></div><aside id=\"live-detail\" class=\"live-detail live-panel\"><header class=\"live-panel-heading\"><div class=\"live-detail-heading\"><h2>" + "<span id=\"live-owner-team\">" + esc(owner.at("team").at("name").get<std::string>()) + "</span></h2><p><span id=\"live-owner-name\">" + esc(owner.at("name").get<std::string>()) + "</span>" + "</p></div><nav class=\"live-team-switch\" aria-label=\"Managerdetails wechseln\">" +
btn("live-owner-prev", arrow(false), "", "id=\"live-owner-prev\" aria-label=\"Vorheriger Manager\" " + std::string(fixture.at("owners").size() == 1 ? "disabled" : "")) + btn("live-owner-next", arrow(true), "", "id=\"live-owner-next\" aria-label=\"Nächster Manager\" " + std::string(fixture.at("owners").size() == 1 ? "disabled" : "")) + "</nav></header><nav class=\"live-tabs\">";
for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 5>{{{"team", "Team"}, {"tactics", "Taktik"}, {"opponent", recorded ? "Ergebnisse" : "Gegner"}, {"table", "Live-Tabelle"}, {"stats", "Statistik"}}}) out += btn("live-tab", label, live_tab_ == id ? "selected" : "", "id=\"live-tab-" + std::string(id) + "\" data-id=\"" + id + "\" aria-pressed=\"" + (live_tab_ == id ? "true" : "false") + "\"");
out += "</nav><div id=\"live-detail-body\" class=\"live-detail-body\" tabindex=\"0\">" + live_detail(owner, frame) + "</div><footer class=\"live-detail-footer\">" + btn("live-intervene-lineup", "Aufstellung & Wechsel", "", "id=\"live-lineup-edit\" " + std::string(live_.finished() || (recorded && !live_.running()) ? "disabled" : "")) + "</footer></aside></div>";
out += "<div class=\"live-speed\">" + live_text("+") + "<input id=\"live-speed\" type=\"range\" orientation=\"vertical\" min=\"0\" max=\"4\" step=\"1\" value=\"" + std::to_string(4 - live_.speed()) + "\" aria-label=\"Wiedergabegeschwindigkeit; unten Pause\" aria-valuenow=\"" + std::to_string(live_.speed()) + "\" " + (live_.finished() ? "disabled" : "") + "/><span id=\"live-speed-value\" class=\"live-speed-value\">" + esc(live_.finished() ? "Ende" : live_.speed() ? std::to_string(live_.speed()) + "×" : "Pause") + "</span></div>";
out += "<footer class=\"live-bottom\"><div class=\"live-bottom-actions\">" + btn("live-back", live_.running() ? "Zu Ende spielen" : recorded ? "Zum Schreibtisch" : "Zum Desktop", "", "id=\"live-back\"") + btn("live-pause", live_.speed() ? "Pause" : "Abspielen", "", "id=\"live-pause\" " + std::string(live_.finished() ? "disabled" : "")) + "</div><span id=\"live-playback-status\" class=\"live-bottom-note\">" + esc(live_feedback_.empty() ? std::string(phase_text) + " · " + std::to_string(minute) + (recorded ? "′" : "′ · keine Spielwertänderung") : live_feedback_) + "</span>" +
out += "<footer class=\"live-bottom\"><div class=\"live-bottom-actions\">" + btn("live-back", live_.running() ? "Zu Ende spielen" : recorded ? "Zum Schreibtisch" : "Zum Desktop", "", "id=\"live-back\"") + btn("live-pause", live_.speed() ? "Pause" : "Abspielen", "", "id=\"live-pause\" " + std::string(live_.finished() ? "disabled" : "")) + "</div><span id=\"live-playback-status\" class=\"live-bottom-note\">" + esc(live_feedback_.empty() ? (recorded ? std::string() : std::string(phase_text) + " · " + std::to_string(minute) + "′ · keine Spielwertänderung") : live_feedback_) + "</span>" +
btn(live_.finished() ? "live-review" : "live-next", live_.finished() ? "Zur Auswertung" : live_.running() ? "Nächste Minute" : "Nächste Meldung", "", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "</footer>";
return out + live_dialog_markup(owner) + "</section>";
}
+1 -1
View File
@@ -680,7 +680,7 @@ NewsCatalog::NewsCatalog(Json data) : catalogue_(std::move(data)) {
for (const auto *lang : {"de", "en"}) {
const auto &v = t.at(lang);
(void)text(v.at("headline"), 240);
if (!v.at("sentences").is_array() || v.at("sentences").size() < 2 ||
if (!v.at("sentences").is_array() || v.at("sentences").empty() ||
v.at("sentences").size() > 4)
throw editor::Error("invalid_news_catalogue");
for (const auto &s : v.at("sentences"))
+3 -4
View File
@@ -131,8 +131,7 @@ std::string App::render_news() {
std::string content =
"<div id=\"news-underlay\" class=\"news-layout\"><div "
"class=\"news-masthead\"><div class=\"news-brand\"><span "
"class=\"news-wordmark\">kicker</span><div><p>DEIN "
"SPIELJOURNAL</p><h2>Nachrichten</h2></div></div><div "
"class=\"news-wordmark\">kicker</span><div><p>" + std::string(engine_mode_ ? "" : "DEIN SPIELJOURNAL") + "</p><h2>Nachrichten</h2></div></div><div "
"class=\"news-owner\"><div><strong>" +
esc(data.at("club_name").get<std::string>()) + "</strong><p>" +
esc(data.at("date").get<std::string>()) + "</p></div>" +
@@ -187,7 +186,7 @@ std::string App::render_news() {
(data.at("unbound_count").get<size_t>() == 1
? " Altbestand ohne Besitzerbeleg unverändert erhalten"
: " Altbestände ohne Besitzerbeleg unverändert erhalten"));
if(engine_mode_&&!data.at("unsupported").empty())content+=esc(" · "+std::to_string(data.at("unsupported").size())+" weitere Berichte sind noch nicht aufbereitet");
content += "</p>" +
btn("news-undo", glyph("undo", 32) + "<span>Rückgängig</span>",
"news-undo",
@@ -213,7 +212,7 @@ std::string App::render_news() {
btn("close", "<span>×</span>", "close",
"id=\"window-close\" aria-label=\"Fenster schließen\"") +
"<h1>Nachrichten</h1></div><div class=\"content\">" + content +
"</div><div class=\"news-screen-footer\"><span>" + std::string(engine_mode_?"Dein Spieljournal":"Fiktive Meldungen · Modern UI Demo") + "</span><span>Dreierpack Manager</span></div><div "
"</div><div class=\"news-screen-footer\"><span>" + std::string(engine_mode_?"":"Fiktive Meldungen · Modern UI Demo") + "</span><span>Dreierpack Manager</span></div><div "
"class=\"news-homebar\"></div></div>";
}
+2 -2
View File
@@ -204,7 +204,7 @@ std::string App::render_transfer() {
"<section class=\"transfer-overview " +
std::string(complete ? "transfer-complete" : "") +
"\"><header class=\"transfer-heading\"><h2>Kader und "
"Transfermarkt</h2>" + (engine_mode_?"<p id=\"transfer-engine-feedback\" style=\"position:absolute;left:0;right:650dp;bottom:0;font-size:23dp;line-height:27dp;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;\">"+esc(engine_busy_?engine_operation_:engine_notice_)+"</p>":"") + "<div><span>Verfügbares Kapital</span><strong class=\"" + money_classes(engine_mode_?engine_transfer_value_.at("cash").get<int64_t>():snapshot.state.at("cash").get<int64_t>()) + "\">" +
"Transfermarkt</h2>" + (engine_mode_?"<p id=\"transfer-engine-feedback\" style=\"position:absolute;left:0;right:650dp;bottom:0;font-size:28dp;line-height:27dp;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;\">"+esc(engine_busy_?engine_operation_:engine_notice_)+"</p>":"") + "<div><span>Verfügbares Kapital</span><strong class=\"" + money_classes(engine_mode_?engine_transfer_value_.at("cash").get<int64_t>():snapshot.state.at("cash").get<int64_t>()) + "\">" +
esc(transfer_money((engine_mode_ ? engine_transfer_value_.at("cash").get<int64_t>() : snapshot.state.at("cash").get<int64_t>()))) +
"</strong></div></header><div class=\"transfer-columns\"><section "
"class=\"transfer-roster\"><header><h2>Dein Kader</h2><span>" +
@@ -342,7 +342,7 @@ std::string App::render_transfer() {
? "true"
: "false") +
"\" style=\"" +
rect(0, (i - size_t(page) * 6) * 128.7864583, 1087.03125,
rect(0, (i - size_t(page) * 6) * 128.7864583, 1062,
120.7864583) +
"\"");
}
+1
View File
@@ -11,6 +11,7 @@
#include "modern/ui/news_catalog.hpp"
#include "modern/ui/career_files.hpp"
#include "modern/ui/live_match_info.hpp"
#include "modern/ui/date_text.hpp"
#include "modern/ui/script_locator.hpp"
#include "modern/ui/select_menu.hpp"
#include "modern/ui/demo_calendar.hpp"