package blog import ( "gobeyhan/database/models" "fmt" ) templ CommentList(items []models.Comment) { @Layout("Blog Comments") {

Comments

for _, comment := range items { }
ID Post Author Comment Status Actions
{ fmt.Sprintf("%d", comment.ID) }
{ comment.Product.Title }
User ID: { fmt.Sprintf("%d", comment.UserID) }
{ comment.Body }
if comment.IsActive { Approved } else { Pending } Edit
} } templ CommentForm(comment *models.Comment, errors map[string]string) { @Layout("Edit Comment") {

Edit Comment

{ fmt.Sprintf("%d", comment.UserID) }

Cancel
} }