From f024412aefb8afeca50b1f15504cb6f8dccd24b4 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 15 Feb 2025 22:40:59 +0000 Subject: [PATCH] improve repo-index --- appview/pages/pages.go | 2 + appview/pages/templates/layouts/repobase.html | 20 +++--- appview/pages/templates/layouts/topbar.html | 2 +- appview/pages/templates/repo/index.html | 64 ++++++++++++++++--- flake.nix | 2 +- go.mod | 1 + go.sum | 2 + input.css | 2 +- knotserver/routes.go | 9 ++- types/repo.go | 1 + 10 files changed, 81 insertions(+), 24 deletions(-) diff --git a/appview/pages/pages.go b/appview/pages/pages.go index 4079c72..fd16a90 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -11,6 +11,7 @@ import ( "path" "strings" + "github.com/dustin/go-humanize" "github.com/sotangled/tangled/appview/auth" "github.com/sotangled/tangled/appview/db" "github.com/sotangled/tangled/types" @@ -48,6 +49,7 @@ func funcMap() template.FuncMap { } return pairs, nil }, + "timeFmt": humanize.Time, } } diff --git a/appview/pages/templates/layouts/repobase.html b/appview/pages/templates/layouts/repobase.html index 945e00a..3c3c94d 100644 --- a/appview/pages/templates/layouts/repobase.html +++ b/appview/pages/templates/layouts/repobase.html @@ -1,14 +1,16 @@ {{ define "title" }}{{ .RepoInfo.FullName }}{{ end }} {{ define "content" }} - -
-

{{ .RepoInfo.FullName }}

- {{ if .RepoInfo.Description }} -

{{ .RepoInfo.Description }}

- {{ else }} - this repo has no description - {{ end }} +
+ {{ .RepoInfo.FullName }} +
+ + {{ if .RepoInfo.Description }} + {{ .RepoInfo.Description }} + {{ else }} + this repo has no description + {{ end }} +