diff --git a/themes/fid_bbi/scss/blocks/icon.scss b/themes/fid_bbi/scss/blocks/icon.scss index 4e4eb2943c9b880f1f9dcdf278b839fd1ac1d8c4..5b72e9356a88c9c9c7fc81783e10ebac7285aa8d 100644 --- a/themes/fid_bbi/scss/blocks/icon.scss +++ b/themes/fid_bbi/scss/blocks/icon.scss @@ -32,14 +32,17 @@ .link-with-icon { margin-left: g(1.25); + position: relative; - // Make icon clickable + // Make icon and gap clickable &::before { content: ''; display: block; height: g(); + left: 0; margin-left: g(-1.25); position: absolute; + top: 0; width: g(1.25); } diff --git a/themes/fid_bbi/scss/blocks/rvk.scss b/themes/fid_bbi/scss/blocks/rvk.scss new file mode 100644 index 0000000000000000000000000000000000000000..6726d031a2205e1f074b5c85ee4b664dee6deed3 --- /dev/null +++ b/themes/fid_bbi/scss/blocks/rvk.scss @@ -0,0 +1,38 @@ +.rvk_code { + background: $link-color; + color: $white; + display: inline-block; + font-size: $font-size-small; + font-weight: bold; + line-height: g(.75); + margin-right: g(.5); + margin-top: g(.25 / 2); + min-width: g(3); // Fit "AB 12345" + padding: 0 g(.25); + + @include hover { + background: $link-hover-color; + color: #fff; + } +} + +.rvk_label { + margin: 0 0 g(.5); + + @media #{$bp1} { + align-items: flex-start; + display: flex; + margin: 0; + } +} + +.rvk_notation { + background: $shade-weak; + height: auto !important; // override height set by JS + margin: 0 0 g(.75); + padding: g(.25); + + @media #{$bp1} { + margin-top: g(.25); + } +} diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss index d10da652ae1b94b4925cc8d2bd4f6b1da77dc63d..bcb864fe8fe34d97f357d963e6d4c1d33c3900a5 100644 --- a/themes/fid_bbi/scss/compiled.scss +++ b/themes/fid_bbi/scss/compiled.scss @@ -46,6 +46,7 @@ @import 'blocks/record'; @import 'blocks/result'; @import 'blocks/results'; +@import 'blocks/rvk'; @import 'blocks/search'; @import 'blocks/sidebar'; @import 'blocks/sources-list'; diff --git a/themes/fid_bbi/scss/util/hacks.scss b/themes/fid_bbi/scss/util/hacks.scss index 401440ebf73c9eec2ccf80659e9aaa0e92147077..e7f54e9d7929f689a92a4a4ba485a44ed4f38025 100644 --- a/themes/fid_bbi/scss/util/hacks.scss +++ b/themes/fid_bbi/scss/util/hacks.scss @@ -107,11 +107,6 @@ a.active { } } -.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 index c18e73db45fd92a1fc2776cb74592f4caaa49f18..f8683ccad936274f2021214dc7d382a06f070b0b 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-rvkNotation.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-rvkNotation.phtml @@ -13,37 +13,34 @@ ?> <?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 foreach ($data as $index => $item): ?> + <div class="rvk_label"> + <div> + <a class="rvk_code" href="<?=$this->record($this->driver)->getLink('rvk', $item['rvk'])?>"> + <?=$item['rvk']?> + </a> + </div> - <?php if (isset($item['name'])): ?> - | - <a - class="toggle link-with-icon" - role="button" - data-toggle="collapse" - href="#collapse_rvk_<?=$i?>" - aria-expanded="false" - > - <?=$this->icon('small/chevron-down')?> - <?=$item['name']?> - </a> - <?php endif; ?> + <?php if (isset($item['name'])): ?> + <div> + <a + class="toggle link-with-icon" + role="button" + data-toggle="collapse" + href="#collapse_rvk_<?=$index?>" + aria-expanded="false" + > + <?=$this->icon('small/chevron-down')?> + <?=$item['name']?> + </a> + </div> + <?php endif; ?> + </div> <?php if (isset($item['level']) && is_array($item['level'])): ?> - <div id="collapse_rvk_<?=$i?>" class="collapse notation"> + <div id="collapse_rvk_<?=$index?>" class="collapse notation rvk_notation"> <?=$this->render('Helpers/nestedList.phtml', ['array' => $item['level']])?> </div> <?php endif; ?> - - <?php $i++; ?> <?php endforeach; ?> <!-- fid_bbi: RecordDriver - DefaultRecord - data-rvkNotation - END -->