Fehler behoben

This commit is contained in:
Matthias Grief
2025-01-01 16:51:42 +01:00
parent 362a5034bc
commit 76353e616b
4 changed files with 21 additions and 17 deletions

View File

@@ -208,14 +208,15 @@ body {
/* List style improvement */
.content-text li {
position: relative;
padding-left: 1.5rem;
margin-left: 1.5rem;
padding-left: 0.5rem;
margin-bottom: 0.5rem;
}
.content-text li::before {
content: '•';
position: absolute;
left: 0;
font-weight: bold;
.content-text ul li {
list-style-type: disc;
}
.content-text ol li {
list-style-type: decimal;
}

View File

@@ -1,8 +1,5 @@
<?php
use exception\SubjectDoesNotExistException;
use exception\TopicAlreadyExistsException;
require_once("Task.php");
require_once("Config.php");
require_once("Util.php");

View File

@@ -122,9 +122,9 @@ if (!isset($topicData)) {
<p class="content-text">
<?php echo($topicData->description); ?>
</p>
<p class="content-text article-section">
<div class="content-text article-section">
<?php echo($topicData->getFinishedArticle()); ?>
</p>
</div>
<div class="exercise-section bg-gray-100">
<h3 style="margin-bottom: 1rem;" class="text-[var(--primary-color)]">Übungen herunterladen:</h3>

View File

@@ -75,7 +75,11 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
$relatedTopics = array();
foreach (explode(",", $_POST['relatedTopics']) as $relatedTopic) {
$relatedTopics[] = trim($relatedTopic);
$relatedTopic = trim($relatedTopic);
if($relatedTopic == "") {
continue;
}
$relatedTopics[] = $relatedTopic;
}
$newTopic->setRelatedTopics($relatedTopics);
$newTopic->setArticle($_POST['article']);
@@ -103,7 +107,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
<title>Lehrer Dashboard</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<link href="assets/css/styles.css" rel="stylesheet">
<link href="assets/css/topic.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.snow.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
@@ -203,7 +207,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
<div class="border rounded-lg p-8 mt-8 bg-gray-50">
<h4 class="text-lg font-medium text-gray-700 mb-4">Vorschau</h4>
<div id="contentPreview" class="prose prose-lg max-w-none bg-white p-6 rounded-lg shadow-sm"></div>
<div id="contentPreview" class="content-text prose prose-lg max-w-none bg-white p-6 rounded-lg shadow-sm"></div>
</div>
<div class="flex justify-end gap-4">
@@ -213,7 +217,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
</button>
<button type="submit"
class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">
Thema erstellen
Speichern
</button>
</div>
@@ -254,7 +258,9 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
});
quill.on('text-change', (delta, oldDelta, source) => {
const html = quill.getSemanticHTML().replace(/&nbsp;/g, " ");
let html = quill.getSemanticHTML().replace(/&nbsp;/g, " ");
html = html.replaceAll("<p></p>", "<br>");
document.getElementById('contentPreview').innerHTML = html;
document.getElementById('article-upload-field').value = html;
renderFormulas();