diff --git a/appview/pages/pages.go b/appview/pages/pages.go
index f5818e63..688e8bb0 100644
--- a/appview/pages/pages.go
+++ b/appview/pages/pages.go
@@ -1612,6 +1612,9 @@ type SingleStringParams struct {
IsStarred bool
StarCount int
Owner identity.Identity
+ CommentList []models.CommentListItem
+
+ VouchRelationships map[syntax.DID]*models.VouchRelationship
}
func (p *Pages) SingleString(w io.Writer, params SingleStringParams) error {
diff --git a/appview/pages/templates/strings/string.html b/appview/pages/templates/strings/string.html
index f0fd65f1..9115d4b5 100644
--- a/appview/pages/templates/strings/string.html
+++ b/appview/pages/templates/strings/string.html
@@ -94,4 +94,62 @@
{{ template "fragments/multiline-select" }}
+
+ {{
+ template "fragments/comment/commentList"
+ (dict
+ "LoggedInUser" .LoggedInUser
+ "VouchRelationships" .VouchRelationships
+ "CommentList" .CommentList)
+ }}
+ {{ template "newComment" . }}
+
+{{ end }}
+
+{{ define "newComment" }}
+ {{ if .LoggedInUser }}
+
+ {{ else }}
+
+ {{ end }}
{{ end }}
diff --git a/appview/strings/strings.go b/appview/strings/strings.go
index 53b418b9..746dd619 100644
--- a/appview/strings/strings.go
+++ b/appview/strings/strings.go
@@ -156,7 +156,24 @@ func (s *Strings) contents(w http.ResponseWriter, r *http.Request) {
isStarred = db.GetStarStatus(s.Db, user.Did, string.AtUri())
}
- s.Pages.SingleString(w, pages.SingleStringParams{
+ comments, err := db.GetComments(s.Db, orm.FilterEq("subject_uri", string.AtUri()))
+ if err != nil {
+ l.Error("failed to get comments", "err", err)
+ }
+
+ vouchRelationships := make(map[syntax.DID]*models.VouchRelationship)
+ if user != nil {
+ var participants []syntax.DID
+ for _, c := range comments {
+ participants = append(participants, c.Did)
+ }
+ vouchRelationships, err = db.GetVouchRelationshipsBatch(s.Db, syntax.DID(user.Did), participants)
+ if err != nil {
+ l.Error("failed to fetch vouch relationships", "err", err)
+ }
+ }
+
+ err = s.Pages.SingleString(w, pages.SingleStringParams{
LoggedInUser: user,
RenderToggle: renderToggle,
ShowRendered: showRendered,
@@ -165,6 +182,9 @@ func (s *Strings) contents(w http.ResponseWriter, r *http.Request) {
IsStarred: isStarred,
StarCount: starCount,
Owner: id,
+ CommentList: models.NewCommentList(comments),
+
+ VouchRelationships: vouchRelationships,
})
}