fix(bug-list): fix meta display, mv comment count

Amolith created

References: bug-3a06724

Change summary

pkg/web/templates/bugs.html | 10 ++++++----
pkg/web/webui_bugs.go       |  2 ++
2 files changed, 8 insertions(+), 4 deletions(-)

Detailed changes

pkg/web/templates/bugs.html 🔗

@@ -18,15 +18,17 @@
       {{.Title}}
       <span class="badge badge-{{.Status}}">{{.Status}}</span>
     </h3>
-    <p>
+    <footer>
       by <strong>{{.Author}}</strong> on
       <time datetime="{{.CreatedAt | rfc3339}}">{{.CreatedAt | formatDate}}</time>
+      {{if gt .CommentCount 0}}
+      • {{.CommentCount}} Comments
+      {{end}}
+      {{if .HasActivity}}
       • Last activity:
       <time datetime="{{.LastActivity | rfc3339}}">{{.LastActivity | formatDate}}</time>
-      {{if gt .CommentCount 0}}
-      • {{.CommentCount}} comment{{if ne .CommentCount 1}}s{{end}}
       {{end}}
-    </p>
+    </footer>
   </article>
   {{end}}
 

pkg/web/webui_bugs.go 🔗

@@ -46,6 +46,7 @@ type BugListItem struct {
 	Status       string
 	CreatedAt    time.Time
 	LastActivity time.Time
+	HasActivity  bool
 	CommentCount int
 }
 
@@ -139,6 +140,7 @@ func getBugsList(rc *cache.RepoCache, status string) ([]BugListItem, error) {
 			Status:       snap.Status.String(),
 			CreatedAt:    snap.CreateTime,
 			LastActivity: getLastActivity(snap),
+			HasActivity:  len(snap.Timeline) > 1,
 			CommentCount: countComments(snap),
 		})
 	}