diff --git a/app/views/resources/_common/_resource_tree_item.php b/app/views/resources/_common/_resource_tree_item.php index 204aa2e7930aa89fd7cb496545ef46ad44185e24..a3db8665b77f857ad4fc80e028054d9b3053547d 100644 --- a/app/views/resources/_common/_resource_tree_item.php +++ b/app/views/resources/_common/_resource_tree_item.php @@ -1,8 +1,8 @@ <?php -$children = $resource->children; +$children = $resource->children; $has_children = count($children) > 0; ?> -<article class="studip <?= $has_children ? 'toggle' : ''?> <?= $open ? 'open' : ''?>"> +<article class="studip <?= $has_children ? 'toggle' : ((string)$resource->description === '' ? 'empty' : '') ?> <?= $open ? 'open' : '' ?>"> <header> <h1> <a href="#"><?= htmlReady($resource->getFullName()) ?></a> @@ -18,14 +18,16 @@ $has_children = count($children) > 0; 'resources/_common/_resource_tree_item', [ 'resource' => $child, - 'open' => false + 'open' => false ] ) ?> <? endforeach ?> </section> <? else : ?> - <section> - <?= htmlReady($resource->description) ?> - </section> + <? if ((string)$resource->description !== '') : ?> + <section> + <?= htmlReady($resource->description) ?> + </section> + <? endif ?> <? endif ?> </article> diff --git a/resources/assets/stylesheets/scss/article.scss b/resources/assets/stylesheets/scss/article.scss index e9be1580293b6ae1758cc891a483c35d4e40a10f..15c968f77f1a51d9c4ee3babdd46e202845c9d3a 100644 --- a/resources/assets/stylesheets/scss/article.scss +++ b/resources/assets/stylesheets/scss/article.scss @@ -81,6 +81,13 @@ article.studip { } } + &.empty { + > header { + margin-bottom: 0; + } + padding-bottom: 0; + } + &.toggle { > header { h1 > a {