lumbung.space/themes/lumbung-theme/layouts/partials/filter-nav.html

91 lines
7.2 KiB
HTML

<div class="filter" id="filter">
<div class="filter-link" id="filter-link"><svg class="filter-icon" enable-background="new 0 0 510.2 512" version="1.1" viewBox="0 0 510.2 512" xmlns="http://www.w3.org/2000/svg"><path d="m499.1 0c2.8 2.2 6.2 4 8.3 6.8 4.4 5.8 3.5 12.6-1.9 19.2-15.7 19.4-31.5 38.8-47.3 58.2-41.2 50.8-82.5 101.6-123.8 152.4-2 2.4-3.9 3.4-7.1 3.4-48.2-0.1-96.3-0.1-144.5 0-3.2 0-5.1-1-7.1-3.4-56.4-69.6-112.9-139.1-169.4-208.7-9.7-11.9-8.3-20.3 4.8-27.9h488z"/><path d="m206.1 512c-8.7-4-11.2-10.8-11.1-20.2 0.3-71.8 0.1-143.6 0.1-215.4v-6.2h120v5.5c0 57.6-0.1 115.3 0.1 172.9 0 8.7-3.3 14.4-11.1 18.2-29.9 14.6-59.6 29.6-89.4 44.4-0.3 0.1-0.4 0.5-0.6 0.7-2.7 0.1-5.3 0.1-8 0.1z"/></svg><span>filter</span></div>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $sections := .Site.Params.mainSections }}
{{ $tags := $.Site.Taxonomies.tags.ByCount }}
{{ $.Scratch.Set "untagged" 0 }}
{{ range $pages }}
{{ with .Params.tags }}{{ else }}{{ $.Scratch.Add "untagged" 1 }}{{ end }}
{{ end }}
<div class="filter-container">
<div class="filter-information">
<div><span id="selectedItemCount"></span> Cards</div>
<div id="load-more">load more cards</div>
</div>
<div class="filter-buttons-container">
<div class="filter-buttons">
<button class="filter-by">
by sections
</button>
<div class="filter-buttons-dropdown">
{{ range $sections }}
<button xx class="sect-button filter-button" id="sect-{{ . | urlize }}" onclick="htf.checkFilter('{{ . | urlize }}', 'sect-')"><svg enable-background="new 0 0 14.9 14.9" version="1.1" viewBox="-2 -2 18.9 18.9" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m11.8 1.9c-0.8-1.2-2.1-1.8-3.8-1.6-0.8-0.3-1.6-0.4-2.4-0.1-2.3 0.8-3.9 2.4-5 4.5-1.4 2.6-0.5 6.8 2.4 8.1h0.1c0.2 0.2 0.5 0.3 0.8 0.4 0.4 0.6 0.9 1.1 1.6 1.3 1.9 0.7 4.1 0.1 5.5-1.2 0.9-0.6 1.6-1.4 2-2.4 1-0.9 1.6-2.2 1.8-3.5 0.3-2.2-0.7-4.7-3-5.5z"/></svg> <span class="filter-title">{{ . | title }}</span> <span id="ssect-{{ . | urlize }}"></span>
</button>
{{ end }}
<button xx id="selectAllSections" class="filter-all" onclick="htf.showAll('section')">
All Sections
</button>
</div>
</div>
<div class="filter-buttons">
<button class="filter-by">
by contributors
</button>
<div class="filter-buttons-dropdown">
{{ range .Site.Taxonomies.contributors }}
<button xx class="cont-button filter-button" id="cont-{{ .Page.Title | replaceRE "[.]" "_" | urlize }}" onclick="htf.checkFilter('{{ .Page.Title | replaceRE "[.]" "_" | urlize }}', 'cont-')"><svg enable-background="new 0 0 14.9 14.9" version="1.1" viewBox="-2 -2 18.9 18.9" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m11.8 1.9c-0.8-1.2-2.1-1.8-3.8-1.6-0.8-0.3-1.6-0.4-2.4-0.1-2.3 0.8-3.9 2.4-5 4.5-1.4 2.6-0.5 6.8 2.4 8.1h0.1c0.2 0.2 0.5 0.3 0.8 0.4 0.4 0.6 0.9 1.1 1.6 1.3 1.9 0.7 4.1 0.1 5.5-1.2 0.9-0.6 1.6-1.4 2-2.4 1-0.9 1.6-2.2 1.8-3.5 0.3-2.2-0.7-4.7-3-5.5z"/></svg> <span class="filter-title">{{ .Page.Title }}</span> <span id="scont-{{ .Page.Title | replaceRE "[.]" "_" | urlize }}"></span>
</button>
{{ end }}
<button xx class="cont-button filter-button" id="cont-no-contributor" onclick="htf.checkFilter('no-contributor', 'cont-')"><svg enable-background="new 0 0 14.9 14.9" version="1.1" viewBox="-2 -2 18.9 18.9" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m11.8 1.9c-0.8-1.2-2.1-1.8-3.8-1.6-0.8-0.3-1.6-0.4-2.4-0.1-2.3 0.8-3.9 2.4-5 4.5-1.4 2.6-0.5 6.8 2.4 8.1h0.1c0.2 0.2 0.5 0.3 0.8 0.4 0.4 0.6 0.9 1.1 1.6 1.3 1.9 0.7 4.1 0.1 5.5-1.2 0.9-0.6 1.6-1.4 2-2.4 1-0.9 1.6-2.2 1.8-3.5 0.3-2.2-0.7-4.7-3-5.5z"/></svg> <span class="filter-title">No contributors</span><span id="scont-no-contributor"></span>
</button>
<button xx id="selectAllContributors" class="filter-all" onclick="htf.showAll('contributors')">
All contributors
</button>
</div>
</div>
<div class="filter-buttons">
<button class="filter-by">
by sources
</button>
<div class="filter-buttons-dropdown">
{{ range .Site.Taxonomies.sources }}
<button xx class="src-button filter-button" id="src-{{ .Page.Title | replaceRE "[.]" "_" | urlize }}" onclick="htf.checkFilter('{{ .Page.Title | replaceRE "[.]" "_" | urlize }}', 'src-')"><svg enable-background="new 0 0 14.9 14.9" version="1.1" viewBox="-2 -2 18.9 18.9" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m11.8 1.9c-0.8-1.2-2.1-1.8-3.8-1.6-0.8-0.3-1.6-0.4-2.4-0.1-2.3 0.8-3.9 2.4-5 4.5-1.4 2.6-0.5 6.8 2.4 8.1h0.1c0.2 0.2 0.5 0.3 0.8 0.4 0.4 0.6 0.9 1.1 1.6 1.3 1.9 0.7 4.1 0.1 5.5-1.2 0.9-0.6 1.6-1.4 2-2.4 1-0.9 1.6-2.2 1.8-3.5 0.3-2.2-0.7-4.7-3-5.5z"/></svg> <span class="filter-title">{{ .Page.Title }}</span> <span id="ssrc-{{ .Page.Title | replaceRE "[.]" "_" | urlize }}"></span>
</button>
{{ end }}
<button xx class="src-button filter-button" id="src-no-sources" onclick="htf.checkFilter('no-sources', 'src-')"><svg enable-background="new 0 0 14.9 14.9" version="1.1" viewBox="-2 -2 18.9 18.9" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m11.8 1.9c-0.8-1.2-2.1-1.8-3.8-1.6-0.8-0.3-1.6-0.4-2.4-0.1-2.3 0.8-3.9 2.4-5 4.5-1.4 2.6-0.5 6.8 2.4 8.1h0.1c0.2 0.2 0.5 0.3 0.8 0.4 0.4 0.6 0.9 1.1 1.6 1.3 1.9 0.7 4.1 0.1 5.5-1.2 0.9-0.6 1.6-1.4 2-2.4 1-0.9 1.6-2.2 1.8-3.5 0.3-2.2-0.7-4.7-3-5.5z"/></svg> <span class="filter-title">No sources</span> <span id="ssrc-no-sources"></span>
</button>
<button xx id="selectAllSources" class="filter-all" onclick="htf.showAll('sources')">
All sources
</button>
</div>
</div>
<div class="filter-buttons">
<button class="filter-by">
by tags
</button>
<div class="filter-buttons-dropdown">
{{ range $tags }}
{{ if .Term }}
<button xx class="tag-button filter-button" id="tag-{{ .Term | replaceRE "[.]" "_" | urlize }}" onclick="htf.checkFilter('{{ .Term | replaceRE "[.]" "_" | urlize }}', 'tag-')"><svg enable-background="new 0 0 14.9 14.9" version="1.1" viewBox="-2 -2 18.9 18.9" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m11.8 1.9c-0.8-1.2-2.1-1.8-3.8-1.6-0.8-0.3-1.6-0.4-2.4-0.1-2.3 0.8-3.9 2.4-5 4.5-1.4 2.6-0.5 6.8 2.4 8.1h0.1c0.2 0.2 0.5 0.3 0.8 0.4 0.4 0.6 0.9 1.1 1.6 1.3 1.9 0.7 4.1 0.1 5.5-1.2 0.9-0.6 1.6-1.4 2-2.4 1-0.9 1.6-2.2 1.8-3.5 0.3-2.2-0.7-4.7-3-5.5z"/></svg> <span class="filter-title">{{.Term | humanize | title }}</span>
<span id="stags-{{ .Term | urlize }}"></span>
</button>
{{ end }}
{{ end }}
<button xx class="tag-button filter-button" id="tag-tfuntagged" onclick="htf.checkFilter('tfuntagged', 'tag-')"><svg enable-background="new 0 0 14.9 14.9" version="1.1" viewBox="-2 -2 18.9 18.9" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m11.8 1.9c-0.8-1.2-2.1-1.8-3.8-1.6-0.8-0.3-1.6-0.4-2.4-0.1-2.3 0.8-3.9 2.4-5 4.5-1.4 2.6-0.5 6.8 2.4 8.1h0.1c0.2 0.2 0.5 0.3 0.8 0.4 0.4 0.6 0.9 1.1 1.6 1.3 1.9 0.7 4.1 0.1 5.5-1.2 0.9-0.6 1.6-1.4 2-2.4 1-0.9 1.6-2.2 1.8-3.5 0.3-2.2-0.7-4.7-3-5.5z"/></svg> <span class="filter-title">Untagged</span> <span id="stags-tfuntagged"></span>
</button>
<button xx id="selectAllTags" class="filter-all" onclick="htf.showAll('tags')">
All Tags
</button>
</div>
</div>
</div>
</div>
</div>