package blog import ( "gobeyhan/database/models" "fmt" ) templ List(posts []models.Post) { @Layout("Blog Posts") {
| ID | Title | Categories | Status | Created | Actions |
|---|---|---|---|---|---|
| { fmt.Sprintf("%d", post.ID) } |
{ post.Title }
|
if len(post.Categories) > 0 { for i, cat := range post.Categories { if i > 0 { , } { cat.Title } } } else { - } | if post.IsActive { Active } else { Inactive } if post.IsFront { Front } | { post.CreatedAt.Format("2006-01-02") } | Edit |