2019-11-04 13:09:44 +00:00
|
|
|
{{ define "main" }}
|
2019-12-08 14:29:02 +00:00
|
|
|
|
2020-01-23 17:46:03 +00:00
|
|
|
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
|
2020-01-20 16:20:43 +00:00
|
|
|
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq .Site.Params.sidebarPosition "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
|
|
|
|
{{ partial "body/breadcrumb" . }}
|
2019-11-04 13:09:44 +00:00
|
|
|
<header class="list__header">
|
2020-01-09 05:25:02 +00:00
|
|
|
<h5 class="list__header--title capitalize h5">{{.Title}}</h5>
|
2019-11-04 13:09:44 +00:00
|
|
|
</header>
|
2019-11-29 09:01:11 +00:00
|
|
|
|
2019-11-04 13:09:44 +00:00
|
|
|
<div class="list__header--desc p2">
|
2019-11-29 09:01:11 +00:00
|
|
|
{{ .Content }}
|
2019-11-04 13:09:44 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="summary__container">
|
2019-11-30 17:28:55 +00:00
|
|
|
{{ $paginator := .Paginate (where .Pages "Type" .Type) }}
|
2019-11-04 13:09:44 +00:00
|
|
|
{{ range $paginator.Pages }}
|
2019-11-30 17:28:55 +00:00
|
|
|
{{ .Render "summary" }}
|
2019-11-04 13:09:44 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ partial "pagination/pagination" . }}
|
|
|
|
</div>
|
2019-11-04 13:09:44 +00:00
|
|
|
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ if $.Param "enableSidebar" }}
|
2020-01-28 04:37:42 +00:00
|
|
|
<aside class="list__sidebar {{ if eq .Site.Params.sidebarPosition "left" }}l{{ else }}r{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ partial "sidebar/sidebar-list" . }}
|
|
|
|
</aside>
|
|
|
|
{{ end }}
|
2019-11-04 13:09:44 +00:00
|
|
|
</main>
|
2019-11-12 10:03:15 +00:00
|
|
|
|
2019-12-08 14:29:02 +00:00
|
|
|
<script>
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ $sidebarPosition:= .Site.Params.sidebarPosition }}
|
|
|
|
var sidebarPosition = JSON.parse({{ $sidebarPosition | jsonify }});
|
2020-01-23 13:00:38 +00:00
|
|
|
{{ $enableSidebar:= .Site.Params.enableSidebar }}
|
|
|
|
var enableSidebar = JSON.parse({{ $enableSidebar | jsonify }});
|
|
|
|
|
2020-01-20 16:20:43 +00:00
|
|
|
var listMainElem = document.querySelector('.list__main');
|
|
|
|
var listSideElem = document.querySelector('.list__sidebar');
|
|
|
|
|
|
|
|
var gridSmall = 'l';
|
|
|
|
var gridBig = 'mr';
|
|
|
|
var gridFull = 'lmr'
|
|
|
|
|
|
|
|
if (sidebarPosition === "right") {
|
|
|
|
gridSmall = 'r';
|
|
|
|
gridBig = 'lm'
|
|
|
|
}
|
2019-12-08 14:29:02 +00:00
|
|
|
enquire.register("screen and (max-width: 769px)", {
|
|
|
|
match: function () {
|
2020-01-23 13:00:38 +00:00
|
|
|
if (enableSidebar) {
|
|
|
|
listMainElem.classList.remove(gridBig);
|
|
|
|
listMainElem.classList.add(gridFull);
|
|
|
|
listSideElem.classList.remove(gridSmall);
|
|
|
|
listSideElem.classList.add('hide');
|
|
|
|
} else {
|
|
|
|
if (listMainElem && !listMainElem.classList.contains(gridFull)) {
|
|
|
|
listMainElem.classList.remove(gridBig);
|
|
|
|
listMainElem.classList.add(gridFull);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listSideElem && !listSideElem.classList.contains('hide')) {
|
|
|
|
listSideElem.classList.add('hide');
|
|
|
|
}
|
|
|
|
}
|
2019-12-08 14:29:02 +00:00
|
|
|
},
|
|
|
|
unmatch: function () {
|
2020-01-23 13:00:38 +00:00
|
|
|
if (enableSidebar) {
|
|
|
|
listMainElem.classList.remove(gridFull);
|
|
|
|
listMainElem.classList.add(gridBig);
|
|
|
|
listSideElem.classList.add(gridSmall);
|
|
|
|
listSideElem.classList.remove('hide');
|
|
|
|
} else {
|
|
|
|
if (listMainElem && !listMainElem.classList.contains(gridFull)) {
|
|
|
|
listMainElem.classList.remove(gridBig);
|
|
|
|
listMainElem.classList.add(gridFull);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listSideElem && !listSideElem.classList.contains('hide')) {
|
|
|
|
listSideElem.classList.add('hide');
|
|
|
|
}
|
|
|
|
}
|
2020-01-20 16:20:43 +00:00
|
|
|
|
2019-12-08 14:29:02 +00:00
|
|
|
document.getElementsByClassName('navbar__burger')[0].classList.remove('is-active');
|
|
|
|
document.getElementsByClassName('navbar__menu')[0].classList.remove('is-active');
|
|
|
|
document.getElementsByClassName('mobile-search')[0].classList.add('hide');
|
|
|
|
},
|
|
|
|
setup: function () { },
|
|
|
|
deferSetup: true,
|
|
|
|
destroy: function () { },
|
|
|
|
});
|
|
|
|
</script>
|
2019-11-24 14:31:28 +00:00
|
|
|
{{ partial "script/list-script" . }}
|
2019-11-04 13:09:44 +00:00
|
|
|
{{ end }}
|