publication.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 form-control form-control-sm" 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 $index, $item := .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. {{ partial "functions/render_view" (dict "page" $ "item" . "view" ($.Params.view | default "compact") "index" $index) }}
  53. </div>
  54. {{ end }}
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. {{- end -}}