Form marks and the own club's row in tables, squad grounds in the line-up, an own news masthead
- League tables show the last matches as marks (won, drawn, lost, not played) and set the manager's club apart with a bar in its crest colour. - The line-up tints starters, bench and the rest of the squad. - The news window carries a masthead of its own in the display serif. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b5d448fb6
commit
3a3513fb60
7 files changed
+45
-6
No files matched your search
@@ -202,7 +202,9 @@ std::string App::render_lineup() {
|
||||
for (const auto &row : rows) {
|
||||
const auto slot = row.at("slot").get<int>();
|
||||
const auto id = row.at("id").get<std::string>();
|
||||
// starters, the bench and the rest of the squad each have their own ground
|
||||
out += "<div class=\"lineup-row " + std::string(slot % 2 ? "even " : "") +
|
||||
(slot < lineup_start_limit ? "starter " : slot < lineup_start_limit + lineup_bench_limit ? "bench " : "stand ") +
|
||||
(slot == field_count ? "reserve-start " : "") +
|
||||
(lineup_selected_ == id ? "selected" : "") + "\" role=\"row\">";
|
||||
out += "<span class=\"lineup-cell lineup-col-0\"><span>" +
|
||||
|
||||
@@ -131,7 +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>" + std::string(engine_mode_ ? "" : "DEIN SPIELJOURNAL") + "</p><h2>Nachrichten</h2></div></div><div "
|
||||
"class=\"news-wordmark\">Dreierpack</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>" +
|
||||
|
||||
@@ -119,9 +119,17 @@ std::string App::render_reports(const std::string &mode) {
|
||||
body += "</div>";
|
||||
for (size_t i = 0; i < rows.size(); ++i) {
|
||||
const auto &row = rows[i];
|
||||
body += "<div class=\"report-row " + std::string(i % 2 == 0 ? "striped" : "") +
|
||||
// the manager's own club stands out: a bar in its colour down the left edge
|
||||
const std::string row_club = row.value("club", "");
|
||||
const bool own_row = !matches && !row_club.empty() &&
|
||||
(engine_mode_ ? engine_data_.at("desktop").at("meta").at("scope").at("teamId") == row_club
|
||||
: snap().state.at("career").value("role", "club") == "club" && manager(snap()).value("club", "") == row_club);
|
||||
std::string own_colour;
|
||||
if (own_row)
|
||||
if (const auto *club = world_->find("clubs", row_club); club && !club->value("crest", "").empty()) own_colour = renderer_.crest_colour(club->value("crest", ""));
|
||||
body += "<div class=\"report-row " + std::string(i % 2 == 0 ? "striped" : "") + (own_row ? " own" : "") +
|
||||
"\" role=\"row\" data-club=\"" + esc(row.value("club", "")) +
|
||||
"\" style=\"height:" + scalar(row_height) + "dp;\">";
|
||||
"\" style=\"height:" + scalar(row_height) + "dp;" + (own_colour.empty() ? "" : "border-left-color:" + own_colour + ";") + "\">";
|
||||
for (size_t column = 0; column < headings.size(); ++column) {
|
||||
body += "<div class=\"report-cell " + std::string(column == 0 ? "first" : "") +
|
||||
(matches && column == 1 ? " score" : "") +
|
||||
@@ -156,6 +164,12 @@ std::string App::render_reports(const std::string &mode) {
|
||||
value="Rück: "+value;
|
||||
} else if(row.at("status")=="scheduled"&&row.at("date").is_string())detail=row.at("date").get<std::string>();
|
||||
body+="<div class=\"report-score-lines\"><span class=\"report-value\">"+esc(value)+"</span>"+(detail.empty()?"":"<span class=\"report-score-note\">"+esc(detail)+"</span>")+"</div>";
|
||||
} else if (!matches && !strengths && column == 5) {
|
||||
// the last matches as marks: won, drawn, lost, not played
|
||||
body += "<span class=\"report-form\" title=\"" + esc(value) + "\">";
|
||||
for (const char c : value)
|
||||
body += std::string("<span class=\"form-mark ") + (c == 'S' ? "won" : c == 'U' ? "drawn" : c == 'N' ? "lost" : "none") + "\"></span>";
|
||||
body += "</span>";
|
||||
} else body += "<span class=\"report-value\">" + esc(value) + "</span>";
|
||||
}
|
||||
body += "</div>";
|
||||
|
||||
Reference in new issue
Block a user