diff --git a/themes/fid_bbi/scss/util/hacks.scss b/themes/fid_bbi/scss/util/hacks.scss index a39ee73178e23c1588b9a3d5609d314a2e2ddee5..6a457bea45db37e5334375940531f34c9c4a2d23 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 0000000000000000000000000000000000000000..11443d8cb50c3f7e2a1703190121966be3359442 --- /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 -->