Bind friendly planning quotes bookings and explicit hotseat consent (by Codex)

This commit is contained in:
Codex committed 2026-10-28 16:28:46 +01:00
1 parent cbde7b367e
commit 15d2ac0a4d
20 files changed
+422 -22

No files matched your search

+3 -2
View File
@@ -66,7 +66,8 @@ std::string App::calendar_grid(const Json &calendar, double top, double height,
const bool friendly = engine_friendly || (own_league && std::any_of(calendar.at("friendlies").begin(), calendar.at("friendlies").end(), [&](const auto &f) { return f.at("day") == index; }));
const bool occupied = engine_mode_ ? !events.at("ids").empty() || friendly : match != fixtures.end() || friendly, chosen = selected == index;
const bool source = engine_mode_ ? postpone && calendar.value("source_day", -1) == index : postpone && match != fixtures.end() && match->from == calendar.value("source_day", -1);
const bool target = engine_mode_ && postpone && std::find(calendar.at("targets").begin(),calendar.at("targets").end(),Json(index)) != calendar.at("targets").end();
const bool friendly_target = engine_mode_ && booking && std::find(calendar.at("friendly_targets").begin(),calendar.at("friendly_targets").end(),Json(index)) != calendar.at("friendly_targets").end();
const bool target = friendly_target || (engine_mode_ && postpone && std::find(calendar.at("targets").begin(),calendar.at("targets").end(),Json(index)) != calendar.at("targets").end());
const bool moved = engine_mode_ && std::find(calendar.at("moved_days").begin(),calendar.at("moved_days").end(),Json(index)) != calendar.at("moved_days").end();
const bool general = engine_mode_ && !events.at("kinds").empty() && !occupied;
body += btn("calendar-select",
@@ -75,7 +76,7 @@ std::string App::calendar_grid(const Json &calendar, double top, double height,
"<span class=\"control-label\">" + std::to_string(day_number) + "</span>",
std::string("calendar-day ") + (occupied ? "has-match " : "") + (friendly ? "friendly-date " : "") + (source ? "source-day " : "") + (target ? "valid-target " : "") + (moved ? "rescheduled-date " : "") + (general ? "competition-date " : "") + (chosen ? "selected-day" : ""),
"id=\"calendar-day-" + std::to_string(index) + "\" data-id=\"" + std::to_string(index) + "\" aria-pressed=\"" + (chosen ? "true" : "false") + "\" aria-label=\"" + calendar_date_label(days[size_t(index)].iso) +
(engine_mode_ ? (occupied ? ", eingetragenes Spiel" : general ? ", Wettbewerbstermin" : ", kein eingetragener Termin") : (occupied ? ", belegt" : ", frei")) + "\" style=\"" + rect(77 + col * cell_width, grid_top + row * cell_height, cell_width, cell_height) + "\" " + (booking && (index < 7 || occupied) ? "disabled" : ""));
(engine_mode_ ? (occupied ? ", eingetragenes Spiel" : general ? ", Wettbewerbstermin" : ", kein eingetragener Termin") : (occupied ? ", belegt" : ", frei")) + "\" style=\"" + rect(77 + col * cell_width, grid_top + row * cell_height, cell_width, cell_height) + "\" " + (booking && (engine_mode_ ? !friendly_target : index < 7 || occupied) ? "disabled" : ""));
}
}
body += "</section>";