Skip to content

Commit

Permalink
Booking details help text configurable in the booking type
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Aug 19, 2024
1 parent 01205ec commit 25fa267
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog
2.7.7 (unreleased)
------------------

- Nothing changed yet.
- Bookings details help text.
[folix-01]


2.7.6 (2024-06-27)
Expand Down
9 changes: 9 additions & 0 deletions src/redturtle/prenotazioni/content/prenotazione_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
),
}

0 comments on commit 25fa267

Please sign in to comment.