// SPDX-License-Identifier: GPL-3.0-only std::string App::render_indoor() { const auto snapshot = snap(); const auto &state = snapshot.state.at("reports"); const auto &sort = state.at("sorts").at("indoor"); const auto rows = report_indoor_rows(*world_, state); std::string body = "
" "
" "
" "
"; for (const auto &[key, label] : std::array, 2>{ {{"rank", "Pl. / Verein"}, {"points", "Punkte"}}}) { const bool current = sort.at("key") == key; const bool descending = sort.at("desc").get(); std::string indicator = ""; if (!current || !descending) indicator += ""; if (!current || descending) indicator += ""; indicator += ""; body += "
" + btn("report-sort", "" + esc(label) + "" + indicator, "report-sort", "id=\"report-sort-" + key + "\" data-id=\"" + key + "\" aria-label=\"Nach " + esc(label) + " sortieren\"") + "
"; } body += "
"; for (size_t i = 0; i < rows.size(); ++i) { const auto &row = rows[i]; body += "
()) + "\">
" "" + std::to_string(row.at("rank").get()) + "." + report_club_button(row.at("club").get()) + "
" "" + std::to_string(row.at("points").get()) + "
"; } body += "
"; return body + render_report_detail(); } bool App::indoor_action(const std::string &action, Rml::Element *target) { if (action != "indoor-info") return false; if (menu_ != "indoor" || !world_ || !target) return true; report_detail_return_focus_ = target->GetId(); report_detail_kind_ = "indoor-info"; report_detail_club_.clear(); report_detail_player_.clear(); focus_after_render_ = "report-detail-close"; refresh(); return true; }