From 98e9a3b094dbedd2824376604c9513127b3e08ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Benjamin=20H=C3=A4ttasch?=
 <benjamin.haettasch@fachschaft.informatik.tu-darmstadt.de>
Date: Tue, 27 Dec 2022 19:12:16 +0100
Subject: [PATCH] Change grid resolution to 15 minutes for default slot editor

This implements #174
---
 AKModel/templates/admin/AKModel/default_slot_editor.html | 3 ++-
 static_common/common/js/availabilities.js                | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/AKModel/templates/admin/AKModel/default_slot_editor.html b/AKModel/templates/admin/AKModel/default_slot_editor.html
index c3004e35..7d288c9d 100644
--- a/AKModel/templates/admin/AKModel/default_slot_editor.html
+++ b/AKModel/templates/admin/AKModel/default_slot_editor.html
@@ -18,7 +18,8 @@
                 '{{ event.timezone }}',
                 '{{ LANGUAGE_CODE }}',
                 '{{ event.start | timezone:event.timezone | date:"Y-m-d H:i:s" }}',
-                '{{ event.end | timezone:event.timezone | date:"Y-m-d H:i:s" }}'
+                '{{ event.end | timezone:event.timezone | date:"Y-m-d H:i:s" }}',
+                '00:15:00'
             );
         });
     </script>
diff --git a/static_common/common/js/availabilities.js b/static_common/common/js/availabilities.js
index 49d3e2bf..84376ba5 100644
--- a/static_common/common/js/availabilities.js
+++ b/static_common/common/js/availabilities.js
@@ -6,7 +6,7 @@
 // It was significantly changed to deal with the newer fullcalendar version, event specific timezones,
 // to remove the dependency to moments timezone and improve the visualization of deletion
 
-function createAvailabilityEditors(timezone, language, startDate, endDate) {
+function createAvailabilityEditors(timezone, language, startDate, endDate, slotResolution='00:30:00') {
     $("input.availabilities-editor-data").each(function () {
         const eventColor = '#28B62C';
 
@@ -84,6 +84,7 @@ function createAvailabilityEditors(timezone, language, startDate, endDate) {
             selectOverlap: false,
             eventOverlap: false,
             eventChange: save_events,
+            slotDuration: slotResolution,
         });
         plan.render();
 
-- 
GitLab