From bb8ce43b699435a1b43302e70fe9c1e29a9d0f23 Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Thu, 6 Aug 2026 22:35:17 +0300 Subject: [PATCH] web: restyle dashboard and database lists after git.sr.ht MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the bare 'Your databases' heading and compact grid with the git.sr.ht dashboard layout: a sidebar column with a welcome blurb plus block buttons (create database, configure dolt credentials), and the shared event-list cards for the database list. The repoList partial now renders each database as an event card — name, visibility as small muted text (non-public only, like git.sr.ht), description below — and the profile page picks the same partial up automatically. Adds a 'lower' template func for the visibility label and drops the now unused .repo-list grid from main.scss (.event-list ships with the core theme already). --- scss/main.scss | 8 -------- web/templates.go | 1 + web/templates/index.html | 23 ++++++++++++++++++----- web/templates/partials.html | 18 ++++++++++++------ 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/scss/main.scss b/scss/main.scss index e4fec7f8c7500edeb696d1c20d2467f56ef6c18e..d72a24342c91efbc2488a0d578888b3259c9e59d 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -16,11 +16,3 @@ font-family: $font-family-monospace; } } - -// Compact grid for the database list on user and dashboard pages. -.repo-list { - display: grid; - grid-template-columns: 1fr auto; - grid-gap: 0.25rem 1rem; - align-items: baseline; -} diff --git a/web/templates.go b/web/templates.go index 12c254456adae7a0c52ab0736a5f6f258601b178..14becc6942c0ac9881da9959bd901f8a1c9dbc42 100644 --- a/web/templates.go +++ b/web/templates.go @@ -128,6 +128,7 @@ func templateFuncs(icons map[string]template.HTML) template.FuncMap { // humansize renders a byte count as a human-readable size. "humansize": humanizeSize, "upper": strings.ToUpper, + "lower": strings.ToLower, // inc/dec support 1-based page arithmetic in pagination links. "inc": func(n int) int { return n + 1 }, "dec": func(n int) int { return n - 1 }, diff --git a/web/templates/index.html b/web/templates/index.html index db1229ce42672ae38917617037d8b4c1cb797e6f..d65bdd79b2003defd72b428db18201a7b014e5bc 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -1,14 +1,27 @@ {{define "content" -}} {{if .CurrentUser}}
-
-

Your databases

+
+

+ Welcome back, {{.CurrentUser.Username}}! This is your Dolt database + hosting service: dolt clone, push and + pull over HTTPS, with a web UI for browsing branches, + commits and tables. +

+ Create new database {{icon "caret-right"}} + Configure dolt credentials {{icon "caret-right"}}
-
- {{icon "plus-square"}} Create database +
+
+ {{template "repoList" .Repos}} + {{if .Repos}} + More on your profile {{icon "caret-right"}} + {{end}}
-{{template "repoList" .Repos}} {{else}}

{{.SiteName}} {{.SiteLabel}}

diff --git a/web/templates/partials.html b/web/templates/partials.html index 1b206621023215d308d2298ebd41bb484829bacc..f1adad12e7a019f58d178fc6cc35c67377c7bd8c 100644 --- a/web/templates/partials.html +++ b/web/templates/partials.html @@ -38,13 +38,19 @@ {{define "repoList" -}} {{if .}} -
+
{{range .}} - - ~{{.OwnerName}}/{{.Name}} - {{template "visibilityBadge" .Visibility}} - - {{.Description}} +
+

+ ~{{.OwnerName}}/{{.Name}} + {{if ne (printf "%s" .Visibility) "PUBLIC"}} + {{lower (printf "%s" .Visibility)}} + {{end}} +

+ {{if .Description}} +

{{.Description}}

+ {{end}} +
{{end}}
{{else}}