Skip to content

Commit

Permalink
Initial change for bad status hover
Browse files Browse the repository at this point in the history
  • Loading branch information
oliiso committed Jun 26, 2024
1 parent d2a0118 commit 356a3fc
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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 << "<td " << c.hoverText << "style=\"border:1px solid #aaaaaa; background-color:#" << c.color << "; " << outline << " \" align=\"" << c.align << "\">";
if (c.extension || c.bad_status) {
ostr << "<td " << c.hoverText << "style=\"border:1px solid #aaaaaa; background-color:#" << c.color << "; " << outline << "\" align=\"" << c.align << "\">";
} else {
ostr << "<td style=\"border:1px solid #aaaaaa; background-color:#" << c.color << "; " << outline << " \" align=\"" << c.align << "\">";

ostr << "<td style=\"border:1px solid #aaaaaa; background-color:#" << c.color << "; " << outline << "\" align=\"" << c.align << "\">";
}

if (0) { //rotate == 90) {
Expand Down

0 comments on commit 356a3fc

Please sign in to comment.