From c7afc805ec7042e9de4014d47f374b554faafa54 Mon Sep 17 00:00:00 2001 From: "fanky.eu" <jakub.webisti@gmail.com> Date: Sun, 4 Apr 2021 13:26:38 +0200 Subject: [PATCH] Added collapsible candidate table organism, added candidate listing template --- .../candidate-table-collapsible.mustache | 41 +++++++++++++++++++ .../03-templates/candidate-listing.mustache | 16 ++++++++ 2 files changed, 57 insertions(+) create mode 100644 source/_patterns/02-organisms/01-candidates/candidate-table-collapsible.mustache create mode 100644 source/_patterns/03-templates/candidate-listing.mustache diff --git a/source/_patterns/02-organisms/01-candidates/candidate-table-collapsible.mustache b/source/_patterns/02-organisms/01-candidates/candidate-table-collapsible.mustache new file mode 100644 index 0000000..d35fcdf --- /dev/null +++ b/source/_patterns/02-organisms/01-candidates/candidate-table-collapsible.mustache @@ -0,0 +1,41 @@ +<div class="candidate-table container-padding--zero lg:container-padding--auto"> + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + <div class="candidates-list-collapsing-part transition-all duration-1000 max-h-0 overflow-hidden"> + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + {{> molecules-candidate-table-row }} + </div> +</div> +<div class="pt-11 text-center"> + {{> atoms-icon-button(icon: "ico--chevron-right", classes: "showfulltable text-lg", bodyClasses: "py-4 px-11 leading-5" ) }} +</div> +<script> + //collapse toggle + //assumes only one present on page + var anchorShowFull = document.getElementsByClassName('showfulltable'); + + if(anchorShowFull !== null) { + + for (var i = 0; i < anchorShowFull.length; i++) { + anchorShowFull[i].addEventListener('click', function(e){ + e.preventDefault(); + var candidatestable = document.getElementsByClassName("candidate-table"); + //if fadeout + //candidatestable[0].classList.remove("candidate-table--fadeout"); + var collapsepart = document.getElementsByClassName("candidates-list-collapsing-part"); + collapsepart[0].style.maxHeight=collapsepart[0].scrollHeight + "px"; + this.remove(); + }); + } + } +</script> \ No newline at end of file diff --git a/source/_patterns/03-templates/candidate-listing.mustache b/source/_patterns/03-templates/candidate-listing.mustache new file mode 100644 index 0000000..b6370d6 --- /dev/null +++ b/source/_patterns/03-templates/candidate-listing.mustache @@ -0,0 +1,16 @@ +{{> organisms-header }} + +<div class="container container--default py-8 lg:py-24"> + <section class="text-center"> + <h1 class="head-alt-md mb-8">Výpis kandidátů</h1> + + <main> + {{> organisms-candidate-card-list }} + + {{> organisms-candidate-table-collapsible }} + + </main> + </section> +</div> + +{{> organisms-footer }} -- GitLab