From 79a7178279aa78f5aa8679555f4ba9d8f9af3e5b Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 18 May 2010 15:28:45 -0400 Subject: [PATCH] Pastie: Express the time as distance ago from now instead of absolute --- pastie/templates/recent.inc | 20 +++++++++++++++----- pastie/themes/screen.css | 4 ++-- 2 files changed, 17 insertions(+), 7 deletions(-) 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 { -- 2.11.0