From 25fa2673c5b7af884037c1d6a4f5f2a6e5b14627 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 19 Aug 2024 16:42:01 +0200 Subject: [PATCH] Booking details help text configurable in the booking type --- CHANGES.rst | 3 ++- src/redturtle/prenotazioni/content/prenotazione_type.py | 9 +++++++++ .../restapi/serializers/adapters/prenotazione_type.py | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index fad186f6..1a9ff343 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,8 @@ Changelog 2.7.7 (unreleased) ------------------ -- Nothing changed yet. +- Bookings details help text. + [folix-01] 2.7.6 (2024-06-27) diff --git a/src/redturtle/prenotazioni/content/prenotazione_type.py b/src/redturtle/prenotazioni/content/prenotazione_type.py index fec81911..252bbe1c 100644 --- a/src/redturtle/prenotazioni/content/prenotazione_type.py +++ b/src/redturtle/prenotazioni/content/prenotazione_type.py @@ -36,6 +36,15 @@ class IPrenotazioneType(model.Schema): # default=[], # ) + booking_details_help_text = RichText( + required=False, + title=_("booking_details_help_text_label", default="Bookign detail help text"), + description=_( + "booking_details_help_text_label_help", + default='This field will be visualized as "Details" helptext during the booking steps', + ), + ) + @implementer(IPrenotazioneType) class PrenotazioneType(Item): diff --git a/src/redturtle/prenotazioni/restapi/serializers/adapters/prenotazione_type.py b/src/redturtle/prenotazioni/restapi/serializers/adapters/prenotazione_type.py index 75559286..54a85c1d 100644 --- a/src/redturtle/prenotazioni/restapi/serializers/adapters/prenotazione_type.py +++ b/src/redturtle/prenotazioni/restapi/serializers/adapters/prenotazione_type.py @@ -2,6 +2,7 @@ from plone import api from zope.component import adapter from zope.interface import implementer +from plone.restapi.serializer.converters import json_compatible from redturtle.prenotazioni.content.prenotazione_type import IPrenotazioneType from redturtle.prenotazioni.interfaces import IRedturtlePrenotazioniLayer @@ -23,4 +24,7 @@ def __call__(self, *args, **kwargs): "name": self.context.title, "duration": str(self.context.duration), "hidden": hidden, + "booking_details_help_text": json_compatible( + self.context.booking_details_help_text, self.context + ), }