From f4586f06e543d8e3088188cb4808bdfe51c7bf1c Mon Sep 17 00:00:00 2001 From: Kameron Kenny Date: Tue, 25 Jun 2019 07:35:42 -0400 Subject: [PATCH] dropdown and additional fields --- punch_list/backlogManage.js | 17 ++++++++++++++++- punch_list/css/custom.css | 33 ++++++++++++++++++++++++++++++++- punch_list/metadata.js | 2 +- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/punch_list/backlogManage.js b/punch_list/backlogManage.js index 4ba89bc..b90b656 100644 --- a/punch_list/backlogManage.js +++ b/punch_list/backlogManage.js @@ -90,10 +90,11 @@ function genList(punchList, element) { var list = '
    '; for (i = 0; i < listLength; i++) { + 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. ' + punchList[i].subject + ' | ' + punchList[i].progress + '
  2. '; + list += '
  3. ' + punchList[i].priority + '
    ' + punchList[i].subject + '
    ' + punchList[i].progress + '
    Created:' + punchList[i].cDate + '
    Modified: ' + punchList[i].mDate + '

  4. '; } } @@ -108,6 +109,8 @@ function mkSortable() { $( function() { $( "#sortable" ).sortable({ + cancel: ".portlet-toggle", + placeholder: "portlet-placeholder ui-corner-all", start: function(event, ui) { window.sortObjectUUID = punchList[ui.item.index()].uuid; console.log(`Start Position: ${ui.item.index()}`); @@ -117,6 +120,18 @@ function mkSortable() { console.log(`New Position: ${ui.item.index()}`); } }); + + $( ".portlet" ) + .addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" ) + .find( ".backlog-list-header" ) + .addClass( "ui-widget-header ui-corner-all" ) + .prepend( ""); + + $( ".portlet-toggle" ).on( "click", function() { + var icon = $( this ); + icon.toggleClass( "ui-icon-minusthick ui-icon-plusthick" ); + icon.closest( ".portlet" ).find( ".backlog-list-content" ).toggle(); + }); $( "#sortable" ).disableSelection(); } ); } diff --git a/punch_list/css/custom.css b/punch_list/css/custom.css index c800df6..0006e3c 100644 --- a/punch_list/css/custom.css +++ b/punch_list/css/custom.css @@ -1,7 +1,37 @@ #sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; } -#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; } +#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; color: #AAA;} #sortable li span { position: absolute; margin-left: -1.3em; } + .portlet { + margin: 0 1em 1em 0; + padding: 0.3em; + } + .backlog-list-header { + padding: 0.2em 0.3em; + margin-bottom: 0.1em; + position: relative; + } + .portlet-toggle { + position: absolute; + top: 50%; + right: 0; + margin-top: -8px; + } + .backlog-list-content { + display: none; + padding: 0.4em; + } + .portlet-placeholder { + border: 1px dotted black; + margin: 0 1em 1em 0; + height: 50px; + } +.punch-default { border: 0px solid #AAA; background: #000; } +.inProgress { background: /*#80ffcc;*/ #555; color: #000; } .hide { display: none; } +.punch-list-backlog-details { + font-size: 18px; + color: #aaa; +} body { background: #222; color: #AAA; } @@ -121,6 +151,7 @@ textarea { .punches-current { background: #555; } .subject { + width: 89%; float: left; color: #FFF; font-size: 2rem; diff --git a/punch_list/metadata.js b/punch_list/metadata.js index a47e428..d96824f 100644 --- a/punch_list/metadata.js +++ b/punch_list/metadata.js @@ -1,4 +1,4 @@ -var version = "0.5.132", +var version = "0.5.143", debug = false, jsonUrl = "https://api.myjson.com/bins/1dodsj", showDone = false,