diff --git a/pages/doppelklinge.page.php b/pages/doppelklinge.page.php index 7710257..2e369d2 100644 --- a/pages/doppelklinge.page.php +++ b/pages/doppelklinge.page.php @@ -9,12 +9,16 @@ if(!empty($progress)) { preg_match_all("/(?.*): (?.*) \/ (?.*)/m", $progress, $tmp); for($i = 0; $i < count($tmp[0]); $i++) { + if(preg_match('/XP\:/', $tmp['task'][$i])) + continue; + $list[$i] = (object)[ 'task' => trim($tmp['task'][$i]), 'act' => (int)str_replace('.', '', $tmp['act'][$i]), 'max' => (int)str_replace('.', '', $tmp['max'][$i]) ]; $list[$i]->percent = round($list[$i]->act / $list[$i]->max * 100, 2); + $list[$i]->left = $list[$i]->max - $list[$i]->act; } usort($list, function($a, $b) { return $b->percent <=> $a->percent; }); diff --git a/tpl/doppelklinge.html b/tpl/doppelklinge.html index 77e480d..569a03b 100644 --- a/tpl/doppelklinge.html +++ b/tpl/doppelklinge.html @@ -18,6 +18,7 @@ Aufgabe Fortschritt Ziel + übrig Prozent @@ -25,8 +26,9 @@ {% for($i = 0; $i < count($list); $i++): %} {{ $list[$i]->task }} - {{ $list[$i]->act }} - {{ $list[$i]->max }} + {{ number_format($list[$i]->act, 0, '', '.') }} + {{ number_format($list[$i]->max, 0, '', '.') }} + {{ number_format($list[$i]->left, 0, '', '.') }} {{ $list[$i]->percent }} {% endfor; %}