diff --git a/Endpoints/SessionEndpoint.cs b/Endpoints/SessionEndpoint.cs index a807ec7..25b8b69 100644 --- a/Endpoints/SessionEndpoint.cs +++ b/Endpoints/SessionEndpoint.cs @@ -13,6 +13,7 @@ public static class SessionEndpoint public static void MapSessionEndpoints(this IEndpointRouteBuilder app) { app.MapGet("/api/sessions", HandleList); + app.MapGet("/api/sessions/{sessionId}", HandleGet); app.MapPost("/api/sessions", HandleCreate); app.MapPut("/api/sessions/{sessionId}", HandleUpdate); } @@ -23,6 +24,23 @@ public static class SessionEndpoint await ctx.Response.WriteAsJsonAsync(sessions); } + private static async Task HandleGet(HttpContext ctx, DatabaseService db) + { + var sessionId = ctx.Request.RouteValues["sessionId"]?.ToString(); + if (string.IsNullOrEmpty(sessionId)) + { + ctx.Response.StatusCode = 400; + return; + } + var session = await db.GetSession(sessionId); + if (session == null) + { + ctx.Response.StatusCode = 404; + return; + } + await ctx.Response.WriteAsJsonAsync(session); + } + private static async Task HandleCreate(HttpContext ctx, DatabaseService db) { var session = await db.CreateSession("Neue Session"); diff --git a/wwwroot/css/style.css b/wwwroot/css/style.css index 2befe50..8be8b6c 100644 --- a/wwwroot/css/style.css +++ b/wwwroot/css/style.css @@ -4,16 +4,54 @@ body { background: #222; color: #eee; display: flex; + flex-direction: column; height: 100vh; } -main { +#app { flex: 1; display: flex; flex-direction: column; - min-width: 0; + overflow: hidden; } +.page { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; +} + +/* ── Nav ── */ + +#nav { + padding: .75em 1.5em; + border-bottom: 1px solid #444; + display: flex; + align-items: center; + gap: 2em; + flex-shrink: 0; +} + +.nav-brand { + font-weight: bold; + font-size: 1.1em; +} + +.nav-links { + display: flex; + gap: 1em; +} + +.nav-link { + color: #888; + text-decoration: none; + padding: .25em .5em; +} + +.nav-link:hover { color: #eee; } +.nav-link.active { color: #eee; border-bottom: 2px solid #eee; } + body, input, select, button, textarea { font-family: monospace; font-size: 1em; @@ -53,66 +91,10 @@ textarea { cursor: pointer; } -/* ── Sidebar ── */ - -#sidebar { - width: 260px; - background: #1a1a1a; - border-right: 1px solid #444; - display: flex; - flex-direction: column; - flex-shrink: 0; - overflow: hidden; -} - -.sidebar-header { - padding: 1em; - border-bottom: 1px solid #444; - display: flex; - align-items: center; - justify-content: space-between; -} - -.sidebar-header h2 { - font-size: 1em; -} - -#sessionList { - flex: 1; - overflow-y: auto; -} - -.session-item { - padding: 1em; - cursor: pointer; - display: flex; - flex-direction: column; - border-left: 3px solid transparent; -} - -.session-item:hover { background: #333; } - -.session-item.active { - background: #333; - border-left-color: #eee; -} - -.session-name { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - border: 1px solid transparent; -} - -.session-date { - color: #888; -} - .session-rename { background: #222; border: 1px solid #888; outline: none; - width: 100%; } /* ── Header ── */ @@ -249,3 +231,108 @@ header h1 { display: block; margin-inline: auto; } + +/* ── Dashboard ── */ + +.dashboard { + padding: 2em; + overflow-y: auto; +} + +.dashboard section { + margin-bottom: 2em; +} + +.section-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 1em; +} + +.section-header h2 { + font-size: 1.1em; +} + +.card-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + gap: 1em; +} + +.card { + background: #333; + border: 1px solid #444; + padding: 1em; + display: flex; + flex-direction: column; + gap: .5em; +} + +.card.clickable { cursor: pointer; } +.card.clickable:hover { border-color: #888; } + +.card-icon { font-size: 2em; } +.card-title { font-weight: bold; } +.card-sub { color: #888; font-size: 0.85em; } + +.card.placeholder { + border-style: dashed; + color: #666; +} + +/* ── Session Page ── */ + +.session-page { + display: flex; + flex-direction: column; +} + +.session-header { + padding: .75em 1.5em; + border-bottom: 1px solid #444; + display: flex; + align-items: center; + gap: 1em; + flex-shrink: 0; +} + +.session-header h1 { + font-size: 1em; +} + +.back-btn { + background: none; + border: none; + font-size: 1.2em; + padding: .25em .5em; +} + +.header-btn { + font-size: 0.85em; +} + +.editable-title { + cursor: pointer; +} + +.editable-title:hover { + text-decoration: underline; + text-decoration-style: dotted; +} + +/* ── Placeholder Pages ── */ + +.placeholder-page { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 1em; + color: #888; +} + +.placeholder-icon { + font-size: 4em; +} diff --git a/wwwroot/index.html b/wwwroot/index.html index 514388d..ad4c2d9 100644 --- a/wwwroot/index.html +++ b/wwwroot/index.html @@ -3,48 +3,109 @@
-