categories.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {{ define "title"}}{{ t "Categories" }} ({{ .total }}){{ end }}
  2. {{ define "content"}}
  3. <section class="page-header">
  4. <h1>{{ t "Categories" }} ({{ .total }})</h1>
  5. <ul>
  6. <li>
  7. <a href="{{ route "createCategory" }}">{{ t "Create a category" }}</a>
  8. </li>
  9. </ul>
  10. </section>
  11. {{ if not .categories }}
  12. <p class="alert alert-error">{{ t "There is no category." }}</p>
  13. {{ else }}
  14. <div class="items">
  15. {{ range .categories }}
  16. <article class="item">
  17. <div class="item-header">
  18. <span class="item-title">
  19. <a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ .Title }}</a>
  20. </span>
  21. </div>
  22. <div class="item-meta">
  23. <ul>
  24. <li>
  25. {{ if eq .FeedCount 0 }}
  26. {{ t "No feed." }}
  27. {{ else }}
  28. {{ plural "plural.categories.feed_count" .FeedCount .FeedCount }}
  29. {{ end }}
  30. </li>
  31. </ul>
  32. <ul>
  33. <li>
  34. <a href="{{ route "editCategory" "categoryID" .ID }}">{{ t "Edit" }}</a>
  35. </li>
  36. {{ if eq .FeedCount 0 }}
  37. <li>
  38. <a href="#"
  39. data-confirm="true"
  40. data-label-question="{{ t "Are you sure?" }}"
  41. data-label-yes="{{ t "yes" }}"
  42. data-label-no="{{ t "no" }}"
  43. data-label-loading="{{ t "Work in progress..." }}"
  44. data-url="{{ route "removeCategory" "categoryID" .ID }}">{{ t "Remove" }}</a>
  45. </li>
  46. {{ end }}
  47. </ul>
  48. </div>
  49. </article>
  50. {{ end }}
  51. </div>
  52. {{ end }}
  53. {{ end }}