diff --git a/punch_list/css/custom.css b/punch_list/css/custom.css index 5c9d76c..e376ea5 100644 --- a/punch_list/css/custom.css +++ b/punch_list/css/custom.css @@ -11,6 +11,18 @@ textarea { display: none;} #editEvent { display: none; } +.punchlist { + position: relative; + width: 100%; + display: table; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; } +.punchlist::after { + content: ""; + clear: both; } +.top-bottom-border { + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; } .navbar { overflow: hidden; background-color: #333; @@ -33,6 +45,7 @@ textarea { .dropdown .dropbtn { cursor: pointer; + vertical-align: middle; font-size: 16px; border: none; outline: none; @@ -113,18 +126,15 @@ table.punches { padding: 5px; margin-bottom: 0px; } .centerMiddle { - height: 100%; - width: 100%; padding:0px; text-align: center; - vertical-align: center; - margin-top: 50%; } + vertical-align: middle; } .button { display: block; padding: 0px; text-align: center; text-decoration: none; - font-size: 2rem; + font-size: 1.5rem; vertical-align: middle; border: 1px solid #333; background-color: #4CAF50; @@ -133,7 +143,7 @@ table.punches { margin-left: auto; margin-right: auto; width: 98%; - height: 70px;} + height: 50px;} .nav-button { vertical-align: middle; float: right } @@ -159,13 +169,19 @@ table.punches { @media (min-width: 550px) { .button { padding: 0px; + text-align: center; + text-decoration: none; + font-size: 1rem; vertical-align: middle; - border: 1px solid #333; - background-color: #4CAF50; - margin-top: 10px; - margin-bottom: 0px; - width: 150px; - height: 45px; } + border: 1px solid #333; + background-color: #4CAF50; + margin-top: auto; + margin-bottom: auto; + margin-left: auto; + margin-right: auto; + width: 20%; + height: 40px; + float: right;} .nav-button { vertical-align: middle; float: right } diff --git a/punch_list/eventManage.js b/punch_list/eventManage.js index 8060e73..6860e34 100644 --- a/punch_list/eventManage.js +++ b/punch_list/eventManage.js @@ -39,7 +39,8 @@ function getJson(callback) { } function genList(punchList) { - console.log(`inside gen list `); + document.getElementById("showDone").innerHTML = "Show Done: " + showDone + ""; + disableElement("punchDetail"); enableElement("punchList"); var itemStyle = "punches"; @@ -48,13 +49,94 @@ function genList(punchList) { // punchList.sort(function(a, b){return new Date(a.date).getTime() - new Date(b.date).getTime()}); listLength = punchList.length; - list = ""; +// list = "
Punch ItemStatusPriorityAction
"; + + list = "
"; // +//prioritize in-progress for (i = 0; i < listLength; i++) { - list += "
"; + if (punchList[i].progress.toLowerCase() === "in progress") { + console.log(`in progress`); +// list += ""; + list += "
"; // + list += "
"; + list += "
" + punchList[i].subject + "
"; // + list += "
Status: " + punchList[i].progress + "
"; + list += "
Priority: " + punchList[i].priority + "
"; + list += "
Need By: " + punchList[i].nDate + "
"; + list += "
"; + list += "
"; + list += ""; + list += "
"; + list += "
"; + } } - list += "
Punch ItemStatusPriorityAction
" + punchList[i].subject + "" + punchList[i].progress + "" + punchList[i].priority + "
"; +// then !done + for (i = 0; i < listLength; i++) { + if (punchList[i].progress.toLowerCase() != "in progress") { + if (punchList[i].progress.toLowerCase() != "done") { + console.log(`not in progress or not done`); + list += "
"; // + list += "
"; + list += "
" + punchList[i].subject + "
"; // + list += "
Status: " + punchList[i].progress + "
"; + list += "
Priority: " + punchList[i].priority + "
"; + list += "
Need By: " + punchList[i].nDate + "
"; + list += "
"; + list += "
"; + list += ""; + list += "
"; + list += "
"; + } + } + } + +// then done + for (i = 0; i < listLength; i++) { + if (showDone === true) { + if (punchList[i].progress.toLowerCase() === "done") { + console.log(`show done.`); + list += "
"; // + list += "
"; + list += "
" + punchList[i].subject + "
"; // + list += "
Status: " + punchList[i].progress + "
"; + list += "
Priority: " + punchList[i].priority + "
"; + list += "
Need By: " + punchList[i].nDate + "
"; + list += "
"; + list += "
"; + list += ""; + list += "
"; + list += "
"; + } + } + } + + list += ""; document.getElementById("punchList").innerHTML = list; } @@ -153,3 +235,15 @@ window.onclick = function(e) { } } } + +function toggleShowDone() { + if (showDone === false) { + window.showDone = true; + } else if (showDone === true) { + window.showDone = false; + } else { + window.showDone = false; + } + getJson(genList); +} + diff --git a/punch_list/index.html b/punch_list/index.html index 2994031..d282174 100644 --- a/punch_list/index.html +++ b/punch_list/index.html @@ -25,11 +25,11 @@ -
+
-

+
@@ -56,6 +56,7 @@

+

diff --git a/punch_list/metadata.js b/punch_list/metadata.js index a9c5793..7cf0a40 100644 --- a/punch_list/metadata.js +++ b/punch_list/metadata.js @@ -1,6 +1,7 @@ -var version = "0.0.231", +var version = "0.1.302", debug = false, jsonUrl = "https://api.myjson.com/bins/1dodsj", + showDone = false, items, item, notes,