From c3528db46f9dd88b7d50f0bb5bc538d7efddc5b3 Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Tue, 9 Jul 2024 09:48:04 -0700 Subject: [PATCH] Move hover text --- table.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/table.cpp b/table.cpp index 7419d66..bdf6f6b 100644 --- a/table.cpp +++ b/table.cpp @@ -94,21 +94,15 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st academic_integrity = ai; event = e; - if (event == "Extension" && reason != "") { - hoverText = "class=\"hoverable-cell\" data-hover-text=\"" + userName + " received a " + std::to_string(daysExtended) + " day extension due to " + reason + " on " + gID + "\" "; - } else if (event == "Bad") { - hoverText = "class=\"hoverable-cell\" data-hover-text=\"" + userName + " received a bad status on " + gID + "\" "; - } - - // Bool in order of priority - top to bottom // Don't think we need this logic, but leaving it as sort of assert if (event == "Overridden"){ override = true; bad_status = inquiry = extension = version_conflict = cancelled = false; - } else if (event == "Extension"){ + } else if (event == "Extension" && reason != ""){ extension = true; inquiry = bad_status = override = version_conflict = cancelled = false; + hoverText = "class=\"hoverable-cell\" data-hover-text=\"" + userName + " received a " + std::to_string(daysExtended) + " day extension due to " + reason + " on " + gID + "\" "; } else if (event == "Open"){ inquiry = true; bad_status = override = extension = version_conflict = cancelled = false; @@ -121,6 +115,7 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st } else if (event == "Bad"){ bad_status = true; override = inquiry = extension = version_conflict = cancelled = false; + hoverText = "class=\"hoverable-cell\" data-hover-text=\"" + userName + " received a bad status on " + gID + "\" "; } else { inquiry = bad_status = override = extension = version_conflict = cancelled = false; }