From 096eb308fe40e72c29eaa4e597bd3b716951708c Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Tue, 22 Jul 2025 14:15:22 +0100 Subject: [PATCH] appview: fix repo ordering on timeline Signed-off-by: oppiliappan --- appview/db/repos.go | 1 + appview/db/timeline.go | 7 ++----- appview/pages/templates/layouts/base.html | 2 +- appview/pages/templates/repo/commit.html | 4 +++- appview/pages/templates/repo/index.html | 2 +- appview/pages/templates/timeline.html | 20 ++++++++++++-------- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/appview/db/repos.go b/appview/db/repos.go index 3afc7527..0d91f647 100644 --- a/appview/db/repos.go +++ b/appview/db/repos.go @@ -106,6 +106,7 @@ func GetRepos(e Execer, limit int, filters ...filter) ([]Repo, error) { from repos r %s + order by created desc %s`, whereClause, limitClause, diff --git a/appview/db/timeline.go b/appview/db/timeline.go index 96a81238..8b3b1d50 100644 --- a/appview/db/timeline.go +++ b/appview/db/timeline.go @@ -174,11 +174,8 @@ func getTimelineFollows(e Execer) ([]TimelineEvent, error) { var events []TimelineEvent for _, f := range follows { - profile, ok1 := profileMap[f.SubjectDid] - followStatMap, ok2 := followStatMap[f.SubjectDid] - if !ok1 || !ok2 { - continue - } + profile, _ := profileMap[f.SubjectDid] + followStatMap, _ := followStatMap[f.SubjectDid] events = append(events, TimelineEvent{ Follow: &f, diff --git a/appview/pages/templates/layouts/base.html b/appview/pages/templates/layouts/base.html index 74867492..dde74c79 100644 --- a/appview/pages/templates/layouts/base.html +++ b/appview/pages/templates/layouts/base.html @@ -18,7 +18,7 @@
{{ block "topbarLayout" . }}
-
+
{{ template "layouts/topbar" . }}
diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index d8d9d8bb..bbdb29f2 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -80,7 +80,9 @@ {{end}} {{ define "topbarLayout" }} - {{ template "layouts/topbar" . }} +
+ {{ template "layouts/topbar" . }} +
{{ end }} {{ define "contentLayout" }} diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html index 55021e34..011225d9 100644 --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -386,7 +386,7 @@ dark:[&_pre]:border dark:[&_pre]:border-gray-700 {{ end }}" > -
{{- if .Raw -}}
+            
{{- if .Raw -}}
                         {{- .HTMLReadme -}}
                     
{{- else -}} diff --git a/appview/pages/templates/timeline.html b/appview/pages/templates/timeline.html index 59721360..912490e9 100644 --- a/appview/pages/templates/timeline.html +++ b/appview/pages/templates/timeline.html @@ -143,15 +143,19 @@ {{ $subjectHandle | truncateAt30 }} - {{ with $profile.Description }} -

{{.}}

+ {{ with $profile }} + {{ with .Description }} +

{{.}}

+ {{ end }} + {{ end }} + {{ with $stat }} +
+ {{ i "users" "size-4" }} + {{ .Followers }} followers + + {{ .Following }} following +
{{ end }} -
- {{ i "users" "size-4" }} - {{ $stat.Followers }} followers - - {{ $stat.Following }} following -
{{ end }} -- 2.51.2