diff --git a/appview/pages/pages.go b/appview/pages/pages.go index 02bf0766..f77a6af6 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -402,11 +402,12 @@ func (p *Pages) Brand(w io.Writer, params BrandParams) error { } type TimelineParams struct { - LoggedInUser *oauth.MultiAccountUser - Timeline []models.TimelineEvent - Repos []models.Repo - GfiLabel *models.LabelDefinition - BlueskyPosts []models.BskyPost + LoggedInUser *oauth.MultiAccountUser + Timeline []models.TimelineEvent + Repos []models.Repo + GfiLabel *models.LabelDefinition + BlueskyPosts []models.BskyPost + VouchSuggestions []models.VouchSuggestion // ShowNewsletter controls whether the newsletter widget/CTA is rendered. // For logged-in users it reflects their newsletter_preferences row; for // anonymous visitors it is always true (dismissal falls back to diff --git a/appview/pages/templates/timeline/fragments/announcements.html b/appview/pages/templates/timeline/fragments/announcements.html new file mode 100644 index 00000000..c6e86f31 --- /dev/null +++ b/appview/pages/templates/timeline/fragments/announcements.html @@ -0,0 +1,39 @@ +{{ define "timeline/fragments/announcements" }} +
+ +
+ {{ template "vouchAnnouncement" . }} +
+
+{{ end }} + +{{ define "vouchAnnouncement" }} +
+
+

Build a web of trust

+

+ Vouch for trustworthy users that make open-source a better place. Visit a user's + profile to vouch for them. +

+ +
+ + Read more + + {{ if and .LoggedInUser .VouchSuggestions }} + + View suggestions {{ i "arrow-right" "size-3.5" }} + + {{ end }} +
+ +
+ +
+ {{ i "shield-plus" "size-48" }} +
+
+{{ end }} diff --git a/appview/pages/templates/timeline/fragments/timeline.html b/appview/pages/templates/timeline/fragments/timeline.html index e8d7c7df..efc0153f 100644 --- a/appview/pages/templates/timeline/fragments/timeline.html +++ b/appview/pages/templates/timeline/fragments/timeline.html @@ -1,8 +1,9 @@ {{ define "timeline/fragments/timeline" }}
-
-

Timeline

-
+

+ {{ i "gallery-vertical" "size-5 flex-shrink-0" }} + Timeline +

{{ range $i, $e := .Timeline }} diff --git a/appview/pages/templates/timeline/fragments/trending.html b/appview/pages/templates/timeline/fragments/trending.html index 1a42a163..18cb0527 100644 --- a/appview/pages/templates/timeline/fragments/trending.html +++ b/appview/pages/templates/timeline/fragments/trending.html @@ -1,21 +1,21 @@ {{ define "timeline/fragments/trending" }} -
-

- Trending - {{ i "trending-up" "size-4 flex-shrink-0" }} +
+

+ {{ i "trending-up" "size-5 flex-shrink-0" }} + Trending

{{ if .Repos }} -
- {{ range $index, $repo := .Repos }} -
- {{ template "user/fragments/repoCard" (list $ $repo true) }} -
- {{ end }} +
+ {{ range $index, $repo := .Repos }} +
+ {{ template "user/fragments/repoCard" (list $ $repo true) }} +
+ {{ end }}
{{ else }}
- No trending repositories this week + No trending repositories this week
{{ end }} -
+
{{ end }} diff --git a/appview/pages/templates/timeline/fragments/vouchSuggestions.html b/appview/pages/templates/timeline/fragments/vouchSuggestions.html new file mode 100644 index 00000000..7f0ba967 --- /dev/null +++ b/appview/pages/templates/timeline/fragments/vouchSuggestions.html @@ -0,0 +1,24 @@ +{{ define "timeline/fragments/vouchSuggestions" }} + {{ if and .LoggedInUser .VouchSuggestions }} +
+

+ {{ i "shield-plus" "size-5 flex-shrink-0" }} + Suggested +

+
+ {{ range .VouchSuggestions }} +
+ {{ template "user/fragments/picLink" (list .Did.String "size-10") }} +
+ {{ resolve .Did.String }} + {{ .Reason }} +
+
+ {{ template "user/fragments/vouch" . }} +
+
+ {{ end }} +
+
+ {{ end }} +{{ end }} diff --git a/appview/pages/templates/timeline/timeline.html b/appview/pages/templates/timeline/timeline.html index ed82cdfa..366ccd85 100644 --- a/appview/pages/templates/timeline/timeline.html +++ b/appview/pages/templates/timeline/timeline.html @@ -16,18 +16,22 @@ {{ end }} {{ define "content" }} -
+
-
+
{{ template "timeline/fragments/timeline" . }}
-
+
{{ if .ShowNewsletter }} -
+
{{ template "timeline/fragments/newsletterWidget" . }}
{{ end }} + {{ template "timeline/fragments/announcements" . }} + {{ template "timeline/fragments/trending" . }}
diff --git a/appview/pages/templates/user/fragments/networkVouches.html b/appview/pages/templates/user/fragments/networkVouches.html index a8afe576..e235b9a4 100644 --- a/appview/pages/templates/user/fragments/networkVouches.html +++ b/appview/pages/templates/user/fragments/networkVouches.html @@ -4,9 +4,9 @@ {{ $denounces := (list) }} {{ range .IndirectVouches }} {{ if .IsVouch }} - {{ $vouches = append $vouches .Did }} + {{ $vouches = append $vouches .Did.String }} {{ else if .IsDenounce }} - {{ $denounces = append $denounces .Did }} + {{ $denounces = append $denounces .Did.String }} {{ end }} {{ end }} @@ -18,7 +18,7 @@ border-x border-green-600/25 dark:border-green-400/25 {{ if $denounces }} border-t {{ else }} border-y {{ end }} "> - + vouched for by {{ len $vouches }} {{ if eq (len $vouches) 1 }}user{{ else }}users{{ end }} {{ template "fragments/tinyAvatarList" (dict "all" $vouches "classes" "size-6") }} @@ -32,7 +32,7 @@ border-x border-red-600/25 dark:border-red-400/25 {{ if $vouches }} border-b {{ else }} border-y {{ end }} "> - + denounced by {{ len $denounces }} {{ if eq (len $denounces) 1 }}user{{ else }}users{{ end }} {{ template "fragments/tinyAvatarList" (dict "all" $denounces "classes" "size-6") }} diff --git a/appview/pages/templates/user/fragments/vouchButton.html b/appview/pages/templates/user/fragments/vouchButton.html index dbc76e84..5035c4e3 100644 --- a/appview/pages/templates/user/fragments/vouchButton.html +++ b/appview/pages/templates/user/fragments/vouchButton.html @@ -11,7 +11,7 @@ {{ $userDid := "" }} {{ with .VouchRelationship }} - {{ $userDid = .SubjectDid }} + {{ $userDid = .SubjectDid.String }} {{ end }}