X-Git-Url: https://git.cweiske.de/grauphel.git/blobdiff_plain/272bb16b2d434090008d0759e10ff28bab96cb51..ce010bc12b8b0a03e662a2f4df984daa6d252fb8:/controller/guicontroller.php diff --git a/controller/guicontroller.php b/controller/guicontroller.php index 534f18f..127daaf 100644 --- a/controller/guicontroller.php +++ b/controller/guicontroller.php @@ -121,7 +121,7 @@ class GuiController extends Controller ) ); - $selectedRawtag = null; + $selectedRawtag = 'grauphel:special:untagged'; if (count($note->tags) > 0) { $selectedRawtag = $note->tags[0]; } @@ -149,7 +149,7 @@ class GuiController extends Controller */ public function tag($rawtag) { - $notes = $this->getNotes()->loadNotesOverview(null, $rawtag); + $notes = $this->getNotes()->loadNotesOverview(null, $rawtag, true); usort( $notes, function($noteA, $noteB) { @@ -157,6 +157,17 @@ class GuiController extends Controller } ); + foreach ($notes as &$note) { + $diffInDays = intval( + (time() - strtotime($note['last-change-date'])) / 86400 + ); + $value = 0 + $diffInDays; + if ($value > 160) { + $value = 160; + } + $note['dateColor'] = '#' . str_repeat(sprintf('%02X', $value), 3); + } + $res = new TemplateResponse('grauphel', 'tag'); $res->setParams( array(