Manche Bereiche nur anzeigen, wenn sie Inhalt haben

This commit is contained in:
Matthias Grief
2025-01-06 22:40:03 +01:00
parent 81f95e4f00
commit afbe57cc93
2 changed files with 30 additions and 1 deletions

View File

@@ -102,6 +102,10 @@ $topics = $subjectData->topics;
</ul>
</div>-->
</div>
<?php
if(count($topicData->files) > 0) {
?>
<div class="download-section bg-gray-100 p-[20px] rounded-[20px]">
<h4>Übungen herunterladen:</h4>
<div class="download-links">
@@ -122,6 +126,10 @@ $topics = $subjectData->topics;
?>
</div>
</div>
<?php
}
?>
</div>
<?php

View File

@@ -33,7 +33,6 @@ if (!isset($topicData)) {
<link href="assets/css/topic.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<!--<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>-->
<script src="assets/js/sidebar.js"></script>
<script src="assets/js/tasks.js" defer></script>
@@ -95,6 +94,10 @@ if (!isset($topicData)) {
<div class="max-w-7xl mx-auto mt-5">
<div class="mt-16"></div>
<?php
if(count($topicData->relatedTopics) > 0) {
?>
<!-- Related Topics -->
<div class="related-topics bg-gray-100 p-4 rounded-lg">
<h4>Verwandte Themen:</h4>
@@ -119,6 +122,10 @@ if (!isset($topicData)) {
</ul>
</div>
<?php
}
?>
<!-- Topic Content -->
<div class="content-card mt-[8px]">
<h1 class="content-title"><?php echo($topicData->displayName); ?></h1>
@@ -129,6 +136,9 @@ if (!isset($topicData)) {
<?php echo($topicData->getFinishedArticle()); ?>
</div>
<?php
if(count($topicData->files) > 0) {
?>
<div class="exercise-section bg-gray-100">
<h3 style="margin-bottom: 1rem;" class="text-[var(--primary-color)]">Übungen herunterladen:</h3>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
@@ -148,6 +158,10 @@ if (!isset($topicData)) {
?>
</div>
</div>
<?php
}
?>
</div>
<!-- Tasks -->
@@ -206,6 +220,9 @@ if (!isset($topicData)) {
?>
<?php
if(count($topicData->relatedTopics) > 0) {
?>
<!-- Related Topics -->
<div class="related-topics bg-gray-100 p-4 rounded-lg">
<h4>Verwandte Themen:</h4>
@@ -229,6 +246,10 @@ if (!isset($topicData)) {
?>
</ul>
</div>
<?php
}
?>
</div>
</main>