publication.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {{- define "main" -}}
  2. {{ partial "page_header.html" . }}
  3. <div class="universal-wrapper">
  4. <div class="row">
  5. <div class="col-lg-12">
  6. {{ with .Content }}
  7. <div class="article-style">{{ . }}</div>
  8. {{ end }}
  9. {{/* Array of distinct years. */}}
  10. {{ range .Pages.ByDate.Reverse }}
  11. {{ $year := print (.Date.Format "2006") }}
  12. {{ $.Scratch.SetInMap "years" $year $year }}
  13. {{ end }}
  14. <div class="form-row mb-4">
  15. <div class="col-auto">
  16. <input type="search" class="filter-search" placeholder="{{ i18n "search_placeholder" }}" autocapitalize="off"
  17. autocomplete="off" autocorrect="off" role="textbox" spellcheck="false">
  18. </div>
  19. <div class="col-auto">
  20. <select class="pub-filters pubtype-select form-control form-control-sm" data-filter-group="pubtype">
  21. <option value="*">{{ i18n "publication_type" }}</option>
  22. {{ $pub_types := partial "functions/get_pub_types" $ }}
  23. {{ range $index, $taxonomy := site.Taxonomies.publication_types }}
  24. <option value=".pubtype-{{ (int $index) }}">
  25. {{ index $pub_types (int $index) }}
  26. </option>
  27. {{ end }}
  28. </select>
  29. </div>
  30. <div class="col-auto">
  31. <select class="pub-filters form-control form-control-sm" data-filter-group="year">
  32. <option value="*">{{ i18n "date" }}</option>
  33. {{ $years_sorted := $.Scratch.GetSortedMapValues "years" }}
  34. {{ if $years_sorted }}
  35. {{ range $year := sort $years_sorted "" "desc" }}
  36. <option value=".year-{{ $year }}">
  37. {{ $year }}
  38. </option>
  39. {{ end }}
  40. {{ end }}
  41. </select>
  42. </div>
  43. </div>
  44. <div id="container-publications">
  45. {{ range .Pages.ByDate.Reverse }}
  46. {{ if .Params.publication_types }}
  47. {{ $.Scratch.Set "pubtype" (index .Params.publication_types 0) }}
  48. {{ else }}
  49. {{ $.Scratch.Set "pubtype" 0 }}
  50. {{ end }}
  51. <div class="grid-sizer col-lg-12 isotope-item pubtype-{{ $.Scratch.Get "pubtype" }} year-{{ .Date.Format "2006" }}">
  52. {{ if eq $.Params.view 1 }}
  53. {{ partial "li_list" . }}
  54. {{ else if eq $.Params.view 3 }}
  55. {{ partial "li_card" . }}
  56. {{ else if eq $.Params.view 4 }}
  57. {{ partial "li_citation" . }}
  58. {{ else }}
  59. {{ partial "li_compact" . }}
  60. {{ end }}
  61. </div>
  62. {{ end }}
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. {{- end -}}