@semics-tech/emdash-events 1.0.0-rc.6 → 1.0.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/manifest.json +1 -1
- package/dist/ts/astro/lib/page.d.ts +4 -2
- package/dist/ts/astro/lib/page.js +37 -8
- package/package.json +3 -1
- package/src/astro/BookingPage.astro +16 -3
- package/src/astro/BookingStatus.astro +136 -43
- package/src/astro/BookingWidget.astro +115 -46
- package/src/astro/CancelBooking.astro +80 -0
- package/src/astro/PageOrganiser.astro +22 -0
- package/src/astro/TicketPass.astro +45 -15
- package/src/astro/lib/list.ts +8 -13
- package/src/astro/lib/page.ts +38 -9
- package/src/astro/lib/widget.ts +2 -2
- package/src/client/picker.ts +20 -9
- package/src/client/print.ts +12 -0
- package/src/i18n/ar.ts +5 -0
- package/src/i18n/en.ts +5 -0
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/** @type {import("emdash").PluginDescriptor} */
|
|
8
8
|
const descriptor = Object.freeze({
|
|
9
9
|
"id": "semics-events",
|
|
10
|
-
"version": "1.0.0-rc.
|
|
10
|
+
"version": "1.0.0-rc.7",
|
|
11
11
|
"format": "standard",
|
|
12
12
|
"entrypoint": "@semics-tech/emdash-events/sandbox",
|
|
13
13
|
"capabilities": [
|
package/dist/manifest.json
CHANGED
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
export declare const THEME_PROPERTIES: readonly ["fg", "muted", "bg", "border", "accent", "accent-fg", "error", "success", "radius", "font", "page-bg", "heading-font", "heading-fg"];
|
|
12
12
|
export type ThemeProperty = (typeof THEME_PROPERTIES)[number];
|
|
13
13
|
export interface PageBrand {
|
|
14
|
-
/** The site's name: the link's text, or the logo's alternative text. */
|
|
14
|
+
/** The site's name: the link's text, or the logo's alternative text. Also the organiser at the page's foot. */
|
|
15
15
|
name: string;
|
|
16
16
|
/** Where it links, a path on this site (default `/`). */
|
|
17
17
|
href?: string;
|
|
18
18
|
/** A logo, a path on this site. */
|
|
19
19
|
logo?: string;
|
|
20
|
+
/** The organiser's postal address, one line, at the page's foot and on a printed booking (T157). */
|
|
21
|
+
address?: string;
|
|
20
22
|
}
|
|
21
23
|
export interface PageOptions {
|
|
22
24
|
/** Values for the pages' custom properties, for example `{ accent: "#1f3a2e", "page-bg": "#f6f1ea" }`. */
|
|
@@ -33,6 +35,6 @@ export declare function checkPageOptions(page?: PageOptions): PageOptions;
|
|
|
33
35
|
/** The event's page for "Book again"; undefined when the booking does not know its slug. */
|
|
34
36
|
export declare function eventPageHref(slug: string | null | undefined, eventPath?: string): string | undefined;
|
|
35
37
|
/** Works with no site theme at all. Zero specificity on elements, so the components' own rules win. */
|
|
36
|
-
export declare const PAGE_CSS = "*,*::before,*::after{box-sizing:border-box}\nhtml{color-scheme:light;-webkit-text-size-adjust:100%}\nbody.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;\n--esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}\n.semics-page-brand{max-inline-size:
|
|
38
|
+
export declare const PAGE_CSS = "*,*::before,*::after{box-sizing:border-box}\nhtml{color-scheme:light;-webkit-text-size-adjust:100%}\nbody.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;\n--esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}\n.semics-page-brand{max-inline-size:40rem;margin-inline:auto;padding:1.25rem 1rem 0;font-family:var(--events-heading-font, inherit);font-weight:600}\n.semics-page-brand a{color:var(--events-heading-fg, inherit);text-decoration:none}\n.semics-page-brand img{display:block;block-size:2.5rem;inline-size:auto;max-inline-size:100%}\n.semics-page-main{max-inline-size:40rem;margin-inline:auto;padding:1.5rem 1rem 2rem}\n:where(.semics-page) :is(h1,h2,h3){margin:0 0 .75rem;font-family:var(--events-heading-font, inherit);color:var(--events-heading-fg, inherit);line-height:1.2}\n:where(.semics-page) h1{margin-block-end:1.25rem;font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}\n:where(.semics-page) h2{font-size:1.25rem}\n:where(.semics-page) h3{font-size:1.0625rem}\n:where(.semics-page) p{margin:0 0 .75rem}\n:where(.semics-page) a{color:var(--events-accent, #0b57d0);text-underline-offset:.2em}\n:where(.semics-page) :focus-visible{outline:3px solid var(--events-accent, #0b57d0);outline-offset:2px}\n:where(.semics-page-main > section,.semics-page-main > form:not([hidden]),.semics-page-main > .semics-ceremony){margin-block:0 1.25rem;padding:clamp(1.25rem,.9rem + 1.8vw,1.75rem);background:var(--events-bg, #ffffff);border:1px solid color-mix(in srgb,var(--events-border, #6b6b6b) 30%,transparent);border-radius:calc(var(--events-radius, 6px) + 6px);box-shadow:0 1px 2px rgb(0 0 0 / .04),0 6px 24px rgb(0 0 0 / .05);max-inline-size:none}\n:where(.semics-page-main > section,.semics-page-main > form,.semics-page-main > .semics-ceremony) > :last-child{margin-block-end:0}\n:where(.semics-page) [role=\"alert\"]{padding:.75rem 1rem;border:1px solid var(--events-error, #b3261e);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-error, #b3261e)}\n:where(.semics-page) :is(input:not([type=\"checkbox\"],[type=\"radio\"],[type=\"hidden\"]),select,textarea){font:inherit;inline-size:100%;min-block-size:2.75rem;padding:.5rem .75rem;border:1px solid var(--events-border, #6b6b6b);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-fg, #1a1a1a)}\n:where(.semics-page) label{display:block}\n:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}\n:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}\n:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}\n.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}\n.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}\n.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}\n.semics-page-organiser p{margin:0}\n.semics-page-organiser address{font-style:normal}\n@media print{\n@page{margin:15mm}\nbody.semics-page{min-block-size:0;background:#ffffff;color:#000000;font-size:11pt}\n.semics-page-brand,.semics-page-actions,.semics-page-main form,.semics-page-main button,.semics-page-main details,.semics-add-to-calendar,[data-semics-payment-live]{display:none !important}\n.semics-page-main{max-inline-size:none;padding:0}\n:where(.semics-page-main > section,.semics-page-main > .semics-ceremony){box-shadow:none;border-color:#999999;break-inside:avoid}\n.semics-ticket-pass{break-inside:avoid}\n.semics-page-organiser{max-inline-size:none;padding:1rem 0 0;color:#000000}\n}\n";
|
|
37
39
|
/** The stylesheet for a page: the defaults, then the site's theme. Exact: the signing page hashes this text. */
|
|
38
40
|
export declare function pageCss(page?: PageOptions): string;
|
|
@@ -24,6 +24,17 @@ export const THEME_PROPERTIES = [
|
|
|
24
24
|
"heading-font",
|
|
25
25
|
"heading-fg",
|
|
26
26
|
];
|
|
27
|
+
/** One line of text for people: 1 to 300 characters, no control characters (line breaks included). */
|
|
28
|
+
function oneLine(value) {
|
|
29
|
+
if (typeof value !== "string" || !value.trim() || value.length > 300)
|
|
30
|
+
return false;
|
|
31
|
+
for (let i = 0; i < value.length; i++) {
|
|
32
|
+
const unit = value.charCodeAt(i);
|
|
33
|
+
if (unit <= 0x1f || unit === 0x7f)
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
27
38
|
/** One line of CSS, nothing that could end the declaration, the rule or the `<style>` element. */
|
|
28
39
|
const THEME_VALUE = /^[^;{}<>\\@]{1,200}$/;
|
|
29
40
|
/** A path on this site; `;` and `,` would end a source in the signing page's CSP header. */
|
|
@@ -50,6 +61,8 @@ export function checkPageOptions(page = {}) {
|
|
|
50
61
|
refuse("brand.href");
|
|
51
62
|
if (brand.logo !== undefined && !SITE_PATH.test(brand.logo))
|
|
52
63
|
refuse("brand.logo");
|
|
64
|
+
if (brand.address !== undefined && !oneLine(brand.address))
|
|
65
|
+
refuse("brand.address");
|
|
53
66
|
}
|
|
54
67
|
return page;
|
|
55
68
|
}
|
|
@@ -62,23 +75,39 @@ export const PAGE_CSS = `*,*::before,*::after{box-sizing:border-box}
|
|
|
62
75
|
html{color-scheme:light;-webkit-text-size-adjust:100%}
|
|
63
76
|
body.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;
|
|
64
77
|
--esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}
|
|
65
|
-
.semics-page-brand{max-inline-size:
|
|
78
|
+
.semics-page-brand{max-inline-size:40rem;margin-inline:auto;padding:1.25rem 1rem 0;font-family:var(--events-heading-font, inherit);font-weight:600}
|
|
66
79
|
.semics-page-brand a{color:var(--events-heading-fg, inherit);text-decoration:none}
|
|
67
80
|
.semics-page-brand img{display:block;block-size:2.5rem;inline-size:auto;max-inline-size:100%}
|
|
68
|
-
.semics-page-main{max-inline-size:
|
|
81
|
+
.semics-page-main{max-inline-size:40rem;margin-inline:auto;padding:1.5rem 1rem 2rem}
|
|
69
82
|
:where(.semics-page) :is(h1,h2,h3){margin:0 0 .75rem;font-family:var(--events-heading-font, inherit);color:var(--events-heading-fg, inherit);line-height:1.2}
|
|
70
|
-
:where(.semics-page) h1{font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}
|
|
83
|
+
:where(.semics-page) h1{margin-block-end:1.25rem;font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}
|
|
71
84
|
:where(.semics-page) h2{font-size:1.25rem}
|
|
72
85
|
:where(.semics-page) h3{font-size:1.0625rem}
|
|
73
86
|
:where(.semics-page) p{margin:0 0 .75rem}
|
|
74
87
|
:where(.semics-page) a{color:var(--events-accent, #0b57d0);text-underline-offset:.2em}
|
|
75
88
|
:where(.semics-page) :focus-visible{outline:3px solid var(--events-accent, #0b57d0);outline-offset:2px}
|
|
76
|
-
:where(.semics-page-main
|
|
77
|
-
:where(.semics-page
|
|
78
|
-
:where(.semics-page)
|
|
89
|
+
:where(.semics-page-main > section,.semics-page-main > form:not([hidden]),.semics-page-main > .semics-ceremony){margin-block:0 1.25rem;padding:clamp(1.25rem,.9rem + 1.8vw,1.75rem);background:var(--events-bg, #ffffff);border:1px solid color-mix(in srgb,var(--events-border, #6b6b6b) 30%,transparent);border-radius:calc(var(--events-radius, 6px) + 6px);box-shadow:0 1px 2px rgb(0 0 0 / .04),0 6px 24px rgb(0 0 0 / .05);max-inline-size:none}
|
|
90
|
+
:where(.semics-page-main > section,.semics-page-main > form,.semics-page-main > .semics-ceremony) > :last-child{margin-block-end:0}
|
|
91
|
+
:where(.semics-page) [role="alert"]{padding:.75rem 1rem;border:1px solid var(--events-error, #b3261e);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-error, #b3261e)}
|
|
92
|
+
:where(.semics-page) :is(input:not([type="checkbox"],[type="radio"],[type="hidden"]),select,textarea){font:inherit;inline-size:100%;min-block-size:2.75rem;padding:.5rem .75rem;border:1px solid var(--events-border, #6b6b6b);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-fg, #1a1a1a)}
|
|
79
93
|
:where(.semics-page) label{display:block}
|
|
80
|
-
:where(.semics-page) fieldset{min-inline-size:0;margin:0 0
|
|
81
|
-
:where(.semics-page)
|
|
94
|
+
:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}
|
|
95
|
+
:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}
|
|
96
|
+
:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}
|
|
97
|
+
.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}
|
|
98
|
+
.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}
|
|
99
|
+
.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}
|
|
100
|
+
.semics-page-organiser p{margin:0}
|
|
101
|
+
.semics-page-organiser address{font-style:normal}
|
|
102
|
+
@media print{
|
|
103
|
+
@page{margin:15mm}
|
|
104
|
+
body.semics-page{min-block-size:0;background:#ffffff;color:#000000;font-size:11pt}
|
|
105
|
+
.semics-page-brand,.semics-page-actions,.semics-page-main form,.semics-page-main button,.semics-page-main details,.semics-add-to-calendar,[data-semics-payment-live]{display:none !important}
|
|
106
|
+
.semics-page-main{max-inline-size:none;padding:0}
|
|
107
|
+
:where(.semics-page-main > section,.semics-page-main > .semics-ceremony){box-shadow:none;border-color:#999999;break-inside:avoid}
|
|
108
|
+
.semics-ticket-pass{break-inside:avoid}
|
|
109
|
+
.semics-page-organiser{max-inline-size:none;padding:1rem 0 0;color:#000000}
|
|
110
|
+
}
|
|
82
111
|
`;
|
|
83
112
|
/** The stylesheet for a page: the defaults, then the site's theme. Exact: the signing page hashes this text. */
|
|
84
113
|
export function pageCss(page = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semics-tech/emdash-events",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"./client/*": "./src/client/*.ts",
|
|
27
27
|
"./astro/BookingPage.astro": "./src/astro/BookingPage.astro",
|
|
28
28
|
"./astro/PageBrand.astro": "./src/astro/PageBrand.astro",
|
|
29
|
+
"./astro/PageOrganiser.astro": "./src/astro/PageOrganiser.astro",
|
|
30
|
+
"./astro/CancelBooking.astro": "./src/astro/CancelBooking.astro",
|
|
29
31
|
"./astro/DoorSignPage.astro": "./src/astro/DoorSignPage.astro",
|
|
30
32
|
"./astro/CheckIn.astro": "./src/astro/CheckIn.astro",
|
|
31
33
|
"./astro/OptOutPage.astro": "./src/astro/OptOutPage.astro",
|
|
@@ -13,7 +13,9 @@ import { esignPluginId, page, pluginId, reconcile } from "virtual:semics-events/
|
|
|
13
13
|
import { type MessageKey, pickLocale, translator } from "../i18n/index";
|
|
14
14
|
import AddToCalendar from "./AddToCalendar.astro";
|
|
15
15
|
import BookingStatus from "./BookingStatus.astro";
|
|
16
|
+
import CancelBooking from "./CancelBooking.astro";
|
|
16
17
|
import PageBrand from "./PageBrand.astro";
|
|
18
|
+
import PageOrganiser from "./PageOrganiser.astro";
|
|
17
19
|
import PaymentReturn from "./PaymentReturn.astro";
|
|
18
20
|
import { callPublicRoute } from "./lib/call";
|
|
19
21
|
import {
|
|
@@ -170,7 +172,8 @@ if (booking?.eventId) {
|
|
|
170
172
|
}
|
|
171
173
|
const signingList = booking && !cancelled ? signingRows(booking) : null;
|
|
172
174
|
const payment = booking && !cancelled ? paymentView(booking, locale) : null;
|
|
173
|
-
const
|
|
175
|
+
const confirmed = Boolean(booking && !cancelled && booking.status === "confirmed");
|
|
176
|
+
const passes = booking && confirmed ? booking.attendees.filter((a) => a.code) : [];
|
|
174
177
|
---
|
|
175
178
|
<!doctype html>
|
|
176
179
|
<html lang={lang} dir={dir}>
|
|
@@ -202,7 +205,7 @@ const passes = booking && !cancelled && booking.status === "confirmed" ? booking
|
|
|
202
205
|
</form>
|
|
203
206
|
) : booking ? (
|
|
204
207
|
<>
|
|
205
|
-
<BookingStatus booking={booking} cancelled={cancelled}
|
|
208
|
+
<BookingStatus booking={booking} cancelled={cancelled} ticketNames={names} bookAgain={eventPageHref(booking.event?.slug, page.eventPath)} showAttendees={!signingList} locale={locale} />
|
|
206
209
|
{payment && <PaymentReturn view={payment} bookingRef={ref} action={`/booking?ref=${ref}`} locale={locale} />}
|
|
207
210
|
{signingList && (
|
|
208
211
|
<AttendeeList
|
|
@@ -221,7 +224,15 @@ const passes = booking && !cancelled && booking.status === "confirmed" ? booking
|
|
|
221
224
|
))}
|
|
222
225
|
</section>
|
|
223
226
|
)}
|
|
224
|
-
{
|
|
227
|
+
{confirmed && (
|
|
228
|
+
<div class="semics-page-actions" data-testid="booking-actions">
|
|
229
|
+
<AddToCalendar signedQuery={booking.calendar?.query} locale={locale} />
|
|
230
|
+
<button type="button" class="semics-print" data-print data-testid="booking-print" hidden>{t("booking.print")}</button>
|
|
231
|
+
</div>
|
|
232
|
+
)}
|
|
233
|
+
{booking.canCancel && !cancelled && (
|
|
234
|
+
<CancelBooking action={`/booking?ref=${ref}`} cancelBy={booking.cancelBy} zone={booking.event?.timezone} locale={locale} />
|
|
235
|
+
)}
|
|
225
236
|
</>
|
|
226
237
|
) : missing ? (
|
|
227
238
|
<p data-testid="booking-missing">{t("booking.missing")}</p>
|
|
@@ -230,10 +241,12 @@ const passes = booking && !cancelled && booking.status === "confirmed" ? booking
|
|
|
230
241
|
) : null
|
|
231
242
|
}
|
|
232
243
|
</main>
|
|
244
|
+
<PageOrganiser brand={page.brand} locale={locale} />
|
|
233
245
|
<script>
|
|
234
246
|
import "../client/receipt.ts";
|
|
235
247
|
import "../client/payment.ts";
|
|
236
248
|
import "../client/forget-form.ts";
|
|
249
|
+
import "../client/print.ts";
|
|
237
250
|
</script>
|
|
238
251
|
</body>
|
|
239
252
|
</html>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
// <BookingStatus>: a booking's
|
|
3
|
-
//
|
|
2
|
+
// <BookingStatus>: a booking's summary card (EU-FR-06). Rendered by the `/booking` page from the
|
|
3
|
+
// `public/booking` answer. It leads with the event and the booked session, in the event's zone, and the
|
|
4
|
+
// place (T157), then the state, the order and its total. With `cancelAction` it ends with the quiet cancel
|
|
5
|
+
// action (`<CancelBooking>`); the booking page instead puts that at its foot.
|
|
4
6
|
import { around, pickLocale, translator } from "../i18n/index";
|
|
7
|
+
import CancelBooking from "./CancelBooking.astro";
|
|
5
8
|
import { zonedAt } from "./lib/list";
|
|
6
9
|
import { type BookingView, endedNotes, formatMoney, statusLabel } from "./lib/widget";
|
|
7
10
|
|
|
@@ -9,16 +12,18 @@ interface Props {
|
|
|
9
12
|
booking: BookingView;
|
|
10
13
|
/** Shown as cancelled (the page just cancelled it). */
|
|
11
14
|
cancelled?: boolean;
|
|
12
|
-
/** Where the cancel form posts. */
|
|
15
|
+
/** Where the cancel form posts; without it the card has no cancel action. */
|
|
13
16
|
cancelAction?: string;
|
|
14
17
|
/** Ticket type names by id, when the page knows them. */
|
|
15
18
|
ticketNames?: Record<string, string>;
|
|
16
19
|
/** A lapsed booking's way back: the event's page, when known. */
|
|
17
20
|
bookAgain?: string;
|
|
21
|
+
/** List the attendees' names (the page turns it off when Events Pro's signing list shows them). */
|
|
22
|
+
showAttendees?: boolean;
|
|
18
23
|
locale?: string;
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
const { booking, cancelled = false, cancelAction, ticketNames = {}, bookAgain } = Astro.props;
|
|
26
|
+
const { booking, cancelled = false, cancelAction, ticketNames = {}, bookAgain, showAttendees = true } = Astro.props;
|
|
22
27
|
const locale = pickLocale(Astro.props.locale, Astro.currentLocale);
|
|
23
28
|
const { t, plural, lang, dir } = translator(locale);
|
|
24
29
|
// A request awaiting approval (T131) holds its places until the organiser's deadline.
|
|
@@ -26,52 +31,69 @@ const [heldBefore, heldAfter] = around(
|
|
|
26
31
|
t(booking.status === "awaiting_approval" ? "booking.decideBy" : "booking.heldUntil"),
|
|
27
32
|
"time",
|
|
28
33
|
);
|
|
29
|
-
const [cancelBefore, cancelAfter] = around(t("booking.cancelUntil"), "time");
|
|
30
34
|
const tickets = booking.lines.reduce((n, line) => n + line.qty, 0);
|
|
31
35
|
const status = cancelled ? "cancelled" : booking.status;
|
|
32
|
-
const
|
|
36
|
+
const zone = booking.event?.timezone;
|
|
37
|
+
const at = (iso: string) => zonedAt(iso, zone, locale);
|
|
33
38
|
const notes = endedNotes({ ...booking, status }, locale);
|
|
39
|
+
const event = booking.event;
|
|
40
|
+
const startsAt = event?.startsAt && Number.isFinite(Date.parse(event.startsAt)) ? event.startsAt : undefined;
|
|
41
|
+
// Who is coming, when the booking names different people (a plain booking puts every seat in the buyer's name).
|
|
42
|
+
const named = booking.attendees.map((a) => a.name).filter(Boolean);
|
|
43
|
+
const names = showAttendees && new Set(named).size > 1 ? named : [];
|
|
34
44
|
---
|
|
35
45
|
<section class="semics-events semics-booking-status" data-testid="booking-details" data-status={status} lang={lang} dir={dir} aria-labelledby="semics-booking-status-title">
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
{event?.title ? (
|
|
47
|
+
<h2 id="semics-booking-status-title" class="semics-booking-event" data-testid="booking-event">{event.title}</h2>
|
|
48
|
+
) : (
|
|
49
|
+
<h2 id="semics-booking-status-title" class="semics-visually-hidden">{t("booking.status")}</h2>
|
|
50
|
+
)}
|
|
51
|
+
{(startsAt || event?.venue) && (
|
|
52
|
+
<div class="semics-booking-session" data-testid="booking-session">
|
|
53
|
+
{startsAt && <p class="semics-booking-when"><time datetime={startsAt} data-testid="booking-when">{at(startsAt)}</time></p>}
|
|
54
|
+
{event?.venue && <p class="semics-booking-venue" data-testid="booking-venue">{event.venue}</p>}
|
|
55
|
+
</div>
|
|
56
|
+
)}
|
|
57
|
+
<div class="semics-booking-meta">
|
|
58
|
+
<p class="semics-status" data-testid="booking-status" data-status={status}>
|
|
59
|
+
<span class="semics-status-badge">{statusLabel(status, locale)}</span>
|
|
60
|
+
</p>
|
|
61
|
+
<p class="semics-booking-ref">
|
|
62
|
+
{t("booking.reference")} <strong data-testid="booking-ref">{booking.bookingRef}</strong>
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
43
65
|
{
|
|
44
66
|
!cancelled && booking.holdExpiresAt && (
|
|
45
|
-
<p data-testid="booking-hold">
|
|
67
|
+
<p class="semics-booking-note" data-testid="booking-hold">
|
|
46
68
|
{heldBefore}<time datetime={booking.holdExpiresAt}>{at(booking.holdExpiresAt)}</time>{heldAfter}
|
|
47
69
|
</p>
|
|
48
70
|
)
|
|
49
71
|
}
|
|
50
|
-
{notes.map((note) => <p data-testid="booking-note">{note}</p>)}
|
|
72
|
+
{notes.map((note) => <p class="semics-booking-note" data-testid="booking-note">{note}</p>)}
|
|
51
73
|
{status === "expired" && bookAgain && <p><a href={bookAgain} data-testid="booking-book-again">{t("booking.bookAgain")}</a></p>}
|
|
52
|
-
<
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
<div class="semics-booking-order">
|
|
75
|
+
<ul class="semics-lines" aria-label={plural("booking.lines", tickets)}>
|
|
76
|
+
{
|
|
77
|
+
booking.lines.map((line) => (
|
|
78
|
+
<li>
|
|
79
|
+
{ticketNames[line.ticketTypeId]
|
|
80
|
+
? t("booking.line", { qty: new Intl.NumberFormat(locale).format(line.qty), name: ticketNames[line.ticketTypeId] })
|
|
81
|
+
: plural("booking.lines", line.qty)}
|
|
82
|
+
</li>
|
|
83
|
+
))
|
|
84
|
+
}
|
|
85
|
+
</ul>
|
|
86
|
+
{names.length > 0 && (
|
|
87
|
+
<div class="semics-booking-people" data-testid="booking-attendees">
|
|
88
|
+
<h3>{t("booking.attendeesHeading")}</h3>
|
|
89
|
+
<ul>{names.map((name) => <li>{name}</li>)}</ul>
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
92
|
+
<p class="semics-booking-total">{t("booking.total")} <strong>{formatMoney(booking.totals.totalMinor, booking.totals.currency, locale)}</strong></p>
|
|
93
|
+
</div>
|
|
64
94
|
{
|
|
65
95
|
booking.canCancel && !cancelled && cancelAction && (
|
|
66
|
-
<
|
|
67
|
-
<input type="hidden" name="intent" value="cancel" />
|
|
68
|
-
{booking.cancelBy && (
|
|
69
|
-
<p>
|
|
70
|
-
{cancelBefore}<time datetime={booking.cancelBy}>{at(booking.cancelBy)}</time>{cancelAfter}
|
|
71
|
-
</p>
|
|
72
|
-
)}
|
|
73
|
-
<button type="submit">{t("booking.cancel")}</button>
|
|
74
|
-
</form>
|
|
96
|
+
<CancelBooking action={cancelAction} cancelBy={booking.cancelBy} zone={zone} locale={locale} />
|
|
75
97
|
)
|
|
76
98
|
}
|
|
77
99
|
</section>
|
|
@@ -79,24 +101,95 @@ const notes = endedNotes({ ...booking, status }, locale);
|
|
|
79
101
|
<style>
|
|
80
102
|
.semics-booking-status {
|
|
81
103
|
box-sizing: border-box;
|
|
82
|
-
max-inline-size: 36rem;
|
|
83
104
|
color: var(--events-fg, #1a1a1a);
|
|
84
105
|
overflow-wrap: anywhere;
|
|
85
106
|
}
|
|
107
|
+
.semics-booking-status p {
|
|
108
|
+
margin: 0 0 0.5rem;
|
|
109
|
+
}
|
|
110
|
+
.semics-booking-status .semics-booking-event {
|
|
111
|
+
margin: 0 0 0.5rem;
|
|
112
|
+
font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
|
|
113
|
+
line-height: 1.2;
|
|
114
|
+
}
|
|
115
|
+
.semics-booking-session {
|
|
116
|
+
margin-block-end: 1.25rem;
|
|
117
|
+
}
|
|
118
|
+
.semics-booking-status .semics-booking-when {
|
|
119
|
+
margin: 0;
|
|
120
|
+
font-size: 1.125rem;
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
}
|
|
123
|
+
.semics-booking-status .semics-booking-venue {
|
|
124
|
+
margin: 0;
|
|
125
|
+
color: var(--events-muted, #4a4a4a);
|
|
126
|
+
}
|
|
127
|
+
.semics-booking-meta {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-wrap: wrap;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: 0.5rem 1rem;
|
|
132
|
+
margin-block-end: 0.75rem;
|
|
133
|
+
}
|
|
134
|
+
.semics-booking-meta p {
|
|
135
|
+
margin: 0;
|
|
136
|
+
}
|
|
137
|
+
.semics-booking-ref {
|
|
138
|
+
color: var(--events-muted, #4a4a4a);
|
|
139
|
+
}
|
|
140
|
+
.semics-booking-ref strong {
|
|
141
|
+
color: var(--events-fg, #1a1a1a);
|
|
142
|
+
letter-spacing: 0.04em;
|
|
143
|
+
}
|
|
86
144
|
.semics-status-badge {
|
|
87
145
|
display: inline-block;
|
|
88
|
-
padding: 0.125rem 0.
|
|
146
|
+
padding: 0.125rem 0.625rem;
|
|
89
147
|
border: 1px solid currentColor;
|
|
90
|
-
border-radius:
|
|
148
|
+
border-radius: 999px;
|
|
149
|
+
font-size: 0.875rem;
|
|
91
150
|
font-weight: 600;
|
|
92
151
|
}
|
|
93
152
|
.semics-booking-status[data-status="confirmed"] .semics-status-badge {
|
|
94
153
|
color: var(--events-success, #146c2e);
|
|
95
154
|
}
|
|
96
|
-
.semics-booking-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
155
|
+
.semics-booking-note {
|
|
156
|
+
color: var(--events-muted, #4a4a4a);
|
|
157
|
+
}
|
|
158
|
+
.semics-booking-order {
|
|
159
|
+
margin-block-start: 1.25rem;
|
|
160
|
+
padding-block-start: 1rem;
|
|
161
|
+
border-block-start: 1px solid color-mix(in srgb, var(--events-border, #6b6b6b) 30%, transparent);
|
|
162
|
+
}
|
|
163
|
+
.semics-lines {
|
|
164
|
+
margin: 0 0 0.75rem;
|
|
165
|
+
padding: 0;
|
|
166
|
+
list-style: none;
|
|
167
|
+
}
|
|
168
|
+
.semics-lines li + li {
|
|
169
|
+
margin-block-start: 0.25rem;
|
|
170
|
+
}
|
|
171
|
+
.semics-booking-people h3 {
|
|
172
|
+
margin: 0 0 0.25rem;
|
|
173
|
+
font-size: 0.8125rem;
|
|
174
|
+
letter-spacing: 0.06em;
|
|
175
|
+
text-transform: uppercase;
|
|
176
|
+
color: var(--events-muted, #4a4a4a);
|
|
177
|
+
}
|
|
178
|
+
.semics-booking-people ul {
|
|
179
|
+
margin: 0 0 0.75rem;
|
|
180
|
+
padding-inline-start: 1.25rem;
|
|
181
|
+
}
|
|
182
|
+
.semics-booking-status .semics-booking-total {
|
|
183
|
+
display: flex;
|
|
184
|
+
justify-content: space-between;
|
|
185
|
+
gap: 1rem;
|
|
186
|
+
margin: 0;
|
|
187
|
+
padding-block-start: 0.75rem;
|
|
188
|
+
border-block-start: 1px solid color-mix(in srgb, var(--events-border, #6b6b6b) 30%, transparent);
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
}
|
|
191
|
+
.semics-booking-total strong {
|
|
192
|
+
font-size: 1.125rem;
|
|
100
193
|
}
|
|
101
194
|
.semics-visually-hidden {
|
|
102
195
|
position: absolute;
|
|
@@ -181,7 +181,7 @@ const when = (iso: string) => {
|
|
|
181
181
|
aria-invalid={invalid("occurrence")}
|
|
182
182
|
aria-describedby={errId("occurrence")}
|
|
183
183
|
>
|
|
184
|
-
<legend>{t("widget.date")}</legend>
|
|
184
|
+
<legend class="semics-visually-hidden">{t("widget.date")}</legend>
|
|
185
185
|
<table role="grid" class="semics-calendar" aria-labelledby={monthId}>
|
|
186
186
|
<thead>
|
|
187
187
|
<tr>
|
|
@@ -510,23 +510,30 @@ const when = (iso: string) => {
|
|
|
510
510
|
import "../client/picker.ts";
|
|
511
511
|
</script>
|
|
512
512
|
|
|
513
|
+
|
|
513
514
|
<style>
|
|
515
|
+
/* One card with even, generous padding; groups read as sections with small headings, not boxes (T157). */
|
|
514
516
|
.semics-booking-widget {
|
|
515
517
|
--_fg: var(--events-fg, #1a1a1a);
|
|
516
518
|
--_muted: var(--events-muted, #4a4a4a);
|
|
517
519
|
--_bg: var(--events-bg, #ffffff);
|
|
518
520
|
--_border: var(--events-border, #6b6b6b);
|
|
521
|
+
--_line: color-mix(in srgb, var(--_border) 30%, transparent);
|
|
522
|
+
--_tint: color-mix(in srgb, var(--_accent) 7%, var(--_bg));
|
|
519
523
|
--_accent: var(--events-accent, #0b57d0);
|
|
520
524
|
--_accent-fg: var(--events-accent-fg, #ffffff);
|
|
521
525
|
--_error: var(--events-error, #b3261e);
|
|
522
526
|
--_radius: var(--events-radius, 6px);
|
|
527
|
+
--_pad: clamp(1.25rem, 0.75rem + 2.5vw, 2rem);
|
|
523
528
|
box-sizing: border-box;
|
|
524
|
-
max-inline-size:
|
|
525
|
-
padding:
|
|
526
|
-
border: 1px solid var(--
|
|
527
|
-
border-radius: var(--_radius);
|
|
529
|
+
max-inline-size: 38rem;
|
|
530
|
+
padding: var(--_pad);
|
|
531
|
+
border: 1px solid var(--_line);
|
|
532
|
+
border-radius: calc(var(--_radius) + 6px);
|
|
528
533
|
background: var(--_bg);
|
|
534
|
+
box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 24px rgb(0 0 0 / 0.06);
|
|
529
535
|
color: var(--_fg);
|
|
536
|
+
line-height: 1.5;
|
|
530
537
|
overflow-wrap: anywhere;
|
|
531
538
|
}
|
|
532
539
|
.semics-booking-widget *,
|
|
@@ -535,37 +542,40 @@ const when = (iso: string) => {
|
|
|
535
542
|
box-sizing: border-box;
|
|
536
543
|
}
|
|
537
544
|
.semics-booking-widget h2 {
|
|
538
|
-
margin: 0 0
|
|
539
|
-
font-size: 1.
|
|
545
|
+
margin: 0 0 1.25rem;
|
|
546
|
+
font-size: 1.375rem;
|
|
547
|
+
line-height: 1.25;
|
|
540
548
|
}
|
|
541
549
|
.semics-booking-widget form {
|
|
542
550
|
display: grid;
|
|
543
551
|
grid-template-columns: minmax(0, 1fr);
|
|
544
|
-
gap:
|
|
552
|
+
gap: 1.25rem;
|
|
545
553
|
}
|
|
546
554
|
.semics-booking-widget .semics-waitlist {
|
|
547
|
-
margin-block-start: 1.
|
|
548
|
-
padding-block-start:
|
|
549
|
-
border-block-start: 1px solid var(--
|
|
555
|
+
margin-block-start: 1.5rem;
|
|
556
|
+
padding-block-start: 1.5rem;
|
|
557
|
+
border-block-start: 1px solid var(--_line);
|
|
550
558
|
}
|
|
551
559
|
.semics-waitlist h3,
|
|
552
560
|
.semics-waitlist p {
|
|
553
561
|
margin: 0;
|
|
554
562
|
}
|
|
555
|
-
.semics-
|
|
556
|
-
margin: 0;
|
|
557
|
-
padding: 0
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
563
|
+
.semics-booking-widget legend {
|
|
564
|
+
margin: 0 0 0.5rem;
|
|
565
|
+
padding: 0;
|
|
566
|
+
font-size: 0.8125rem;
|
|
567
|
+
font-weight: 700;
|
|
568
|
+
letter-spacing: 0.06em;
|
|
569
|
+
text-transform: uppercase;
|
|
570
|
+
color: var(--_muted);
|
|
561
571
|
}
|
|
572
|
+
.semics-tickets,
|
|
562
573
|
.semics-questions {
|
|
563
574
|
display: grid;
|
|
564
575
|
gap: 0.75rem;
|
|
565
576
|
margin: 0;
|
|
566
|
-
padding: 0
|
|
567
|
-
border:
|
|
568
|
-
border-radius: var(--_radius);
|
|
577
|
+
padding: 0;
|
|
578
|
+
border: 0;
|
|
569
579
|
min-inline-size: 0;
|
|
570
580
|
}
|
|
571
581
|
.semics-check {
|
|
@@ -580,51 +590,68 @@ const when = (iso: string) => {
|
|
|
580
590
|
min-block-size: 1.25rem;
|
|
581
591
|
inline-size: 1.25rem;
|
|
582
592
|
margin: 0;
|
|
593
|
+
accent-color: var(--_accent);
|
|
583
594
|
}
|
|
584
595
|
.semics-hint {
|
|
585
596
|
color: var(--_muted);
|
|
586
597
|
}
|
|
598
|
+
.semics-picker-field {
|
|
599
|
+
gap: 0.75rem;
|
|
600
|
+
}
|
|
587
601
|
.semics-picker-nav {
|
|
588
602
|
display: flex;
|
|
589
603
|
flex-wrap: wrap;
|
|
590
|
-
align-items:
|
|
591
|
-
gap: 0.
|
|
604
|
+
align-items: center;
|
|
605
|
+
gap: 0.5rem;
|
|
592
606
|
}
|
|
593
607
|
.semics-picker-month {
|
|
594
608
|
margin: 0;
|
|
595
609
|
margin-inline-end: auto;
|
|
596
|
-
font-
|
|
610
|
+
font-size: 1.125rem;
|
|
611
|
+
font-weight: 700;
|
|
597
612
|
}
|
|
598
613
|
.semics-picker-nav a {
|
|
614
|
+
display: inline-flex;
|
|
615
|
+
align-items: center;
|
|
616
|
+
min-block-size: 2.25rem;
|
|
617
|
+
padding: 0.25rem 0.875rem;
|
|
618
|
+
border: 1px solid var(--_line);
|
|
619
|
+
border-radius: 999px;
|
|
599
620
|
color: var(--_accent);
|
|
600
|
-
|
|
621
|
+
font-size: 0.9375rem;
|
|
622
|
+
text-decoration: none;
|
|
623
|
+
}
|
|
624
|
+
.semics-picker-nav a:hover {
|
|
625
|
+
border-color: var(--_accent);
|
|
601
626
|
}
|
|
602
627
|
.semics-picker {
|
|
603
628
|
display: grid;
|
|
604
|
-
gap:
|
|
629
|
+
gap: 1rem;
|
|
605
630
|
margin: 0;
|
|
606
|
-
padding: 0
|
|
607
|
-
border:
|
|
608
|
-
border-radius: var(--_radius);
|
|
631
|
+
padding: 0;
|
|
632
|
+
border: 0;
|
|
609
633
|
min-inline-size: 0;
|
|
610
634
|
}
|
|
611
635
|
.semics-picker p {
|
|
612
636
|
margin: 0;
|
|
613
637
|
}
|
|
638
|
+
/* Room between the days: cells 6px apart, buttons at least 44px tall. */
|
|
614
639
|
.semics-calendar {
|
|
615
|
-
inline-size: 100
|
|
616
|
-
|
|
640
|
+
inline-size: calc(100% + 0.75rem);
|
|
641
|
+
margin: -0.375rem;
|
|
642
|
+
border-collapse: separate;
|
|
643
|
+
border-spacing: 0.375rem;
|
|
617
644
|
table-layout: fixed;
|
|
618
645
|
text-align: center;
|
|
619
646
|
}
|
|
620
647
|
.semics-calendar th {
|
|
621
|
-
padding-block: 0.25rem;
|
|
622
|
-
font-weight:
|
|
623
|
-
font-size: 0.
|
|
648
|
+
padding-block: 0 0.25rem;
|
|
649
|
+
font-weight: 600;
|
|
650
|
+
font-size: 0.8125rem;
|
|
624
651
|
color: var(--_muted);
|
|
625
652
|
}
|
|
626
653
|
.semics-calendar td {
|
|
627
|
-
padding:
|
|
654
|
+
padding: 0;
|
|
628
655
|
}
|
|
629
656
|
.semics-booking-widget .semics-calendar button,
|
|
630
657
|
.semics-booking-widget .semics-times button {
|
|
@@ -633,11 +660,20 @@ const when = (iso: string) => {
|
|
|
633
660
|
border: 1px solid var(--_accent);
|
|
634
661
|
background: var(--_bg);
|
|
635
662
|
color: var(--_accent);
|
|
663
|
+
font-weight: 600;
|
|
664
|
+
}
|
|
665
|
+
.semics-booking-widget .semics-calendar button {
|
|
666
|
+
block-size: clamp(2.75rem, 2rem + 2vw, 3.25rem);
|
|
667
|
+
}
|
|
668
|
+
.semics-booking-widget .semics-calendar button:not([aria-pressed="true"]):hover,
|
|
669
|
+
.semics-booking-widget .semics-times button:not([aria-disabled="true"], [aria-checked="true"]):hover {
|
|
670
|
+
background: var(--_tint);
|
|
636
671
|
}
|
|
637
672
|
.semics-booking-widget .semics-calendar button.semics-day-full,
|
|
638
673
|
.semics-booking-widget .semics-times button[aria-disabled="true"] {
|
|
639
|
-
border-color: var(--
|
|
674
|
+
border-color: var(--_line);
|
|
640
675
|
color: var(--_muted);
|
|
676
|
+
font-weight: 400;
|
|
641
677
|
text-decoration: line-through;
|
|
642
678
|
}
|
|
643
679
|
.semics-booking-widget .semics-times button[aria-disabled="true"] {
|
|
@@ -649,37 +685,47 @@ const when = (iso: string) => {
|
|
|
649
685
|
color: var(--_accent-fg);
|
|
650
686
|
}
|
|
651
687
|
.semics-day-none {
|
|
652
|
-
display:
|
|
653
|
-
|
|
688
|
+
display: grid;
|
|
689
|
+
place-items: center;
|
|
690
|
+
block-size: clamp(2.75rem, 2rem + 2vw, 3.25rem);
|
|
654
691
|
color: var(--_muted);
|
|
655
692
|
}
|
|
656
693
|
.semics-times {
|
|
657
694
|
display: grid;
|
|
658
|
-
grid-template-columns: repeat(auto-fill, minmax(
|
|
695
|
+
grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
|
|
659
696
|
gap: 0.5rem;
|
|
660
697
|
}
|
|
661
698
|
.semics-booking-widget .semics-times button {
|
|
662
699
|
display: grid;
|
|
663
700
|
justify-items: center;
|
|
701
|
+
padding: 0.5rem;
|
|
664
702
|
}
|
|
665
703
|
.semics-places {
|
|
666
|
-
font-size: 0.
|
|
704
|
+
font-size: 0.8125rem;
|
|
705
|
+
font-weight: 400;
|
|
667
706
|
}
|
|
668
707
|
.semics-ticket {
|
|
669
708
|
display: flex;
|
|
670
709
|
flex-wrap: wrap;
|
|
671
710
|
align-items: center;
|
|
672
711
|
justify-content: space-between;
|
|
673
|
-
gap: 0.5rem;
|
|
674
|
-
padding-block: 0.
|
|
712
|
+
gap: 0.5rem 1rem;
|
|
713
|
+
padding-block: 0.5rem;
|
|
714
|
+
border-block-end: 1px solid var(--_line);
|
|
715
|
+
}
|
|
716
|
+
.semics-ticket:last-of-type {
|
|
717
|
+
border-block-end: 0;
|
|
675
718
|
}
|
|
676
719
|
.semics-ticket label {
|
|
677
720
|
display: flex;
|
|
678
721
|
flex-wrap: wrap;
|
|
679
|
-
gap: 0 0.
|
|
722
|
+
gap: 0 0.75rem;
|
|
680
723
|
flex: 1 1 10rem;
|
|
681
724
|
min-inline-size: 0;
|
|
682
725
|
}
|
|
726
|
+
.semics-ticket-name {
|
|
727
|
+
font-weight: 600;
|
|
728
|
+
}
|
|
683
729
|
.semics-ticket-price,
|
|
684
730
|
.semics-ticket-soldout {
|
|
685
731
|
color: var(--_muted);
|
|
@@ -690,7 +736,10 @@ const when = (iso: string) => {
|
|
|
690
736
|
.semics-field {
|
|
691
737
|
display: grid;
|
|
692
738
|
grid-template-columns: minmax(0, 1fr);
|
|
693
|
-
gap: 0.
|
|
739
|
+
gap: 0.375rem;
|
|
740
|
+
}
|
|
741
|
+
.semics-field > label {
|
|
742
|
+
font-weight: 500;
|
|
694
743
|
}
|
|
695
744
|
.semics-field select {
|
|
696
745
|
inline-size: 100%;
|
|
@@ -704,7 +753,7 @@ const when = (iso: string) => {
|
|
|
704
753
|
}
|
|
705
754
|
.semics-booking-widget input,
|
|
706
755
|
.semics-booking-widget select {
|
|
707
|
-
padding: 0.
|
|
756
|
+
padding: 0.5rem 0.75rem;
|
|
708
757
|
border: 1px solid var(--_border);
|
|
709
758
|
border-radius: var(--_radius);
|
|
710
759
|
background: var(--_bg);
|
|
@@ -723,7 +772,7 @@ const when = (iso: string) => {
|
|
|
723
772
|
display: none;
|
|
724
773
|
}
|
|
725
774
|
.semics-form-alert {
|
|
726
|
-
padding: 0.
|
|
775
|
+
padding: 0.75rem 1rem;
|
|
727
776
|
border: 1px solid var(--_error);
|
|
728
777
|
border-radius: var(--_radius);
|
|
729
778
|
}
|
|
@@ -731,16 +780,28 @@ const when = (iso: string) => {
|
|
|
731
780
|
margin: 0;
|
|
732
781
|
font-weight: 600;
|
|
733
782
|
}
|
|
783
|
+
/* The summary above Book. */
|
|
734
784
|
.semics-total {
|
|
785
|
+
display: flex;
|
|
786
|
+
flex-wrap: wrap;
|
|
787
|
+
justify-content: space-between;
|
|
788
|
+
gap: 0.25rem 1rem;
|
|
735
789
|
margin: 0;
|
|
790
|
+
padding: 1rem 1.25rem;
|
|
791
|
+
border-radius: var(--_radius);
|
|
792
|
+
background: var(--_tint);
|
|
793
|
+
}
|
|
794
|
+
.semics-total strong {
|
|
795
|
+
font-size: 1.125rem;
|
|
736
796
|
}
|
|
737
797
|
.semics-booking-widget button {
|
|
738
798
|
justify-self: start;
|
|
739
|
-
padding: 0.
|
|
799
|
+
padding: 0.75rem 2rem;
|
|
740
800
|
border: 0;
|
|
741
801
|
border-radius: var(--_radius);
|
|
742
802
|
background: var(--_accent);
|
|
743
803
|
color: var(--_accent-fg);
|
|
804
|
+
font-weight: 600;
|
|
744
805
|
cursor: pointer;
|
|
745
806
|
}
|
|
746
807
|
.semics-promo-row {
|
|
@@ -770,6 +831,14 @@ const when = (iso: string) => {
|
|
|
770
831
|
outline: 3px solid var(--_accent);
|
|
771
832
|
outline-offset: 2px;
|
|
772
833
|
}
|
|
834
|
+
.semics-visually-hidden {
|
|
835
|
+
position: absolute;
|
|
836
|
+
inline-size: 1px;
|
|
837
|
+
block-size: 1px;
|
|
838
|
+
overflow: hidden;
|
|
839
|
+
clip-path: inset(50%);
|
|
840
|
+
white-space: nowrap;
|
|
841
|
+
}
|
|
773
842
|
[hidden] {
|
|
774
843
|
display: none !important;
|
|
775
844
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
// <CancelBooking>: the quiet "Cancel booking" action at the foot of the booking page (T157). The button only
|
|
3
|
+
// opens a confirmation (a `<details>`, no JavaScript needed); the form posts `intent=cancel` back to the page.
|
|
4
|
+
import { around, pickLocale, translator } from "../i18n/index";
|
|
5
|
+
import { zonedAt } from "./lib/list";
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
/** Where the cancel form posts. */
|
|
9
|
+
action: string;
|
|
10
|
+
/** The last moment to cancel, when there is one. */
|
|
11
|
+
cancelBy?: string | undefined;
|
|
12
|
+
/** The event's zone, for `cancelBy`. */
|
|
13
|
+
zone?: string | null | undefined;
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { action, cancelBy, zone } = Astro.props;
|
|
18
|
+
const locale = pickLocale(Astro.props.locale, Astro.currentLocale);
|
|
19
|
+
const { t, lang, dir } = translator(locale);
|
|
20
|
+
const [cancelBefore, cancelAfter] = around(t("booking.cancelUntil"), "time");
|
|
21
|
+
---
|
|
22
|
+
<details class="semics-events semics-cancel" lang={lang} dir={dir} data-testid="booking-cancel">
|
|
23
|
+
<summary>{t("booking.cancel")}</summary>
|
|
24
|
+
<form method="post" action={action}>
|
|
25
|
+
<input type="hidden" name="intent" value="cancel" />
|
|
26
|
+
{cancelBy && (
|
|
27
|
+
<p>
|
|
28
|
+
{cancelBefore}<time datetime={cancelBy}>{zonedAt(cancelBy, zone, locale)}</time>{cancelAfter}
|
|
29
|
+
</p>
|
|
30
|
+
)}
|
|
31
|
+
<p>{t("booking.cancelConfirm")}</p>
|
|
32
|
+
<button type="submit">{t("booking.cancelYes")}</button>
|
|
33
|
+
</form>
|
|
34
|
+
</details>
|
|
35
|
+
|
|
36
|
+
<style>
|
|
37
|
+
.semics-cancel {
|
|
38
|
+
margin-block: 1.5rem 0;
|
|
39
|
+
color: var(--events-fg, #1a1a1a);
|
|
40
|
+
}
|
|
41
|
+
.semics-cancel summary {
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
min-block-size: 2.75rem;
|
|
45
|
+
color: var(--events-muted, #4a4a4a);
|
|
46
|
+
text-decoration: underline;
|
|
47
|
+
text-underline-offset: 0.2em;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
50
|
+
.semics-cancel form {
|
|
51
|
+
margin-block-start: 0.5rem;
|
|
52
|
+
padding: 1rem 1.25rem;
|
|
53
|
+
border: 1px solid var(--events-error, #b3261e);
|
|
54
|
+
border-radius: var(--events-radius, 6px);
|
|
55
|
+
background: var(--events-bg, #ffffff);
|
|
56
|
+
}
|
|
57
|
+
.semics-cancel p {
|
|
58
|
+
margin: 0 0 0.75rem;
|
|
59
|
+
}
|
|
60
|
+
.semics-cancel button {
|
|
61
|
+
font: inherit;
|
|
62
|
+
min-block-size: 2.75rem;
|
|
63
|
+
padding: 0.5rem 1.25rem;
|
|
64
|
+
border: 1px solid var(--events-error, #b3261e);
|
|
65
|
+
border-radius: var(--events-radius, 6px);
|
|
66
|
+
background: var(--events-bg, #ffffff);
|
|
67
|
+
color: var(--events-error, #b3261e);
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
.semics-cancel :focus-visible {
|
|
72
|
+
outline: 3px solid var(--events-accent, #0b57d0);
|
|
73
|
+
outline-offset: 2px;
|
|
74
|
+
}
|
|
75
|
+
@media print {
|
|
76
|
+
.semics-cancel {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The organiser at the foot of the plugins' own pages (T157): the site's name and, when the site gives one,
|
|
3
|
+
// its address (`page.brand.address`). It stays on a printed booking, where the brand bar is hidden.
|
|
4
|
+
import { pickLocale, translator } from "../i18n/index";
|
|
5
|
+
import type { PageBrand } from "./lib/page";
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
brand?: PageBrand | undefined;
|
|
9
|
+
locale?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { brand } = Astro.props;
|
|
13
|
+
const { t } = translator(pickLocale(Astro.props.locale, Astro.currentLocale));
|
|
14
|
+
---
|
|
15
|
+
{
|
|
16
|
+
brand && (
|
|
17
|
+
<footer class="semics-page-organiser" data-testid="page-organiser">
|
|
18
|
+
<p>{t("booking.organiser", { name: brand.name })}</p>
|
|
19
|
+
{brand.address && <address>{brand.address}</address>}
|
|
20
|
+
</footer>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -25,10 +25,7 @@ const spoken = code.replace(/[^A-Za-z0-9]/g, "").split("").join(" ");
|
|
|
25
25
|
const matrix = qrPath(qr);
|
|
26
26
|
const box = matrix ? matrix.size + 8 : 0;
|
|
27
27
|
---
|
|
28
|
-
<article class="semics-events semics-ticket-pass" lang={lang} dir={dir} data-testid="ticket-pass" data-status={status}>
|
|
29
|
-
{event && <p class="semics-pass-event">{event}</p>}
|
|
30
|
-
<h3 class="semics-pass-name">{name}</h3>
|
|
31
|
-
{ticket && <p class="semics-pass-ticket">{ticket}</p>}
|
|
28
|
+
<article class="semics-events semics-ticket-pass" lang={lang} dir={dir} data-testid="ticket-pass" data-status={status} data-qr={matrix ? "" : undefined}>
|
|
32
29
|
{matrix && (
|
|
33
30
|
<svg
|
|
34
31
|
class="semics-pass-qr"
|
|
@@ -42,18 +39,29 @@ const box = matrix ? matrix.size + 8 : 0;
|
|
|
42
39
|
<path d={matrix.d} fill="#000000" />
|
|
43
40
|
</svg>
|
|
44
41
|
)}
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
<div class="semics-pass-text">
|
|
43
|
+
{event && <p class="semics-pass-event">{event}</p>}
|
|
44
|
+
<h3 class="semics-pass-name">{name}</h3>
|
|
45
|
+
{ticket && <p class="semics-pass-ticket">{ticket}</p>}
|
|
46
|
+
<p class="semics-pass-code-label">{t("pass.code")}</p>
|
|
47
|
+
<p class="semics-pass-code">
|
|
48
|
+
<span aria-hidden="true" data-testid="ticket-code">{code}</span>
|
|
49
|
+
<span class="semics-visually-hidden">{spoken}</span>
|
|
50
|
+
</p>
|
|
51
|
+
{status && status !== "valid" && <p class="semics-pass-status">{statusText}</p>}
|
|
52
|
+
</div>
|
|
51
53
|
</article>
|
|
52
54
|
|
|
53
55
|
<style>
|
|
56
|
+
/* The QR beside the attendee and the code (T157); stacked on a narrow screen. */
|
|
54
57
|
.semics-ticket-pass {
|
|
55
58
|
box-sizing: border-box;
|
|
56
|
-
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 0.75rem 1.25rem;
|
|
63
|
+
max-inline-size: 32rem;
|
|
64
|
+
margin-block: 0 0.75rem;
|
|
57
65
|
padding: 1rem;
|
|
58
66
|
border: 2px dashed var(--events-border, #6b6b6b);
|
|
59
67
|
border-radius: var(--events-radius, 6px);
|
|
@@ -61,6 +69,10 @@ const box = matrix ? matrix.size + 8 : 0;
|
|
|
61
69
|
color: var(--events-fg, #1a1a1a);
|
|
62
70
|
overflow-wrap: anywhere;
|
|
63
71
|
}
|
|
72
|
+
.semics-pass-text {
|
|
73
|
+
flex: 1 1 12rem;
|
|
74
|
+
min-inline-size: 0;
|
|
75
|
+
}
|
|
64
76
|
.semics-ticket-pass p,
|
|
65
77
|
.semics-ticket-pass h3 {
|
|
66
78
|
margin: 0 0 0.25rem;
|
|
@@ -70,19 +82,27 @@ const box = matrix ? matrix.size + 8 : 0;
|
|
|
70
82
|
.semics-pass-code-label {
|
|
71
83
|
color: var(--events-muted, #4a4a4a);
|
|
72
84
|
}
|
|
85
|
+
.semics-pass-code-label {
|
|
86
|
+
font-size: 0.875rem;
|
|
87
|
+
}
|
|
73
88
|
/* Black on white in every theme: phone cameras read dark modules on a light ground. */
|
|
74
89
|
.semics-pass-qr {
|
|
75
90
|
display: block;
|
|
76
|
-
|
|
91
|
+
flex: none;
|
|
92
|
+
inline-size: min(100%, 10rem);
|
|
77
93
|
block-size: auto;
|
|
78
94
|
aspect-ratio: 1;
|
|
79
|
-
margin: 0.5rem 0;
|
|
80
95
|
}
|
|
81
96
|
.semics-pass-code {
|
|
82
97
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
83
|
-
font-size:
|
|
84
|
-
letter-spacing: 0.
|
|
98
|
+
font-size: 1rem;
|
|
99
|
+
letter-spacing: 0.04em;
|
|
85
100
|
font-weight: 700;
|
|
101
|
+
word-break: break-all;
|
|
102
|
+
}
|
|
103
|
+
/* Without a QR the code is what the door types in: a little larger. */
|
|
104
|
+
.semics-ticket-pass:not([data-qr]) .semics-pass-code {
|
|
105
|
+
font-size: 1.125rem;
|
|
86
106
|
}
|
|
87
107
|
.semics-visually-hidden {
|
|
88
108
|
position: absolute;
|
|
@@ -92,4 +112,14 @@ const box = matrix ? matrix.size + 8 : 0;
|
|
|
92
112
|
clip-path: inset(50%);
|
|
93
113
|
white-space: nowrap;
|
|
94
114
|
}
|
|
115
|
+
@media print {
|
|
116
|
+
.semics-ticket-pass {
|
|
117
|
+
break-inside: avoid;
|
|
118
|
+
border-color: #000000;
|
|
119
|
+
color: #000000;
|
|
120
|
+
}
|
|
121
|
+
.semics-pass-qr {
|
|
122
|
+
inline-size: 35mm;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
95
125
|
</style>
|
package/src/astro/lib/list.ts
CHANGED
|
@@ -62,31 +62,26 @@ const WHEN: Intl.DateTimeFormatOptions = {
|
|
|
62
62
|
timeZoneName: "short",
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
month: "short",
|
|
68
|
-
year: "numeric",
|
|
69
|
-
hour: "2-digit",
|
|
70
|
-
minute: "2-digit",
|
|
71
|
-
hourCycle: "h23",
|
|
72
|
-
};
|
|
65
|
+
/** The booking widget's and the waiver page's date format: full date, short time. */
|
|
66
|
+
const AT: Intl.DateTimeFormatOptions = { dateStyle: "full", timeStyle: "short" };
|
|
73
67
|
|
|
74
68
|
/**
|
|
75
|
-
* A
|
|
76
|
-
* ("9
|
|
77
|
-
*
|
|
69
|
+
* A time on a customer page (a deadline, a hold, the booked session): local time in the event's own zone, as the
|
|
70
|
+
* session's time line reads ("Monday 9 November 2026 at 15:09", T157), without the zone's name. A missing or
|
|
71
|
+
* unknown zone shows UTC and says so; a value that is not a date is shown as it is.
|
|
78
72
|
*/
|
|
79
73
|
export function zonedAt(iso: string, timezone: string | null | undefined, locale: string): string {
|
|
80
74
|
const ms = Date.parse(iso);
|
|
81
75
|
if (!Number.isFinite(ms)) return iso;
|
|
82
|
-
const
|
|
76
|
+
const known = Boolean(timezone && isValidTimeZone(timezone));
|
|
77
|
+
const zone = known ? (timezone as string) : "UTC";
|
|
83
78
|
let time: string;
|
|
84
79
|
try {
|
|
85
80
|
time = formatInZone(ms, zone, locale, AT);
|
|
86
81
|
} catch {
|
|
87
82
|
time = formatInZone(ms, zone, "en-GB", AT); // A locale `Intl` refuses, such as `en_GB`.
|
|
88
83
|
}
|
|
89
|
-
return `${time} (${zone})`;
|
|
84
|
+
return known ? time : `${time} (${zone})`;
|
|
90
85
|
}
|
|
91
86
|
|
|
92
87
|
const BADGES = { cancelled: "list.badge.cancelled", closed: "list.badge.closed", paused: "list.badge.paused" } as const;
|
package/src/astro/lib/page.ts
CHANGED
|
@@ -27,12 +27,24 @@ export const THEME_PROPERTIES = [
|
|
|
27
27
|
] as const;
|
|
28
28
|
export type ThemeProperty = (typeof THEME_PROPERTIES)[number];
|
|
29
29
|
export interface PageBrand {
|
|
30
|
-
/** The site's name: the link's text, or the logo's alternative text. */
|
|
30
|
+
/** The site's name: the link's text, or the logo's alternative text. Also the organiser at the page's foot. */
|
|
31
31
|
name: string;
|
|
32
32
|
/** Where it links, a path on this site (default `/`). */
|
|
33
33
|
href?: string;
|
|
34
34
|
/** A logo, a path on this site. */
|
|
35
35
|
logo?: string;
|
|
36
|
+
/** The organiser's postal address, one line, at the page's foot and on a printed booking (T157). */
|
|
37
|
+
address?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** One line of text for people: 1 to 300 characters, no control characters (line breaks included). */
|
|
41
|
+
function oneLine(value: unknown): boolean {
|
|
42
|
+
if (typeof value !== "string" || !value.trim() || value.length > 300) return false;
|
|
43
|
+
for (let i = 0; i < value.length; i++) {
|
|
44
|
+
const unit = value.charCodeAt(i);
|
|
45
|
+
if (unit <= 0x1f || unit === 0x7f) return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
export interface PageOptions {
|
|
@@ -68,6 +80,7 @@ export function checkPageOptions(page: PageOptions = {}): PageOptions {
|
|
|
68
80
|
if (typeof brand.name !== "string" || !brand.name.trim()) refuse("brand.name");
|
|
69
81
|
if (brand.href !== undefined && !SITE_PATH.test(brand.href)) refuse("brand.href");
|
|
70
82
|
if (brand.logo !== undefined && !SITE_PATH.test(brand.logo)) refuse("brand.logo");
|
|
83
|
+
if (brand.address !== undefined && !oneLine(brand.address)) refuse("brand.address");
|
|
71
84
|
}
|
|
72
85
|
return page;
|
|
73
86
|
}
|
|
@@ -82,23 +95,39 @@ export const PAGE_CSS = `*,*::before,*::after{box-sizing:border-box}
|
|
|
82
95
|
html{color-scheme:light;-webkit-text-size-adjust:100%}
|
|
83
96
|
body.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;
|
|
84
97
|
--esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}
|
|
85
|
-
.semics-page-brand{max-inline-size:
|
|
98
|
+
.semics-page-brand{max-inline-size:40rem;margin-inline:auto;padding:1.25rem 1rem 0;font-family:var(--events-heading-font, inherit);font-weight:600}
|
|
86
99
|
.semics-page-brand a{color:var(--events-heading-fg, inherit);text-decoration:none}
|
|
87
100
|
.semics-page-brand img{display:block;block-size:2.5rem;inline-size:auto;max-inline-size:100%}
|
|
88
|
-
.semics-page-main{max-inline-size:
|
|
101
|
+
.semics-page-main{max-inline-size:40rem;margin-inline:auto;padding:1.5rem 1rem 2rem}
|
|
89
102
|
:where(.semics-page) :is(h1,h2,h3){margin:0 0 .75rem;font-family:var(--events-heading-font, inherit);color:var(--events-heading-fg, inherit);line-height:1.2}
|
|
90
|
-
:where(.semics-page) h1{font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}
|
|
103
|
+
:where(.semics-page) h1{margin-block-end:1.25rem;font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}
|
|
91
104
|
:where(.semics-page) h2{font-size:1.25rem}
|
|
92
105
|
:where(.semics-page) h3{font-size:1.0625rem}
|
|
93
106
|
:where(.semics-page) p{margin:0 0 .75rem}
|
|
94
107
|
:where(.semics-page) a{color:var(--events-accent, #0b57d0);text-underline-offset:.2em}
|
|
95
108
|
:where(.semics-page) :focus-visible{outline:3px solid var(--events-accent, #0b57d0);outline-offset:2px}
|
|
96
|
-
:where(.semics-page-main
|
|
97
|
-
:where(.semics-page
|
|
98
|
-
:where(.semics-page)
|
|
109
|
+
:where(.semics-page-main > section,.semics-page-main > form:not([hidden]),.semics-page-main > .semics-ceremony){margin-block:0 1.25rem;padding:clamp(1.25rem,.9rem + 1.8vw,1.75rem);background:var(--events-bg, #ffffff);border:1px solid color-mix(in srgb,var(--events-border, #6b6b6b) 30%,transparent);border-radius:calc(var(--events-radius, 6px) + 6px);box-shadow:0 1px 2px rgb(0 0 0 / .04),0 6px 24px rgb(0 0 0 / .05);max-inline-size:none}
|
|
110
|
+
:where(.semics-page-main > section,.semics-page-main > form,.semics-page-main > .semics-ceremony) > :last-child{margin-block-end:0}
|
|
111
|
+
:where(.semics-page) [role="alert"]{padding:.75rem 1rem;border:1px solid var(--events-error, #b3261e);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-error, #b3261e)}
|
|
112
|
+
:where(.semics-page) :is(input:not([type="checkbox"],[type="radio"],[type="hidden"]),select,textarea){font:inherit;inline-size:100%;min-block-size:2.75rem;padding:.5rem .75rem;border:1px solid var(--events-border, #6b6b6b);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-fg, #1a1a1a)}
|
|
99
113
|
:where(.semics-page) label{display:block}
|
|
100
|
-
:where(.semics-page) fieldset{min-inline-size:0;margin:0 0
|
|
101
|
-
:where(.semics-page)
|
|
114
|
+
:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}
|
|
115
|
+
:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}
|
|
116
|
+
:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}
|
|
117
|
+
.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}
|
|
118
|
+
.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}
|
|
119
|
+
.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}
|
|
120
|
+
.semics-page-organiser p{margin:0}
|
|
121
|
+
.semics-page-organiser address{font-style:normal}
|
|
122
|
+
@media print{
|
|
123
|
+
@page{margin:15mm}
|
|
124
|
+
body.semics-page{min-block-size:0;background:#ffffff;color:#000000;font-size:11pt}
|
|
125
|
+
.semics-page-brand,.semics-page-actions,.semics-page-main form,.semics-page-main button,.semics-page-main details,.semics-add-to-calendar,[data-semics-payment-live]{display:none !important}
|
|
126
|
+
.semics-page-main{max-inline-size:none;padding:0}
|
|
127
|
+
:where(.semics-page-main > section,.semics-page-main > .semics-ceremony){box-shadow:none;border-color:#999999;break-inside:avoid}
|
|
128
|
+
.semics-ticket-pass{break-inside:avoid}
|
|
129
|
+
.semics-page-organiser{max-inline-size:none;padding:1rem 0 0;color:#000000}
|
|
130
|
+
}
|
|
102
131
|
`;
|
|
103
132
|
|
|
104
133
|
/** The stylesheet for a page: the defaults, then the site's theme. Exact: the signing page hashes this text. */
|
package/src/astro/lib/widget.ts
CHANGED
|
@@ -76,8 +76,8 @@ export interface BookingView {
|
|
|
76
76
|
lines: Array<{ ticketTypeId: string; qty: number }>;
|
|
77
77
|
totals: { totalMinor: number; currency: string };
|
|
78
78
|
holdExpiresAt?: string;
|
|
79
|
-
/** The event's public info (`timezone`
|
|
80
|
-
event?: { title?: string; startsAt?: string; timezone?: string | null; slug?: string | null };
|
|
79
|
+
/** The event's public info: the booked session (`startsAt`, in `timezone`) and `venue` lead the page (T157); `slug` for "Book again". */
|
|
80
|
+
event?: { title?: string; startsAt?: string; timezone?: string | null; venue?: string | null; slug?: string | null };
|
|
81
81
|
/** Why the organiser declined (`status: "declined"`), when they said. */
|
|
82
82
|
declineReason?: string | null;
|
|
83
83
|
/** Declined, a price was due and no money was taken (`closeBooking`). */
|
package/src/client/picker.ts
CHANGED
|
@@ -60,10 +60,14 @@ export function enhancePicker(picker: HTMLElement): void {
|
|
|
60
60
|
const radios = (group: HTMLElement) => Array.from(group.querySelectorAll<HTMLButtonElement>('[role="radio"]'));
|
|
61
61
|
const isOpen = (b: HTMLElement) => b.getAttribute("aria-disabled") !== "true";
|
|
62
62
|
|
|
63
|
+
// The picker's own changes, which `showSelected` (below) need not follow.
|
|
64
|
+
let own = false;
|
|
63
65
|
const setSelect = (value: string) => {
|
|
64
66
|
if (select.value === value) return;
|
|
65
67
|
select.value = value;
|
|
68
|
+
own = true;
|
|
66
69
|
select.dispatchEvent(new Event("change", { bubbles: true }));
|
|
70
|
+
own = false;
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
const chooseTime = (button: HTMLButtonElement, focus: boolean) => {
|
|
@@ -127,15 +131,22 @@ export function enhancePicker(picker: HTMLElement): void {
|
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
|
|
130
|
-
// A value the browser kept (back/forward, a failed submit): show its day and time.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
// A value the browser kept (back/forward, a failed submit): show its day and time. Also when a script sets
|
|
135
|
+
// the select later and says so with `change` (the suite's refused-form restore, whose script may run after
|
|
136
|
+
// this one, T157); the picker's own changes are skipped.
|
|
137
|
+
const showSelected = () => {
|
|
138
|
+
if (own) return;
|
|
139
|
+
const kept =
|
|
140
|
+
select.value && picker.querySelector<HTMLButtonElement>(`[data-occurrence="${CSS.escape(select.value)}"]`);
|
|
141
|
+
const keptDay =
|
|
142
|
+
kept && dayButtons.find((b) => b.dataset.day === kept.closest<HTMLElement>("[data-times]")?.dataset.times);
|
|
143
|
+
if (kept && keptDay) {
|
|
144
|
+
showDay(keptDay, false);
|
|
145
|
+
chooseTime(kept, false);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
select.addEventListener("change", showSelected);
|
|
149
|
+
showSelected();
|
|
139
150
|
}
|
|
140
151
|
|
|
141
152
|
if (typeof document !== "undefined") {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Print or save as PDF" on the booking page (T157): the button stays hidden without JavaScript (it could do
|
|
3
|
+
* nothing there; the browser's own Print still uses the page's print stylesheet). Self-contained; no text.
|
|
4
|
+
*/
|
|
5
|
+
export function wirePrint(doc: Document, print: () => void): void {
|
|
6
|
+
for (const button of doc.querySelectorAll<HTMLButtonElement>("button[data-print]")) {
|
|
7
|
+
button.hidden = false;
|
|
8
|
+
button.addEventListener("click", () => print());
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (typeof document !== "undefined") wirePrint(document, () => window.print());
|
package/src/i18n/ar.ts
CHANGED
|
@@ -114,6 +114,11 @@ export const ar: Messages = {
|
|
|
114
114
|
"booking.cancelUntil": "يمكنك الإلغاء حتى {time}.",
|
|
115
115
|
"booking.cancel": "إلغاء الحجز",
|
|
116
116
|
"booking.cancelFailed": "تعذّر علينا إلغاء هذا الحجز.",
|
|
117
|
+
"booking.cancelConfirm": "يؤدي الإلغاء إلى تحرير أماكنك، ولا يمكن التراجع عنه.",
|
|
118
|
+
"booking.cancelYes": "نعم، ألغِ هذا الحجز",
|
|
119
|
+
"booking.attendeesHeading": "الحضور",
|
|
120
|
+
"booking.print": "اطبع أو احفظ بصيغة PDF",
|
|
121
|
+
"booking.organiser": "المنظِّم: {name}",
|
|
117
122
|
"booking.offer.intro": "التذاكر من قائمة الانتظار محجوزة لك. استلمها على هذا الجهاز؛ يعمل الرابط مرة واحدة.",
|
|
118
123
|
"booking.offer.button": "استلم تذاكري",
|
|
119
124
|
"booking.open.intro": "افتح حجزك على هذا الجهاز. يعمل الرابط مرة واحدة، وبعدها يتذكر هذا المتصفح حجزك.",
|
package/src/i18n/en.ts
CHANGED
|
@@ -116,6 +116,11 @@ export const en = {
|
|
|
116
116
|
"booking.cancelUntil": "You can cancel until {time}.",
|
|
117
117
|
"booking.cancel": "Cancel booking",
|
|
118
118
|
"booking.cancelFailed": "We could not cancel this booking.",
|
|
119
|
+
"booking.cancelConfirm": "Cancelling releases your places. This cannot be undone.",
|
|
120
|
+
"booking.cancelYes": "Yes, cancel this booking",
|
|
121
|
+
"booking.attendeesHeading": "Who is coming",
|
|
122
|
+
"booking.print": "Print or save as PDF",
|
|
123
|
+
"booking.organiser": "Organised by {name}",
|
|
119
124
|
"booking.offer.intro": "Tickets from the waitlist are held for you. Claim them on this device; the link works once.",
|
|
120
125
|
"booking.offer.button": "Claim my tickets",
|
|
121
126
|
"booking.open.intro": "Open your booking on this device. The link works once; after that this browser remembers it.",
|