diff --git a/public/css/global.css b/public/css/global.css index f37a1ea..adae17c 100644 --- a/public/css/global.css +++ b/public/css/global.css @@ -318,3 +318,8 @@ div.footer { text-align: center; margin-bottom: 5px; } + +table.commits tr td { + border: none; + padding-right: 5px; +} diff --git a/resources/views/components/git.blade.php b/resources/views/components/git.blade.php new file mode 100644 index 0000000..f87a00f --- /dev/null +++ b/resources/views/components/git.blade.php @@ -0,0 +1,48 @@ +@php +$api_root = app('config')->get('app')['api_root']; + +$commits = json_decode(file_get_contents($api_root.'/gitdata')); +$count = 0; + +function formatRelativeTime(DateTime $dateTime) { + $currentTimestamp = time(); + $dateTimeTimestamp = $dateTime->getTimestamp(); + $difference = $currentTimestamp - $dateTimeTimestamp; + + if ($difference < 60) { + return "just now"; + } elseif ($difference < 3600) { + $minutes = floor($difference / 60); + $suffix = ($minutes > 1) ? "s" : ""; + return $minutes . " minute" . $suffix . " ago"; + } elseif ($difference < 86400) { + $hours = floor($difference / 3600); + $suffix = ($hours > 1) ? "s" : ""; + return $hours . " hour" . $suffix . " ago"; + } elseif ($difference < 604800) { + $days = floor($difference / 86400); + $suffix = ($days > 1) ? "s" : ""; + return $days . " day" . $suffix . " ago"; + } else { + return $dateTime->format('Y-m-d H:i:s'); // Fallback to a specific format if desired + } +} +@endphp +
Mail: contact@diskfloppy.me
IRC: floppydisk @ r-type