diff --git a/appview/models/pull.go b/appview/models/pull.go
index 28397911..4a2e0ee7 100644
--- a/appview/models/pull.go
+++ b/appview/models/pull.go
@@ -171,23 +171,13 @@ func (p *PullComment) AtUri() syntax.ATURI {
return syntax.ATURI(p.CommentAt)
}
-// func (p *PullComment) AsRecord() tangled.RepoPullComment {
-// mentions := make([]string, len(p.Mentions))
-// for i, did := range p.Mentions {
-// mentions[i] = string(did)
-// }
-// references := make([]string, len(p.References))
-// for i, uri := range p.References {
-// references[i] = string(uri)
-// }
-// return tangled.RepoPullComment{
-// Pull: p.PullAt,
-// Body: p.Body,
-// Mentions: mentions,
-// References: references,
-// CreatedAt: p.Created.Format(time.RFC3339),
-// }
-// }
+func (p *Pull) TotalComments() int {
+ total := 0
+ for _, s := range p.Submissions {
+ total += len(s.Comments)
+ }
+ return total
+}
func (p *Pull) LastRoundNumber() int {
return len(p.Submissions) - 1
diff --git a/appview/pages/templates/repo/pulls/fragments/summarizedPullHeader.html b/appview/pages/templates/repo/pulls/fragments/summarizedPullHeader.html
index f8f521b0..e891c361 100644
--- a/appview/pages/templates/repo/pulls/fragments/summarizedPullHeader.html
+++ b/appview/pages/templates/repo/pulls/fragments/summarizedPullHeader.html
@@ -15,10 +15,9 @@
{{ $latestRound := .LastRoundNumber }}
- {{ $lastSubmission := index .Submissions $latestRound }}
- {{ $commentCount := len $lastSubmission.Comments }}
+ {{ $commentCount := .TotalComments }}
{{ if and $pipeline $pipeline.Id }}
- {{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }}
+ {{ template "repo/pipelines/fragments/pipelineSymbol" (dict "Pipeline" $pipeline "ShortSummary" true) }}
{{ end }}
diff --git a/appview/pages/templates/repo/pulls/pulls.html b/appview/pages/templates/repo/pulls/pulls.html
index c9dbf368..02f58206 100644
--- a/appview/pages/templates/repo/pulls/pulls.html
+++ b/appview/pages/templates/repo/pulls/pulls.html
@@ -112,18 +112,9 @@
{{ template "repo/fragments/time" .Created }}
-
- {{ $latestRound := .LastRoundNumber }}
- {{ $lastSubmission := index .Submissions $latestRound }}
-
- {{ $commentCount := len $lastSubmission.Comments }}
- {{ $s := "s" }}
- {{ if eq $commentCount 1 }}
- {{ $s = "" }}
- {{ end }}
-
- {{ len $lastSubmission.Comments}} comment{{$s}}
+ {{ $commentCount := .TotalComments }}
+ {{ $commentCount }} comment{{ if ne $commentCount 1 }}s{{ end }}
@@ -136,7 +127,7 @@
{{ $pipeline := index $.Pipelines .LatestSha }}
{{ if and $pipeline $pipeline.Id }}
- {{ template "repo/pipelines/fragments/pipelineSymbol" $pipeline }}
+ {{ template "repo/pipelines/fragments/pipelineSymbol" (dict "Pipeline" $pipeline "ShortSummary" true) }}
{{ end }}
{{ $state := .Labels }}