From 5b431767b66fda7f0516d51982c111ccc6c4ef6a Mon Sep 17 00:00:00 2001 From: Aspectis <tobias@aspectis.net> Date: Mon, 22 Feb 2021 19:36:42 +0100 Subject: [PATCH] refs #19066 [fid_bbi] style RVK button and list * Add toggle icon * Add list background --- themes/fid_bbi/scss/util/hacks.scss | 12 +++++ .../DefaultRecord/data-rvkNotation.phtml | 50 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-rvkNotation.phtml diff --git a/themes/fid_bbi/scss/util/hacks.scss b/themes/fid_bbi/scss/util/hacks.scss index a39ee73178e..6a457bea45d 100644 --- a/themes/fid_bbi/scss/util/hacks.scss +++ b/themes/fid_bbi/scss/util/hacks.scss @@ -100,6 +100,18 @@ a.active { } } +// data-rvkNotation +.link-with-icon[aria-expanded=true] { + > .icon { + transform: rotate(180deg) + } +} + +.collapse.notation { + background: $shade-weak; + padding: g(.25); +} + // Togglable item list inside form #itemhide { width: 100%; diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-rvkNotation.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-rvkNotation.phtml new file mode 100644 index 00000000000..11443d8cb50 --- /dev/null +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-rvkNotation.phtml @@ -0,0 +1,50 @@ +<!-- fid_bbi: RecordDriver - DefaultRecord - data-rvkNotation --> +<?php +/** + * Copied from finc/RecordDriver/DefaultRecord/data-rvkNotation.phtml + * + * Changes specific to FID BBI: + * - Add icon to toggle link and change + * - Add separator + * - Improve HTML + * + * @author: Tobias Schäfer <ts@aspectis.net> + */ +?> + +<?php // partial copied from themes/finc/templates/RecordTab/topics.phtml ?> +<?php $i = 0; ?> +<?php foreach ($data as $item): ?> + <?php // no linebreak after last item ?> + <?=$i > 0 ? '<br>' : ''?> + + <span> + <a href="<?=$this->record($this->driver)->getLink('rvk', $item['rvk'])?>"> + <?=$item['rvk']?> + </a> + </span> + + <?php if (isset($item['name'])): ?> + | + <a + class="toggle link-with-icon" + role="button" + data-toggle="collapse" + href="#collapse_rvk_<?=$i?>" + aria-expanded="false" + aria-controls="collapse_rvk_<?=$i?>" + > + <?=$this->icon('small/chevron-down')?> + <?=$item['name']?> + </a> + <?php endif; ?> + + <?php if (isset($item['level']) && is_array($item['level'])): ?> + <div id="collapse_rvk_<?=$i?>" class="collapse notation"> + <?=$this->render('Helpers/nestedList.phtml', ['array' => $item['level']])?> + </div> + <?php endif; ?> + + <?php $i++; ?> +<?php endforeach; ?> +<!-- fid_bbi: RecordDriver - DefaultRecord - data-rvkNotation - END --> -- GitLab