From caf763aa1e9bff6c6f4ef2d209dcbafa29a95a8b Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Mon, 9 Feb 2026 02:28:54 -0700 Subject: [PATCH] Moar --- src/components/Avatar.astro | 4 +- src/components/StatCard.astro | 20 +- src/layouts/DashboardLayout.astro | 236 +++++++-------- src/pages/admin/index.astro | 67 ++-- src/pages/dashboard/clients.astro | 28 +- src/pages/dashboard/clients/[id]/edit.astro | 112 +++---- src/pages/dashboard/clients/[id]/index.astro | 70 ++--- src/pages/dashboard/clients/new.astro | 98 +++--- src/pages/dashboard/index.astro | 70 ++--- src/pages/dashboard/invoices/[id].astro | 100 +++--- src/pages/dashboard/invoices/[id]/edit.astro | 108 +++---- src/pages/dashboard/invoices/index.astro | 147 ++++----- src/pages/dashboard/invoices/new.astro | 92 +++--- src/pages/dashboard/organizations/new.astro | 30 +- src/pages/dashboard/reports.astro | 303 ++++++++----------- src/pages/dashboard/settings.astro | 26 +- src/pages/dashboard/team.astro | 37 +-- src/pages/dashboard/team/invite.astro | 40 ++- src/pages/dashboard/team/settings.astro | 257 +++++++--------- src/pages/dashboard/tracker.astro | 120 ++++---- src/pages/index.astro | 70 +++-- src/pages/login.astro | 50 ++- src/pages/signup.astro | 76 ++--- src/styles/global.css | 11 + 24 files changed, 1003 insertions(+), 1169 deletions(-) diff --git a/src/components/Avatar.astro b/src/components/Avatar.astro index e8c90d2..6cc833f 100644 --- a/src/components/Avatar.astro +++ b/src/components/Avatar.astro @@ -9,7 +9,7 @@ const initial = name ? name.charAt(0).toUpperCase() : '?'; ---
-
- {initial} +
+ {initial}
diff --git a/src/components/StatCard.astro b/src/components/StatCard.astro index 8ad66b1..a5e8cc4 100644 --- a/src/components/StatCard.astro +++ b/src/components/StatCard.astro @@ -13,13 +13,17 @@ interface Props { const { title, value, description, icon, color = 'text-primary', valueClass } = Astro.props; --- -
- {icon && ( -
- +
+
+
+ {title} + {icon && ( +
+ +
+ )}
- )} -
{title}
-
{value}
- {description &&
{description}
} +
{value}
+ {description &&
{description}
} +
diff --git a/src/layouts/DashboardLayout.astro b/src/layouts/DashboardLayout.astro index d8d7851..b6e7782 100644 --- a/src/layouts/DashboardLayout.astro +++ b/src/layouts/DashboardLayout.astro @@ -30,6 +30,20 @@ const userMemberships = await db.select({ const currentTeamId = Astro.cookies.get('currentTeamId')?.value || userMemberships[0]?.organization.id; const currentTeam = userMemberships.find(m => m.organization.id === currentTeamId); + +const navItems = [ + { href: '/dashboard', label: 'Dashboard', icon: 'heroicons:home', exact: true }, + { href: '/dashboard/tracker', label: 'Time Tracker', icon: 'heroicons:clock' }, + { href: '/dashboard/invoices', label: 'Invoices & Quotes', icon: 'heroicons:document-currency-dollar' }, + { href: '/dashboard/reports', label: 'Reports', icon: 'heroicons:chart-bar' }, + { href: '/dashboard/clients', label: 'Clients', icon: 'heroicons:building-office' }, + { href: '/dashboard/team', label: 'Team', icon: 'heroicons:user-group' }, +]; + +function isActive(item: { href: string; exact?: boolean }) { + if (item.exact) return Astro.url.pathname === item.href; + return Astro.url.pathname.startsWith(item.href); +} --- @@ -51,157 +65,137 @@ const currentTeam = userMemberships.find(m => m.organization.id === currentTeamI
- - )} -
+
-
  • - - Dashboard -
  • -
  • - - Time Tracker -
  • -
  • - - Invoices & Quotes -
  • -
  • - - Reports -
  • -
  • - - Clients -
  • -
  • - - Team -
  • + + -
    + +
    + -
  • - - -
    -
    {user.name}
    -
    {user.email}
    -
    - -
    -
  • - -
  • -
    - Theme - -
    -
  • - -
  • -
    - -
    -
  • - +
    + Theme + +
    +
    +
    + +
    +
    +
    +
    diff --git a/src/pages/admin/index.astro b/src/pages/admin/index.astro index b3aac53..d0eb51c 100644 --- a/src/pages/admin/index.astro +++ b/src/pages/admin/index.astro @@ -1,6 +1,7 @@ --- import DashboardLayout from '../../layouts/DashboardLayout.astro'; import Avatar from '../../components/Avatar.astro'; +import StatCard from '../../components/StatCard.astro'; import { db } from '../../db'; import { siteSettings, users } from '../../db/schema'; import { eq } from 'drizzle-orm'; @@ -21,52 +22,52 @@ const allUsers = await db.select().from(users).all(); --- -

    Site Administration

    +
    +

    Site Administration

    +

    Manage users and site settings

    +
    -
    - -
    -
    -
    Total Users
    -
    {allUsers.length}
    -
    -
    +
    +
    -
    -
    -

    Site Settings

    +
    +
    +

    Site Settings

    -
    - - -
    - +
    + Allow New Registrations -
    + -
    - +
    +
    -
    -
    -

    All Users

    +
    +
    +
    +

    All Users

    +
    - +
    @@ -77,22 +78,22 @@ const allUsers = await db.select().from(users).all(); {allUsers.map(u => ( - + - + - + ))} diff --git a/src/pages/dashboard/clients.astro b/src/pages/dashboard/clients.astro index 49736ea..6b16d40 100644 --- a/src/pages/dashboard/clients.astro +++ b/src/pages/dashboard/clients.astro @@ -21,20 +21,20 @@ const allClients = await db.select()
    -

    Clients

    - Add Client +

    Clients

    + Add Client
    -
    +
    {allClients.map(client => ( -
    -
    -

    {client.name}

    - {client.email &&

    {client.email}

    } -

    Created {client.createdAt?.toLocaleDateString() ?? 'N/A'}

    -
    - View - Edit +
    +
    +

    {client.name}

    + {client.email &&

    {client.email}

    } +

    Created {client.createdAt?.toLocaleDateString() ?? 'N/A'}

    +
    + View + Edit
    @@ -42,9 +42,9 @@ const allClients = await db.select()
    {allClients.length === 0 && ( -
    -

    No clients yet

    - Add Your First Client +
    +

    No clients yet

    + Add Your First Client
    )} diff --git a/src/pages/dashboard/clients/[id]/edit.astro b/src/pages/dashboard/clients/[id]/edit.astro index e4281e9..82178f0 100644 --- a/src/pages/dashboard/clients/[id]/edit.astro +++ b/src/pages/dashboard/clients/[id]/edit.astro @@ -29,145 +29,129 @@ if (!client) return Astro.redirect('/dashboard/clients');
    - - + + -

    Edit Client

    +

    Edit Client

    -
    -
    -
    - + +
    +
    + Client Name -
    + -
    - +
    + Email (optional) -
    + -
    - +
    + Phone (optional) -
    + -
    Address Details
    +
    Address Details
    -
    - +
    + Street Address (optional) -
    + -
    -
    - +
    +
    + City (optional) -
    + -
    - +
    + State / Province (optional) -
    +
    -
    -
    - +
    +
    + Zip / Postal Code (optional) -
    + -
    - +
    + Country (optional) -
    +
    -
    +
    - Cancel - + Cancel +
    @@ -177,17 +161,17 @@ if (!client) return Astro.redirect('/dashboard/clients'); diff --git a/src/pages/dashboard/clients/[id]/index.astro b/src/pages/dashboard/clients/[id]/index.astro index 4cedfdd..f9701aa 100644 --- a/src/pages/dashboard/clients/[id]/index.astro +++ b/src/pages/dashboard/clients/[id]/index.astro @@ -63,34 +63,34 @@ const totalEntriesCount = totalEntriesResult?.count || 0;
    - - + + -

    {client.name}

    +

    {client.name}

    -
    +
    -
    -
    +
    +
    -

    {client.name}

    +

    {client.name}

    {client.email && ( -
    + )} {client.phone && ( -
    + )} {(client.street || client.city || client.state || client.zip || client.country) && ( -
    +
    {client.street &&
    {client.street}
    } @@ -106,22 +106,22 @@ const totalEntriesCount = totalEntriesResult?.count || 0;
    - - + + Edit
    -
    -
    +
    -
    +
    -
    -
    -

    Information

    +
    +
    +

    Information

    -
    +
    -
    Created
    -
    {client.createdAt?.toLocaleDateString() ?? 'N/A'}
    +
    Created
    +
    {client.createdAt?.toLocaleDateString() ?? 'N/A'}
    - -
    -
    -
    -

    Recent Activity

    +
    +
    +
    +

    Recent Activity

    +
    {recentEntries.length > 0 ? (
    -
    Name
    -
    {u.name}
    +
    {u.name}
    {u.email}{u.email} {u.isSiteAdmin ? ( - Yes + Yes ) : ( - No + No )} {u.createdAt?.toLocaleDateString() ?? 'N/A'}{u.createdAt?.toLocaleDateString() ?? 'N/A'}
    +
    @@ -176,11 +176,11 @@ const totalEntriesCount = totalEntriesResult?.count || 0; {recentEntries.map(({ entry, tag, user: entryUser }) => ( - + - - + + ))} @@ -197,14 +197,14 @@ const totalEntriesCount = totalEntriesResult?.count || 0;
    Description
    {entry.description || '-'} {tag ? ( -
    +
    {tag.color && ( )} @@ -188,8 +188,8 @@ const totalEntriesCount = totalEntriesResult?.count || 0;
    ) : '-'}
    {entryUser?.name || 'Unknown'}{entry.startTime.toLocaleDateString()}{entryUser?.name || 'Unknown'}{entry.startTime.toLocaleDateString()} {formatTimeRange(entry.startTime, entry.endTime)}
    ) : ( -
    +
    No time entries recorded for this client yet.
    )} {recentEntries.length > 0 && ( -
    - + diff --git a/src/pages/dashboard/clients/new.astro b/src/pages/dashboard/clients/new.astro index fd472d9..47d7054 100644 --- a/src/pages/dashboard/clients/new.astro +++ b/src/pages/dashboard/clients/new.astro @@ -7,124 +7,108 @@ if (!user) return Astro.redirect('/login');
    -

    Add New Client

    +

    Add New Client

    -
    -
    -
    - + +
    +
    + Client Name -
    + -
    - +
    + Email (optional) -
    + -
    - +
    + Phone (optional) -
    + -
    Address Details
    +
    Address Details
    -
    - +
    + Street Address (optional) -
    + -
    -
    - +
    +
    + City (optional) -
    + -
    - +
    + State / Province (optional) -
    +
    -
    -
    - +
    +
    + Zip / Postal Code (optional) -
    + -
    - +
    + Country (optional) -
    +
    -
    - Cancel - +
    + Cancel +
    diff --git a/src/pages/dashboard/index.astro b/src/pages/dashboard/index.astro index 0b504de..e1001c7 100644 --- a/src/pages/dashboard/index.astro +++ b/src/pages/dashboard/index.astro @@ -104,25 +104,25 @@ const hasMembership = userOrgs.length > 0; --- -
    +
    -

    +

    Dashboard

    -

    Welcome back, {user.name}!

    +

    Welcome back, {user.name}!

    - - + + New Team
    {!hasMembership && ( -
    - +
    +

    Welcome to Chronus!

    -
    You're not part of any team yet. Create one or wait for an invitation.
    +
    You're not part of any team yet. Create one or wait for an invitation.
    @@ -134,14 +134,13 @@ const hasMembership = userOrgs.length > 0; {hasMembership && ( <> -
    +
    0; description="Total tracked time" icon="heroicons:calendar" color="text-secondary" - valueClass="text-3xl" /> 0; description="Currently running" icon="heroicons:play-circle" color="text-accent" - valueClass="text-3xl" /> 0; description="Total active" icon="heroicons:building-office" color="text-info" - valueClass="text-3xl" />
    -
    +
    -
    -
    -

    - +
    +
    +

    + Quick Actions

    -
    -
    -
    -

    - +
    +
    +

    + Recent Activity

    {stats.recentEntries.length > 0 ? ( -
      +
        {stats.recentEntries.map(({ entry, client, tag }) => ( -
      • -
        {client.name}
        -
        +
      • +
        {client.name}
        +
        {tag ? ( {tag.name} ) : No tag} - • {entry.endTime ? formatDuration(entry.endTime.getTime() - entry.startTime.getTime()) : 'Running...'} + · {entry.endTime ? formatDuration(entry.endTime.getTime() - entry.startTime.getTime()) : 'Running...'}
      • ))}
      ) : ( -
      - -

      No recent time entries

      +
      + +

      No recent time entries

      )}
      diff --git a/src/pages/dashboard/invoices/[id].astro b/src/pages/dashboard/invoices/[id].astro index 15244a6..dc512db 100644 --- a/src/pages/dashboard/invoices/[id].astro +++ b/src/pages/dashboard/invoices/[id].astro @@ -62,7 +62,7 @@ const isDraft = invoice.status === 'draft'; -
      -

      {invoice.number}

      +

      {invoice.number}

    {isDraft && (
    -
    @@ -87,8 +87,8 @@ const isDraft = invoice.status === 'draft'; {(invoice.status !== 'paid' && invoice.status !== 'void' && invoice.type === 'invoice') && (
    -
    @@ -96,25 +96,25 @@ const isDraft = invoice.status === 'draft'; {(invoice.status !== 'accepted' && invoice.status !== 'declined' && invoice.status !== 'void' && invoice.type === 'quote') && (
    -
    )} {(invoice.type === 'quote' && invoice.status === 'accepted') && (
    -
    )}