|
| 1 | +{{ define "preloads" }} |
| 2 | + {{ partial "altcha-css.html" . }} |
| 3 | +{{ end }} |
| 4 | +{{ define "main" }} |
| 5 | + <section x-data="{feedbackData: {success: false, inProgress: false, errorMessage: ''}, submitData: {firstName: '', lastName: '', email: '', company: '', captcha: null, acceptNewsletter: false, formType: 'webinar'}, acceptTerms: false, hubContact: null, captchaState: null}" x-init="hubContact = new HubContact($refs.form, feedbackData, submitData)" class="container py-12"> |
| 6 | + <header class="mb-6"> |
| 7 | + <h1 class="font-h1 mb-8">{{ .Title }}</h1> |
| 8 | + <p class="lead">{{ .Description }}</p> |
| 9 | + </header> |
| 10 | + |
| 11 | + <form x-ref="form" @submit.prevent="hubContact.request(); $refs.captcha.reset()"> |
| 12 | + <div x-show="!feedbackData.success" class="grid grid-cols-1 md:grid-cols-3 gap-6 items-start"> |
| 13 | + <!-- Left Side - Registration Form --> |
| 14 | + <section class="white-box md:col-span-2"> |
| 15 | + <div class="px-4 py-5 md:p-6"> |
| 16 | + <div class="grid grid-cols-2 gap-6"> |
| 17 | + <!-- First Name --> |
| 18 | + <div class="col-span-2 md:col-span-1"> |
| 19 | + <label for="firstName" class="block text-sm font-medium text-gray-700 mb-2"> |
| 20 | + {{ i18n "webinar_first_name" }} <span class="text-red-500" aria-label="required">*</span> |
| 21 | + </label> |
| 22 | + <input type="text" id="firstName" name="firstName" x-model="submitData.firstName" class="block input-box w-full" maxlength="100" required aria-required="true" @blur="$el.classList.add('show-invalid')"> |
| 23 | + </div> |
| 24 | + |
| 25 | + <!-- Last Name --> |
| 26 | + <div class="col-span-2 md:col-span-1"> |
| 27 | + <label for="lastName" class="block text-sm font-medium text-gray-700 mb-2"> |
| 28 | + {{ i18n "webinar_last_name" }} <span class="text-red-500" aria-label="required">*</span> |
| 29 | + </label> |
| 30 | + <input type="text" id="lastName" name="lastName" x-model="submitData.lastName" class="block input-box w-full" maxlength="100" required aria-required="true" @blur="$el.classList.add('show-invalid')"> |
| 31 | + </div> |
| 32 | + |
| 33 | + <!-- Company --> |
| 34 | + <div class="col-span-2"> |
| 35 | + <label for="company" class="block text-sm font-medium text-gray-700 mb-2"> |
| 36 | + {{ i18n "webinar_company" }} <span class="text-red-500" aria-label="required">*</span> |
| 37 | + </label> |
| 38 | + <input type="text" id="company" name="company" x-model="submitData.company" class="block input-box w-full" maxlength="200" required aria-required="true" @blur="$el.classList.add('show-invalid')"> |
| 39 | + </div> |
| 40 | + |
| 41 | + <!-- Email --> |
| 42 | + <div class="col-span-2"> |
| 43 | + <label for="email" class="block text-sm font-medium text-gray-700 mb-2"> |
| 44 | + {{ i18n "webinar_email" }} <span class="text-red-500" aria-label="required">*</span> |
| 45 | + </label> |
| 46 | + <input type="email" id="email" name="email" x-model="submitData.email" class="block input-box w-full" required aria-required="true" @blur="$el.classList.add('show-invalid')"> |
| 47 | + </div> |
| 48 | + |
| 49 | + <div class="col-span-2"> |
| 50 | + <!-- Terms & Privacy Acceptance --> |
| 51 | + <p class="font-p text-sm mb-2"> |
| 52 | + {{ partial "checkbox.html" (dict "context" . "alpineVariable" "acceptTerms" "label" (i18n "accept_hub_managed_terms_and_privacy" | safeHTML)) }} |
| 53 | + </p> |
| 54 | + |
| 55 | + <!-- Optional Newsletter --> |
| 56 | + <p class="font-p text-sm mb-2"> |
| 57 | + {{ partial "checkbox.html" (dict "context" . "alpineVariable" "submitData.acceptNewsletter" "label" (i18n "accept_hub_newsletter_optional")) }} |
| 58 | + </p> |
| 59 | + </div> |
| 60 | + |
| 61 | + <div class="col-span-2"> |
| 62 | + <p :class="{'hidden': !feedbackData.errorMessage}" class="text-sm text-red-600 mb-2" x-text="feedbackData.errorMessage"></p> |
| 63 | + <button :disabled="feedbackData.inProgress || !acceptTerms || captchaState == 'verifying'" type="submit" class="btn btn-primary w-full md:w-64" data-umami-event="webinar-form" x-cloak> |
| 64 | + <i :class="{'fa-paper-plane': !feedbackData.inProgress, 'fa-spinner fa-spin': feedbackData.inProgress}" class="fa-solid" aria-hidden="true"></i> |
| 65 | + {{ i18n "webinar_submit" }} |
| 66 | + </button> |
| 67 | + {{ $challengeUrl := printf "%s/connect/contact/challenge" .Site.Params.apiBaseUrl }} |
| 68 | + {{ partial "captcha.html" (dict "challengeUrl" $challengeUrl "captchaPayload" "submitData.captcha" "captchaState" "captchaState") }} |
| 69 | + </div> |
| 70 | + </div> |
| 71 | + </div> |
| 72 | + </section> |
| 73 | + |
| 74 | + <!-- Sidebar --> |
| 75 | + <aside class="white-box md:col-span-1"> |
| 76 | + <div class="px-4 py-5 md:p-6"> |
| 77 | + <div class="space-y-6"> |
| 78 | + <div> |
| 79 | + <h3 class="font-h3 mb-4">{{ i18n "webinar_details_title" }}</h3> |
| 80 | + |
| 81 | + <ul class="space-y-4"> |
| 82 | + <li class="flex items-start"> |
| 83 | + <i class="fa-solid fa-calendar text-primary mr-3 mt-1"></i> |
| 84 | + <div> |
| 85 | + <div class="font-medium text-gray-900">{{ i18n "webinar_date_label" }}</div> |
| 86 | + <p class="text-sm text-gray-600">{{ i18n "webinar_date_value" }}</p> |
| 87 | + </div> |
| 88 | + </li> |
| 89 | + |
| 90 | + <li class="flex items-start"> |
| 91 | + <i class="fa-solid fa-clock text-primary mr-3 mt-1"></i> |
| 92 | + <div> |
| 93 | + <div class="font-medium text-gray-900">{{ i18n "webinar_time_label" }}</div> |
| 94 | + <p class="text-sm text-gray-600">{{ i18n "webinar_time_value" }}</p> |
| 95 | + </div> |
| 96 | + </li> |
| 97 | + |
| 98 | + <li class="flex items-start"> |
| 99 | + <i class="fa-solid fa-globe text-primary mr-3 mt-1"></i> |
| 100 | + <div> |
| 101 | + <div class="font-medium text-gray-900">{{ i18n "webinar_language_label" }}</div> |
| 102 | + <p class="text-sm text-gray-600">{{ i18n "webinar_language_value" }}</p> |
| 103 | + </div> |
| 104 | + </li> |
| 105 | + </ul> |
| 106 | + </div> |
| 107 | + |
| 108 | + <!-- Divider --> |
| 109 | + <hr class="border-gray-200"> |
| 110 | + |
| 111 | + <!-- What You'll Learn --> |
| 112 | + <div> |
| 113 | + <h3 class="font-h3 mb-4">{{ i18n "webinar_learn_title" }}</h3> |
| 114 | + |
| 115 | + <ul class="space-y-3"> |
| 116 | + <li class="flex items-start"> |
| 117 | + <i class="fa-solid fa-check text-primary mr-3 mt-1"></i> |
| 118 | + <span class="text-sm text-gray-600">{{ i18n "webinar_learn_1" }}</span> |
| 119 | + </li> |
| 120 | + <li class="flex items-start"> |
| 121 | + <i class="fa-solid fa-check text-primary mr-3 mt-1"></i> |
| 122 | + <span class="text-sm text-gray-600">{{ i18n "webinar_learn_2" }}</span> |
| 123 | + </li> |
| 124 | + <li class="flex items-start"> |
| 125 | + <i class="fa-solid fa-check text-primary mr-3 mt-1"></i> |
| 126 | + <span class="text-sm text-gray-600">{{ i18n "webinar_learn_3" }}</span> |
| 127 | + </li> |
| 128 | + </ul> |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + </div> |
| 132 | + </aside> |
| 133 | + </div> |
| 134 | + |
| 135 | + <section x-show="feedbackData.success" class="white-box" x-cloak> |
| 136 | + <div class="flex flex-col items-center justify-center gap-4 text-center md:min-h-110 px-4 py-5 md:p-6"> |
| 137 | + <i class="fa-solid fa-check-circle text-7xl text-secondary"></i> |
| 138 | + <h3 class="font-h3"> |
| 139 | + {{ i18n "webinar_success_title" }} |
| 140 | + </h3> |
| 141 | + <p class="font-p"> |
| 142 | + {{ i18n "webinar_success_message" }} |
| 143 | + </p> |
| 144 | + </div> |
| 145 | + </section> |
| 146 | + </form> |
| 147 | + </section> |
| 148 | +{{ end }} |
| 149 | +{{ define "script" }} |
| 150 | + {{ if hugo.IsDevelopment }} |
| 151 | + {{ $hubContactJs := resources.Get "js/hubcontact.js" }} |
| 152 | + <script type="text/javascript" src="{{ $hubContactJs.RelPermalink }}" defer></script> |
| 153 | + {{ $altchaJs := resources.Get "js/altcha/altcha.js" }} |
| 154 | + <script type="module" src="{{ $altchaJs.RelPermalink }}" defer></script> |
| 155 | + {{ $altchaWorkerJs := resources.Get "js/altcha/worker.js" }} |
| 156 | + <script type="module" src="{{ $altchaWorkerJs.RelPermalink }}" defer></script> |
| 157 | + {{ else }} |
| 158 | + {{ $hubContactJs := resources.Get "js/hubcontact.js" | minify | fingerprint }} |
| 159 | + <script type="text/javascript" src="{{ $hubContactJs.RelPermalink }}" integrity="{{ $hubContactJs.Data.Integrity }}" defer></script> |
| 160 | + {{ $altchaJs := resources.Get "js/altcha/altcha.js" }} |
| 161 | + <script type="module" src="{{ $altchaJs.RelPermalink }}" integrity="{{ $altchaJs.Data.Integrity }}" defer></script> |
| 162 | + {{ $altchaWorkerJs := resources.Get "js/altcha/worker.js" }} |
| 163 | + <script type="module" src="{{ $altchaWorkerJs.RelPermalink }}" integrity="{{ $altchaWorkerJs.Data.Integrity }}" defer></script> |
| 164 | + {{ end }} |
| 165 | +{{ end }} |
0 commit comments