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
@@ -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