From 356a3fcdc3fe7dc522b235d72e68b6de37cae58c Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Wed, 26 Jun 2024 09:55:22 -0700 Subject: [PATCH 1/9] 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) { From ba4665b3579cb987437820db5d60c13446ce71e9 Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Mon, 1 Jul 2024 15:47:05 -0700 Subject: [PATCH 2/9] edit words in hover box --- table.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/table.cpp b/table.cpp index f31e777..be7c173 100644 --- a/table.cpp +++ b/table.cpp @@ -101,8 +101,9 @@ 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\" "; - } + 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 @@ -127,11 +128,11 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st } else { inquiry = bad_status = override = extension = version_conflict = cancelled = false; } - } + std::ostream& operator<<(std::ostream &ostr, const TableCell &c) { assert (c.color.size() == 6); From 23c8202a5b0f30bc60b82940442ee9fb99dea7fd Mon Sep 17 00:00:00 2001 From: Sophia Oliinik <105466628+oliiso@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:40:06 -0700 Subject: [PATCH 3/9] Update extension logic Co-authored-by: Jaeseok Kang <123261952+ziesski@users.noreply.github.com> --- table.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table.cpp b/table.cpp index be7c173..41fae5c 100644 --- a/table.cpp +++ b/table.cpp @@ -94,7 +94,7 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st academic_integrity = ai; event = e; - if (event == "Extension") { + 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 + "\" "; From 07ac6dea469083e1954b9544df5eb49deea68582 Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Fri, 5 Jul 2024 10:38:49 -0700 Subject: [PATCH 4/9] remove duplicate code --- table.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/table.cpp b/table.cpp index 41fae5c..7419d66 100644 --- a/table.cpp +++ b/table.cpp @@ -95,12 +95,8 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st event = e; 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 == "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 + "\" "; } @@ -132,7 +128,6 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st - std::ostream& operator<<(std::ostream &ostr, const TableCell &c) { assert (c.color.size() == 6); From c3528db46f9dd88b7d50f0bb5bc538d7efddc5b3 Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Tue, 9 Jul 2024 09:48:04 -0700 Subject: [PATCH 5/9] 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; } From 52d06c16d6da9ccab94cbc4505a6d901bdfbb9fb Mon Sep 17 00:00:00 2001 From: Sophia Oliinik <105466628+oliiso@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:42:20 -0700 Subject: [PATCH 6/9] Update logic for extension Co-authored-by: Jaeseok Kang <123261952+ziesski@users.noreply.github.com> --- table.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/table.cpp b/table.cpp index bdf6f6b..c810d1e 100644 --- a/table.cpp +++ b/table.cpp @@ -99,10 +99,12 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st if (event == "Overridden"){ override = true; bad_status = inquiry = extension = version_conflict = cancelled = false; - } else if (event == "Extension" && reason != ""){ + } else if (event == "Extension"){ extension = true; inquiry = bad_status = override = version_conflict = cancelled = false; + if (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 == "Open"){ inquiry = true; bad_status = override = extension = version_conflict = cancelled = false; From a7eefe9949131c95c69593444fb463806ced3a3f Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Mon, 15 Jul 2024 18:23:21 -0700 Subject: [PATCH 7/9] Fix indentation --- table.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/table.cpp b/table.cpp index c810d1e..8f4f431 100644 --- a/table.cpp +++ b/table.cpp @@ -102,9 +102,9 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st } else if (event == "Extension"){ extension = true; inquiry = bad_status = override = version_conflict = cancelled = false; - if (reason != ""){ - hoverText = "class=\"hoverable-cell\" data-hover-text=\"" + userName + " received a " + std::to_string(daysExtended) + " day extension due to " + reason + " on " + gID + "\" "; - } + if (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 == "Open"){ inquiry = true; bad_status = override = extension = version_conflict = cancelled = false; From 77f1112c058f1ed921c2eadaf258bd66ae708776 Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Mon, 15 Jul 2024 18:30:14 -0700 Subject: [PATCH 8/9] Re-adding unspecified reason for extension --- table.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/table.cpp b/table.cpp index 8f4f431..20310b5 100644 --- a/table.cpp +++ b/table.cpp @@ -104,6 +104,8 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st inquiry = bad_status = override = version_conflict = cancelled = false; 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+"\" "; } } else if (event == "Open"){ inquiry = true; From f9402f2b1b2950980ccf7fa3093f3155c4256321 Mon Sep 17 00:00:00 2001 From: Sophia Oliinik Date: Wed, 17 Jul 2024 15:49:38 -0700 Subject: [PATCH 9/9] Update indentation --- table.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/table.cpp b/table.cpp index 20310b5..e8f065d 100644 --- a/table.cpp +++ b/table.cpp @@ -102,11 +102,11 @@ TableCell::TableCell(float d, const std::string& c, int precision, const std::st } else if (event == "Extension"){ extension = true; inquiry = bad_status = override = version_conflict = cancelled = false; - if (reason != ""){ + if (reason != ""){ hoverText = "class=\"hoverable-cell\" data-hover-text=\"" + userName + " received a " + std::to_string(daysExtended) + " day extension due to " + reason + " on " + gID + "\" "; - } else { + } else { hoverText = "class=\"hoverable-cell\" data-hover-text=\""+userName+" received a "+std::to_string(daysExtended)+" day extension without specified reason on "+gID+"\" "; - } + } } else if (event == "Open"){ inquiry = true; bad_status = override = extension = version_conflict = cancelled = false;