From 12d06adae8d2a1c2695fc4b1d2115c19375478c8 Mon Sep 17 00:00:00 2001
From: Ruben Backx <r.w.backx@tudelft.nl>
Date: Fri, 1 Sep 2023 11:14:58 +0200
Subject: [PATCH] Fix lab extra info

---
 src/main/resources/static/js/map_loader.js                    | 1 +
 .../resources/templates/lab/edit/components/lab-general.html  | 4 ++--
 src/main/resources/templates/lab/edit/slotted.html            | 4 ++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/static/js/map_loader.js b/src/main/resources/static/js/map_loader.js
index 56fb52497..9d62a107a 100644
--- a/src/main/resources/static/js/map_loader.js
+++ b/src/main/resources/static/js/map_loader.js
@@ -25,6 +25,7 @@ $(() => {
 
 function updateRequestInfo(roomId) {
     const imageHolder = document.getElementById("image-holder");
+    if (imageHolder == null) return;
     const image = imageHolder.querySelector("img");
     $.get({
         url: "/room/map/" + roomId,
diff --git a/src/main/resources/templates/lab/edit/components/lab-general.html b/src/main/resources/templates/lab/edit/components/lab-general.html
index 0d8490af9..4d39d1802 100644
--- a/src/main/resources/templates/lab/edit/components/lab-general.html
+++ b/src/main/resources/templates/lab/edit/components/lab-general.html
@@ -260,8 +260,8 @@
 
         <section th:fragment="lab-extra">
             <h3 class="font-500 mb-3"><label for="markdown-editor">Extra lab info</label></h3>
-            <div>
-                <textarea id="markdown-editor" name="extraInfo" th:text="${extraInfo}">some extra info!</textarea>
+            <div class="article">
+                <textarea id="markdown-editor" name="extraInfo" th:text="${qSession.extraInfo}">some extra info!</textarea>
             </div>
 
             <div class="mt-500 underlined"></div>
diff --git a/src/main/resources/templates/lab/edit/slotted.html b/src/main/resources/templates/lab/edit/slotted.html
index 40a046401..3ca1fdc07 100644
--- a/src/main/resources/templates/lab/edit/slotted.html
+++ b/src/main/resources/templates/lab/edit/slotted.html
@@ -43,6 +43,10 @@
             <th:block th:replace="~{lab/edit/components/lab-general :: lab-general}"></th:block>
         </section>
 
+        <th:block layout:fragment="extra-config">
+            <th:block th:replace="~{lab/edit/components/lab-general :: lab-extra}"></th:block>
+        </th:block>
+
         <section layout:fragment="advanced-config">
             <th:block th:replace="~{lab/edit/components/advanced-slotted :: advanced}"></th:block>
         </section>
-- 
GitLab