From: Ben Klang Date: Tue, 18 May 2010 19:28:45 +0000 (-0400) Subject: Pastie: Express the time as distance ago from now instead of absolute X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=79a7178279aa78f5aa8679555f4ba9d8f9af3e5b;p=horde.git Pastie: Express the time as distance ago from now instead of absolute --- diff --git a/pastie/templates/recent.inc b/pastie/templates/recent.inc index d7c7f727b..79a669b68 100644 --- a/pastie/templates/recent.inc +++ b/pastie/templates/recent.inc @@ -4,16 +4,26 @@ $uuid = Horde::applicationUrl('uuid');

Recent Pastings


-timestamp()); + $ago = $now->diff($then, true); + $days = $ago->format("%a"); + if ($days > 0) { + $ago = $ago->format("%a days %H:%i ago"); + } else { + $ago = $ago->format("%H:%i min ago"); + } ?>

| | - +

diff --git a/pastie/themes/screen.css b/pastie/themes/screen.css index 637b27cc5..154d5a3de 100644 --- a/pastie/themes/screen.css +++ b/pastie/themes/screen.css @@ -1,12 +1,12 @@ /* Insert CSS definitions here. */ #recentPastes { float: left; - width: 20%; + width: 18%; height: 100%; border: 1px solid #c00; padding: 2px; overflow: hidden; - margin: 50px 15px 10px 15px; + margin: 50px 10px 10px 10px; } .recentPaste {