From 3a024707959a00a6b439a3cdfb1e7df9f4d7950a Mon Sep 17 00:00:00 2001 From: arnost00 Date: Tue, 2 Aug 2022 23:50:23 +0200 Subject: [PATCH] Fix issue #738 - hide start number in html startlist when no start number in class / club --- .../plugins/Runs/src/runsplugin.cpp | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp b/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp index 7eea7fde8..3c061f69f 100644 --- a/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp +++ b/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp @@ -1709,13 +1709,18 @@ void RunsPlugin::export_startListClassesHtml() append_list(table, ltr); } qf::core::utils::TreeTable tt2 = tt1.row(i).table(); - QVariantList trr{"tr", - QVariantList{"th", tr("St. Num")}, - QVariantList{"th", tr("Name")}, - QVariantList{"th", tr("Registration")}, - QVariantList{"th", tr("SI")}, - QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")} - }; + bool show_start_number = false; + for(int j=0; j 0) + show_start_number = true; + } + QVariantList trr{"tr"}; + if (show_start_number) + append_list(trr, QVariantList{"th", tr("St. Num")}); + append_list(trr, QVariantList{"th", tr("Name")}); + append_list(trr,QVariantList{"th", tr("Registration")}); + append_list(trr,QVariantList{"th", tr("SI")}); + append_list(trr,QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")}); append_list(table, trr); for(int j=0; j 0) append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("startNumber"))}); - else + else if (show_start_number) append_list(trr, QVariantList{"td", ""}); append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("competitorName"))}); append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("registration"))}); @@ -1803,14 +1808,19 @@ void RunsPlugin::export_startListClubsHtml() append_list(table, ltr); } qf::core::utils::TreeTable tt2 = tt1_row.table(); - QVariantList trr{"tr", - QVariantList{"th", tr("St. Num")}, - QVariantList{"th", tr("Class")}, - QVariantList{"th", tr("Name")}, - QVariantList{"th", tr("Registration")}, - QVariantList{"th", tr("SI")}, - QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")} - }; + bool show_start_number = false; + for(int j=0; j 0) + show_start_number = true; + } + QVariantList trr{"tr"}; + if (show_start_number) + append_list(trr, QVariantList{"th", tr("St. Num")}); + append_list(trr, QVariantList{"th", tr("Class")}); + append_list(trr, QVariantList{"th", tr("Name")}); + append_list(trr,QVariantList{"th", tr("Registration")}); + append_list(trr,QVariantList{"th", tr("SI")}); + append_list(trr,QVariantList{"th", QVariantMap{{"colspan", "3"}}, tr("Start")}); append_list(table, trr); for(int j=0; j 0) append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("startNumber"))}); - else + else if (show_start_number) append_list(trr, QVariantList{"td", ""}); append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("classes.name"))}); append_list(trr, QVariantList{"td", tt2_row.value(QStringLiteral("competitorName"))});