blog-category.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {{template "header.html" .}}
  2. <div class="card mb-4">
  3. <div class="post">
  4. <div class="card-body">
  5. <b>Category author:</b> {{$.Data.Blog.Category.User.FirstName}} {{$.Data.Blog.Category.User.LastName}}
  6. </div>
  7. </div>
  8. </div>
  9. <div class="card mb-4">
  10. {{if $.Data.Blog.HavePosts}}
  11. {{range $.Data.Blog.Posts}}
  12. <div class="post">
  13. <div class="card-body">
  14. <h2 class="card-title">
  15. <a href="{{.Permalink}}">
  16. {{.Name}}
  17. </a>
  18. </h2>
  19. <div class="post-content">
  20. {{.Briefly}}
  21. </div>
  22. <div class="post-date">
  23. <div><small>Published on {{.DateTimeFormat "02/01/2006, 15:04:05"}}</small></div>
  24. <div>Author: {{.User.FirstName}} {{.User.LastName}}</div>
  25. </div>
  26. </div>
  27. </div>
  28. {{end}}
  29. {{else}}
  30. <div class="card-body">
  31. Sorry, no posts matched your criteria
  32. </div>
  33. {{end}}
  34. </div>
  35. {{if $.Data.Blog.HavePosts}}
  36. {{if gt $.Data.Blog.PostsMaxPage 1 }}
  37. <nav>
  38. <ul class="pagination mb-4">
  39. {{if $.Data.Blog.PaginationPrev}}
  40. <li class="page-item{{if $.Data.Blog.PaginationPrev.Current}} disabled{{end}}">
  41. <a class="page-link" href="{{$.Data.Blog.PaginationPrev.Link}}">Previous</a>
  42. </li>
  43. {{end}}
  44. {{range $.Data.Blog.Pagination}}
  45. <li class="page-item{{if .Current}} active{{end}}">
  46. <a class="page-link" href="{{.Link}}">{{.Num}}</a>
  47. </li>
  48. {{end}}
  49. {{if $.Data.Blog.PaginationNext}}
  50. <li class="page-item{{if $.Data.Blog.PaginationNext.Current}} disabled{{end}}">
  51. <a class="page-link" href="{{$.Data.Blog.PaginationNext.Link}}">Next</a>
  52. </li>
  53. {{end}}
  54. </ul>
  55. </nav>
  56. {{end}}
  57. {{end}}
  58. {{template "footer.html" .}}