diff --git a/appview/pages/pages.go b/appview/pages/pages.go
index c31b5307..6aa7f3f2 100644
--- a/appview/pages/pages.go
+++ b/appview/pages/pages.go
@@ -1629,6 +1629,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 42046afb..12fc400b 100644
--- a/appview/strings/strings.go
+++ b/appview/strings/strings.go
@@ -157,7 +157,24 @@ func (s *Strings) contents(w http.ResponseWriter, r *http.Request) {
isStarred = db.GetStarStatus(s.Db, user.Did, stringUri)
}
- 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,
@@ -166,6 +183,9 @@ func (s *Strings) contents(w http.ResponseWriter, r *http.Request) {
IsStarred: isStarred,
StarCount: starCount,
Owner: id,
+ CommentList: models.NewCommentList(comments),
+
+ VouchRelationships: vouchRelationships,
})
}