Skip to content
\n

Then respond to /bookings/23/calendar with HTML like this:

\n
<main>\n  <div class=\"calendar\">\n    <h1>July 2025</h1>\n    <button up-accept='\"2025-07-01 09:00\"'>2025-07-01 09:00</button>\n    <button up-accept='\"2025-07-01 10:00\"'>2025-07-01 10:00</button>\n    <button up-accept='\"2025-07-01 11:00\"'>2025-07-01 11:00</button>\n  </div>\n\n  <a href=\"/bookings/23/calendar?month=2025-06\">Previous month</a>\n  <a href=\"/bookings/23/calendar?month=2025-08\">Next month</a>\n</main>
\n

The attribute value for [up-accept] is a JSON string with the selected time slot.

\n

The links to other months will navigate within the overlay.

","upvoteCount":1,"url":"https://github.com/unpoly/unpoly/discussions/761#discussioncomment-13630240"}}}
Discussion options

You must be logged in to vote

Yes, the demo is full of examples where an overlay needs to communicate a selection back to the parent layer.

A minimal solution could look something like this, starting with the form:

<form action="/bookings/23/book" method="post">
  <input type="text" name="slot" readonly>
  
  <a href="/bookings/23/calendar" up-layer="new" up-on-accepted="this.previousSiblingElement = value">
    Pick a slot
  </a>
</form>

Then respond to /bookings/23/calendar with HTML like this:

<main>
  <div class="calendar">
    <h1>July 2025</h1>
    <button up-accept='"2025-07-01 09:00"'>2025-07-01 09:00</button>
    <button up-accept='"2025-07-01 10:00"'>2025-07-01 10:00</button>
    <button up-accept='"2025-07-…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@choucavalier
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by choucavalier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants