do not error out on basic auth
[grauphel.git] / controller / guicontroller.php
index d186207105d82879332503e8a77f61a507b26cab..127daafb1ada681d6b5f4f94c95c5c0b602a27f3 100644 (file)
@@ -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(