From 356a3fcdc3fe7dc522b235d72e68b6de37cae58c Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Wed, 26 Jun 2024 09:55:22 -0700 Subject: [PATCH] Initial change for bad status hover --- table.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/table.cpp b/table.cpp index e0e2d03..f31e777 100644 --- a/table.cpp +++ b/table.cpp @@ -72,7 +72,6 @@ TableCell::TableCell(const std::string& c, float d, int precision, const std::st rotate = 0; } - TableCell::TableCell(float d, const std::string& c, int precision, const std::string& n, int ldu, CELL_CONTENTS_STATUS v,const std::string& e,bool ai, const std::string& a, int s, int /*r*/,const std::string& reason,const std::string& gID,const std::string& userName, int daysExtended) { @@ -95,10 +94,14 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st academic_integrity = ai; event = e; - if (reason != "") { - hoverText = "class=\"hoverable-cell\" data-hover-text=\""+userName+" received a "+std::to_string(daysExtended)+" day extension due to "+reason+" on "+gID+"\" "; - } else { - hoverText = "class=\"hoverable-cell\" data-hover-text=\""+userName+" received a "+std::to_string(daysExtended)+" day extension without specified reason on "+gID+"\" "; + if (event == "Extension") { + 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 == "Bad") { + bad_status = true; + override = inquiry = extension = version_conflict = cancelled = false; + hoverText = "class=\"hoverable-cell\" data-hover-text=\"" + userName + " received a bad status\" "; } // Bool in order of priority - top to bottom @@ -151,11 +154,10 @@ std::ostream& operator<<(std::ostream &ostr, const TableCell &c) { outline = "outline:4px solid #fc0303; outline-offset: -4px;"; } - if (c.extension){ - ostr << ""; + if (c.extension || c.bad_status) { + ostr << ""; } else { - ostr << ""; - + ostr << ""; } if (0) { //rotate == 90) {