From a6c77959ecbb28c70591d898f51ba7069186e4d5 Mon Sep 17 00:00:00 2001 From: Kameron Kenny Date: Wed, 26 Jun 2019 12:58:51 -0400 Subject: [PATCH] status menu --- punch_list/backlogManage.js | 97 ++++++++++++++++++++++++++++-- punch_list/css/custom.css | 69 ++++++++++++--------- punch_list/images/down-carrot.png | Bin 0 -> 5520 bytes punch_list/metadata.js | 2 +- 4 files changed, 136 insertions(+), 32 deletions(-) create mode 100644 punch_list/images/down-carrot.png diff --git a/punch_list/backlogManage.js b/punch_list/backlogManage.js index 695dbbb..47ed6da 100644 --- a/punch_list/backlogManage.js +++ b/punch_list/backlogManage.js @@ -91,6 +91,10 @@ function genList(punchList, element) { var list = '
    '; for (i = 0; i < listLength; i++) { + if (punchList[i].progress.toLowerCase() === "in progress") { var style = "inProgress" } + else if (punchList[i].progress.toLowerCase() === "waiting") { var style = "waiting" } + else { var style = "punch-default" } + if (window.tagFilterItem != undefined) { console.log('in tags filter'); if (punchList[i].tags != undefined && punchList[i].tags.includes(window.tagFilterItem)) { @@ -103,11 +107,23 @@ function genList(punchList, element) { list += '
    '; list += '
    ' +punchList[i].priority + '
    ' + punchList[i].subject + '
    '; list += '
    ' + punchList[i].progress + '
    '; + // status dropdown + list += ''; +/* if (style === "inProgress") { list += ''; } else if (style === "punch-default") { list += ''; } +*/ if ( punchList[i].nDate != null && punchList[i].nDate != undefined && punchList[i].nDate != '' ) { list += '
    ' + punchList[i].nDate + '
    '; } else { @@ -133,6 +149,11 @@ function genList(punchList, element) { } list += '
    '; list += '
    '; + if ( punchList[i].startTime != undefined ) { + list += '
    '; + list += new Date(punchList[i].startTime); + list += '
    '; + } if ( punchList[i].notes != "" ) { list += '
    '; } @@ -142,20 +163,32 @@ function genList(punchList, element) { } } else { console.log('in no tags filter'); - if (punchList[i].progress.toLowerCase() === "in progress") { var style = "inProgress" } else { var style = "punch-default" } + if (punchList[i].progress.toLowerCase() === "done" && punchList[i].priority != 99999) { setPriority(punchList[i].uuid, 99999); } else if (punchList[i].progress.toLowerCase() != "done"){ list += '
  1. '; list += '
    '; list += '
    '; - list += '
    ' +punchList[i].priority + '
    ' + punchList[i].subject + '
    '; + list += '
    ' + punchList[i].priority + '
    ' + punchList[i].subject + '
    '; list += '
    ' + punchList[i].progress + '
    '; + // status dropdown + list += ''; +/* if (style === "inProgress") { list += ''; } else if (style === "punch-default") { list += ''; } +*/ if ( punchList[i].nDate != null && punchList[i].nDate != undefined && punchList[i].nDate != '' ) { list += '
    ' + punchList[i].nDate + '
    '; } else { @@ -181,8 +214,15 @@ function genList(punchList, element) { } list += '
    '; list += '
    '; + if ( punchList[i].startTime != undefined ) { + list += '
    Started: '; + list += new Date(punchList[i].startTime); + list += '
    '; + } if ( punchList[i].notes != "" ) { + list += '
    '; list += '
    '; + list += '
    '; } list += ''; list += '
  2. '; @@ -194,6 +234,26 @@ function genList(punchList, element) { document.getElementById(element).innerHTML = list; mkSortable(); +enableDrop(); +} + +function progressMenuDrop(uuid) { + document.getElementById("progressDropdown-" + uuid).classList.toggle("show"); +} + +function enableDrop() { + window.onclick = function(event) { + if (!event.target.matches('.dropbtn')) { + var dropdowns = document.getElementsByClassName("dropdown-content"); + var i; + for (i = 0; i < dropdowns.length; i++) { + var openDropdown = dropdowns[i]; + if (openDropdown.classList.contains('show')) { + openDropdown.classList.remove('show'); + } + } + } + } } function mkSortable() { @@ -254,6 +314,10 @@ function startPunch(uuid) { var punchList = window.punches; item = findArrayId(uuid); + if ( punchList[item].startTime === undefined ) { + punchList[item].startTime = new Date().getTime(); + } + punchList[item].progress = "In Progress"; jsonStr = JSON.stringify(punchList); @@ -263,12 +327,37 @@ function startPunch(uuid) { function completePunch(uuid) { var punchList = window.punches; item = findArrayId(uuid); + + if ( punchList[item].doneTime === undefined ) { + punchList[item].doneTime = new Date().getTime(); + } + punchList[item].progress = "Done"; jsonStr = JSON.stringify(punchList); putJson(jsonStr); } +function waitingPunch(uuid) { + var punchList = window.punches; + item = findArrayId(uuid); + + punchList[item].progress = "Waiting"; + + jsonStr = JSON.stringify(punchList); + putJson(jsonStr); +} + +function mkPunchNew(uuid) { + var punchList = window.punches; + item = findArrayId(uuid); + + punchList[item].progress = "New"; + + jsonStr = JSON.stringify(punchList); + putJson(jsonStr); +} + function enablePunchDetail(uuid) { var punchList = window.punches; item = findArrayId(uuid); @@ -453,14 +542,14 @@ function submitEditPunch(uuid) { var priorityField = document.getElementById("editPriority").value; var progressField = document.getElementById("editProgress").innerHTML; var nDateField = document.getElementById("timepickerEdit").value; - var tagsField = document.getElementById("editTags").value.toLowerCase(); + //var tagsField = document.getElementById("editTags").value.toLowerCase(); var notesField = document.getElementById("editNotes").value; punchList[id].subject = subjectField; punchList[id].priority = priorityField; punchList[id].progress = progressField; punchList[id].nDate = nDateField; - punchList[id].tags = tagsField; + //punchList[id].tags = tagsField; punchList[id].notes = notesField; jsonStr = JSON.stringify(punchList); diff --git a/punch_list/css/custom.css b/punch_list/css/custom.css index eb8377c..0996abf 100644 --- a/punch_list/css/custom.css +++ b/punch_list/css/custom.css @@ -34,9 +34,20 @@ a.punch-default { color: #00BFFF; font-size: 12px; text-decoration: none;} a.punch-default:hover { color: #00FFFF; text-shadow: 0px 0px 23px #FFF; } .punch-default { border: 0px solid #AAA; color: #aaa; font-size: 12px; } .inProgress { color: orange; font-size: 12px; } -.overdue { color: red; } -.duesoon { color: yellow; } +.waiting { color: red; font-size: 12px; } +.overdue { color: red; font-size: 12px; } +.duesoon { color: yellow; font-size: 12px;} .hide { display: none; } +i { + border: solid black; + border-width: 0 3px 3px 0; + display: inline-block; + padding: 3px; +} +.down { + transform: rotate(45deg); + -webkit-transform: rotate(45deg); +} .punch-list-backlog-details { font-size: 18px; color: #aaa; @@ -113,53 +124,57 @@ textarea { text-decoration: none; } -.dropdown { - float: left; - overflow: hidden; -} +.top { vertical-align: top; padding: 0px; margin: 0px; } -.dropdown .dropbtn { - cursor: pointer; - vertical-align: middle; - font-size: 16px; - border: none; - outline: none; +/* Dropdown Button */ +.dropbtn { + height: 15px; +/* background-image: url("../images/down-carrot.png"); */ + vertical-align: top; + background-color: #3498DB; color: white; - padding: 14px 16px; - background-color: inherit; - font-family: inherit; - margin: 0; + padding: 6px; + font-size: 10px; + cursor: pointer; + border: 0px; } -.navbar a:hover, .dropdown:hover .dropbtn, .dropbtn:focus { - background-color: red; +/* Dropdown button on hover & focus */ +.dropbtn:hover, .dropbtn:focus { + background-color: #2980B9; } +/* The container
    - needed to position the dropdown content */ +.dropdown { + position: relative; + display: inline-block; + height: 20px; +} + +/* Dropdown Content (Hidden by Default) */ .dropdown-content { display: none; position: absolute; - background-color: #f9f9f9; + background-color: #f1f1f1; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } +/* Links inside the dropdown */ .dropdown-content a { - float: none; color: black; padding: 12px 16px; text-decoration: none; display: block; - text-align: left; } -.dropdown-content a:hover { - background-color: #ddd; -} +/* Change color of dropdown links on hover */ +.dropdown-content a:hover {background-color: #ddd} + +/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */ +.show {display:block;} -.show { - display: block; -} .warn { color: yellow; } .green { color: lime; } .over { color: red; } diff --git a/punch_list/images/down-carrot.png b/punch_list/images/down-carrot.png new file mode 100644 index 0000000000000000000000000000000000000000..4864847d0cd70bd49073c0764f1d5a663eeae9e7 GIT binary patch literal 5520 zcmdT|c~Dc?(vK0uh=Ll$QIsGfVMag{*#(IRBxC~t6+}P<#f2q`EQ)Z68wx7p0vHld zL2y)*0J6&J3bI5IA;=aN%phSGLITNs=K?eJ>Z|Y7H}CuB)uU4M=|0`R{`Ki|Q+;#M ziB4QFZ^b+m3bnw2Wb2GVp}`W3nmZea=b3A&fs*V*b+rSktu5hie&}?%g9D97b|8_- z4ipNBOm&!AOs#>1My67cHH8A)z@LMI16WTPfgRa$AXC791c5{%5{bwb0HIK$qoW;= zSmZ+>5XfX2SO9Ja6oqPFphrO#;6nzGNL~u!KysjL-3pw^NGwQ4p#s3E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