From c133603e4359f74e6dca3bb44c3c620ed3d399ba Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Mon, 26 May 2025 20:21:39 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feature:=20Add=20button=20for=20single?= =?UTF-8?q?=20domain=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/style.css | 27 +++++++++++++++++++++++++++ views/domain-cards.ejs | 24 ++++++++++++++---------- views/index.ejs | 2 +- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index d177783..dd94b0d 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -2124,6 +2124,12 @@ grid-template-columns: 1fr; grid-auto-rows: max-content; } + .card-actions { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + gap: calc(0.25rem * 2); + } .card-title { display: flex; align-items: center; @@ -2277,6 +2283,9 @@ .justify-center { justify-content: center; } + .justify-end { + justify-content: flex-end; + } .gap-0 { gap: calc(var(--spacing) * 0); } @@ -2418,6 +2427,10 @@ --btn-color: var(--color-info); --btn-fg: var(--color-info-content); } + .btn-primary { + --btn-color: var(--color-primary); + --btn-fg: var(--color-primary-content); + } .hover\:text-gray-400 { &:hover { @media (hover: hover) { @@ -2425,6 +2438,20 @@ } } } + .hover\:text-white { + &:hover { + @media (hover: hover) { + color: var(--color-white); + } + } + } + .hover\:text-white\! { + &:hover { + @media (hover: hover) { + color: var(--color-white) !important; + } + } + } .sm\:grid-cols-2 { @media (width >= 40rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); diff --git a/views/domain-cards.ejs b/views/domain-cards.ejs index bbd93d6..c8c34a4 100644 --- a/views/domain-cards.ejs +++ b/views/domain-cards.ejs @@ -2,11 +2,11 @@ // Helper function to format date function formatDate(dateString) { let date = new Date(dateString); - return date.toLocaleString('en-US', { + return date.toLocaleString('en-CA', { year: 'numeric', month: 'long', day: 'numeric', - hour: '2-digit', + hour: 'numeric', minute: '2-digit' }); } @@ -25,20 +25,24 @@ data.forEach(item => {
<% Object.keys(groupedDomains).forEach(domain => { %> - <% // Sort entries by created_at descending and limit to 5 - let sortedEntries=groupedDomains[domain] - .sort((a, b) => new Date(b.created_at) - new Date(a.created_at)) - .slice(0, 5); + <% + // Sort entries by created_at descending and limit to 5 + let sortedEntries=groupedDomains[domain] + .sort((a, b) => new Date(b.created_at) - new Date(a.created_at)) + .slice(0, 5); %> -
+

<%= domain %>

<% sortedEntries.forEach(entry => { %> -
-

<%= entry.id %>

-

<%= formatDate(entry.created_at) %>

+
+

<%= entry.id %>

+

<%= formatDate(entry.created_at) %>

<% }) %> +
<% }) %> diff --git a/views/index.ejs b/views/index.ejs index 75735e2..e46a309 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -3,7 +3,7 @@

Welcome to <%= title %>

- + <%- include('add-form'); -%>

Your Tests