";
-
-
-//prioritize in-progress
var list = '';
+
for (i = 0; i < listLength; i++) {
- if (punchList[i].progress.toLowerCase() === "in progress") {
- console.log(`in progress`);
-// list += "
";
+ if (window.tagFilterItem != undefined) {
+ if (punchList[i].tags != undefined && punchList[i].tags.includes(window.tagFilterItem)) {
+ console.log(`in tagFilterIf`);
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 += "
" + punchList[i].subject + "
"; //
+ list += "
Status: " + punchList[i].progress + "
";
+ list += "
Priority: " + punchList[i].priority + "
";
+ list += "
Need By: " + punchList[i].nDate + "
";
- if (punchList[i].tags != undefined) {
- console.log(`Adding tags object to punchList[${item}]`);
- list += "
Tags: ";
- for (t = 0; t < punchList[i].tags.length; t++) {
- list += punchList[i].tags[t] + ", ";
- }
- list += "
";
- }
- list += "
";
- list += "
";
- list += "
";
- list += "";
- list += "
";
- list += "start";
- list += "done";
- list += "edit";
- list += "delete";
- list += "
";
- list += "
";
- list += "
";
+ if (punchList[i].tags != undefined) {
+ list += "
Tags: ";
+ for (t = 0; t < punchList[i].tags.length; t++) {
+ list += "" + punchList[i].tags[t] + ", ";
+ }
list += "
";
+ }
list += "
";
- document.getElementById("punchListInProgress").innerHTML = list;
+ list += "
";
+ list += "
";
+ list += "";
+ list += "
";
+ list += "start";
+ list += "done";
+ list += "edit";
+ list += "delete";
+ list += "
";
}
- }
-
-// then !done
- var list = '';
- 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`);
+ } else {
+ console.log(`in tagFilterElse`);
list += "
"; //
list += "
"; //
- list += "
";
- list += "
" + punchList[i].subject + "
"; //
- list += "
Status: " + punchList[i].progress + "
";
- list += "
Priority: " + punchList[i].priority + "
";
- list += "
Need By: " + punchList[i].nDate + "
";
- if (punchList[i].tags != undefined) {
- console.log(`Adding tags object to punchList[${item}]`);
- list += "
Tags: ";
- for (t = 0; t < punchList[i].tags.length; t++) {
- list += punchList[i].tags[t] + ", ";
- }
- list += "
";
- }
+ list += "
";
+ list += "
" + punchList[i].subject + "
"; //
+ list += "
Status: " + punchList[i].progress + "
";
+ list += "
Priority: " + punchList[i].priority + "
";
+ list += "
Need By: " + punchList[i].nDate + "
";
+
+ if (punchList[i].tags != undefined) {
+ list += "
Tags: ";
+ for (t = 0; t < punchList[i].tags.length; t++) {
+ list += "" + punchList[i].tags[t] + ", ";
+ }
list += "
";
- list += "
";
- list += "
";
- list += "";
- list += "
";
- list += "start";
- list += "done";
- list += "edit";
- list += "delete";
- list += "
";
- list += "
";
- list += "
";
- list += "
";
- list += "
";
- document.getElementById("punchListNew").innerHTML = list;
}
+ list += "
";
+ list += "
";
+ list += "
";
+ list += "";
+ list += "
";
+ list += "start";
+ list += "done";
+ list += "edit";
+ list += "delete";
+ list += "
";
}
}
-// then done
- var list = '';
- for (i = 0; i < listLength; i++) {
- if (showDone === true) {
- enableElement("punchListDoneWrapper");
- if (punchList[i].progress.toLowerCase() === "done") {
- console.log(`show done.`);
- list += "
"; //
- list += "
"; //
- list += "
";
- list += "
" + punchList[i].subject + "
"; //
- list += "
Status: " + punchList[i].progress + "
";
- list += "
Priority: " + punchList[i].priority + "
";
- list += "
Need By: " + punchList[i].nDate + "
";
- if (punchList[i].tags != undefined) {
- console.log(`Adding tags object to punchList[${item}]`);
- list += "
Tags: ";
- for (t = 0; t < punchList[i].tags.length; t++) {
- list += punchList[i].tags[t] + ", ";
- }
- list += "
";
- }
- list += "
";
- list += "
";
- list += "
";
- list += "";
- list += "
";
- list += "start";
- list += "done";
- list += "edit";
- list += "delete";
- list += "