From 476adb98d83ebbf3d59a34c3d3b8713fba7f046d Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Thu, 7 Aug 2025 09:59:25 +0100 Subject: [PATCH] appview/pages: add dashboard to strings page Change-Id: wxnkzrtrmutqotnuywurqyvrnyxznyrz Signed-off-by: oppiliappan --- appview/pages/pages.go | 1 - .../pages/templates/strings/dashboard.html | 57 +++++++++++++++++++ .../templates/user/fragments/profileCard.html | 4 +- appview/state/profile.go | 16 ------ 4 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 appview/pages/templates/strings/dashboard.html diff --git a/appview/pages/pages.go b/appview/pages/pages.go index b3b6dde..c0d27e3 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -414,7 +414,6 @@ type ProfileCard struct { UserDid string UserHandle string FollowStatus db.FollowStatus - AvatarUri string Followers int Following int diff --git a/appview/pages/templates/strings/dashboard.html b/appview/pages/templates/strings/dashboard.html new file mode 100644 index 0000000..e7ab587 --- /dev/null +++ b/appview/pages/templates/strings/dashboard.html @@ -0,0 +1,57 @@ +{{ define "title" }}strings by {{ or .Card.UserHandle .Card.UserDid }}{{ end }} + +{{ define "extrameta" }} + + + + +{{ end }} + + +{{ define "content" }} +
+
+ {{ template "user/fragments/profileCard" .Card }} +
+
+ {{ block "allStrings" . }}{{ end }} +
+
+{{ end }} + +{{ define "allStrings" }} +

ALL STRINGS

+
+ {{ range .Strings }} + {{ template "singleString" (list $ .) }} + {{ else }} +

This user does not have any strings yet.

+ {{ end }} +
+{{ end }} + +{{ define "singleString" }} + {{ $root := index . 0 }} + {{ $s := index . 1 }} +
+ + {{ with $s.Description }} +
+ {{ . }} +
+ {{ end }} + + {{ $stat := $s.Stats }} +
+ {{ $stat.LineCount }} line{{if ne $stat.LineCount 1}}s{{end}} + + {{ with $s.Edited }} + edited {{ template "repo/fragments/shortTimeAgo" . }} + {{ else }} + {{ template "repo/fragments/shortTimeAgo" $s.Created }} + {{ end }} +
+
+{{ end }} diff --git a/appview/pages/templates/user/fragments/profileCard.html b/appview/pages/templates/user/fragments/profileCard.html index 61ef21a..4e5dd46 100644 --- a/appview/pages/templates/user/fragments/profileCard.html +++ b/appview/pages/templates/user/fragments/profileCard.html @@ -2,11 +2,9 @@
- {{ if .AvatarUri }}
- +
- {{ end }}