listing show button, fix percent count
This commit is contained in:
parent
8a6b6078c7
commit
a48013b752
@ -25,3 +25,17 @@ tag{
|
||||
padding: 0.5em;
|
||||
border-radius: 0.15em;
|
||||
}
|
||||
.toggle + ul{
|
||||
height: 0;
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
.toggle:focus + ul{
|
||||
height: 100%;
|
||||
transition: all ease 0.5s;
|
||||
visibility: visible;
|
||||
}
|
||||
.task_item{
|
||||
padding: 0.5em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ var router = express.Router();
|
||||
var fileToOpen = 'gtg_tasks'
|
||||
|
||||
// const convertFiles = true;
|
||||
const convertFiles = false;
|
||||
const computeDataOnExtract = true;
|
||||
let convertFiles = false;
|
||||
let computeDataOnExtract = true;
|
||||
|
||||
let jsonAllData = {
|
||||
tasks : {},
|
||||
@ -37,11 +37,14 @@ router.get('/', async function (req, res, next) {
|
||||
if(computeDataOnExtract){
|
||||
|
||||
jsonAllData = computeData(jsonAllData)
|
||||
computeDataOnExtract =false;
|
||||
}else{
|
||||
console.log('================== calcul de stats désactivé dans index.js ================== ')
|
||||
}
|
||||
console.log('json files read' )
|
||||
res.render('index', {title: "Conversion de GTG tâches", json: jsonAllData})
|
||||
res.render('index', {title: "Conversion de GTG tâches",
|
||||
json: jsonAllData,
|
||||
getPercentOfOpenTasks})
|
||||
});
|
||||
|
||||
async function readfileJson(fileToOpen){
|
||||
@ -100,7 +103,6 @@ function computeData(jsonAllData){
|
||||
}
|
||||
}
|
||||
})
|
||||
// found.tasks++
|
||||
}
|
||||
if(t.donedate){
|
||||
jsonAllData.stats.tasksClosed++;
|
||||
@ -122,6 +124,9 @@ function convertOneXmlToJson(fileToOpen,res){
|
||||
});
|
||||
}
|
||||
|
||||
function getPercentOfOpenTasks(someCount){
|
||||
return Math.round( 100*someCount / jsonAllData.stats.tasksOpen)
|
||||
}
|
||||
function transformToJson(xml,fileToOpen, res) {
|
||||
return parseString(xml, function (err, result) {
|
||||
if (err) console.log(err);
|
||||
|
@ -16,15 +16,21 @@ block content
|
||||
span.color couleur
|
||||
span.parent parent
|
||||
span.tasks tâches
|
||||
span.tasks actives
|
||||
span.tasks finies
|
||||
span.tasks actives
|
||||
span.tasks actives %
|
||||
each t in json.tags.tagstore.tag
|
||||
li
|
||||
span.name= t['$'].name
|
||||
span.color= t['$'].color
|
||||
span.parent= t['$'].parent
|
||||
span.tasks= t.tasks
|
||||
if t.tasksListIsActiveByTitle
|
||||
span.tasks= t.tasksListIsActiveByTitle.length
|
||||
if t.tasksListIsDoneByTitle
|
||||
span.tasks= t.tasksListIsDoneByTitle.length
|
||||
if t.tasksListIsActiveByTitle
|
||||
span.tasks #{t.tasksListIsActiveByTitle.length}
|
||||
span.tasks #{getPercentOfOpenTasks(t.tasksListIsActiveByTitle.length)} %
|
||||
button.toggle voir
|
||||
ul
|
||||
each activetask in t.tasksListIsActiveByTitle
|
||||
li.task_item= activetask
|
||||
|
Loading…
Reference in New Issue
Block a user