Skip to content

Commit 9a5e036

Browse files
authored
Merge pull request #163 from cryptomator/feature/webinar
Re-Add webinar section
2 parents c6e6ac1 + 495e11c commit 9a5e036

13 files changed

Lines changed: 345 additions & 26 deletions

File tree

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
"use strict";
22

3-
const REQUEST_HUB_CONTACT_URL = API_BASE_URL + '/connect/contact/request-contact';
3+
class ApiForm {
44

5-
class HubContact {
6-
7-
constructor(form, feedbackData, submitData) {
5+
constructor(form, feedbackData, submitData, url) {
86
this._form = form;
97
this._feedbackData = feedbackData;
108
this._submitData = submitData;
9+
this._url = url;
1110
}
1211

1312
request() {
@@ -22,7 +21,7 @@ class HubContact {
2221
this._feedbackData.errorMessage = '';
2322

2423
$.ajax({
25-
url: REQUEST_HUB_CONTACT_URL,
24+
url: this._url,
2625
type: 'POST',
2726
data: JSON.stringify(this._submitData),
2827
contentType: "application/json; charset=utf-8",
@@ -46,4 +45,4 @@ class HubContact {
4645
window.scrollTo(0, 0);
4746
}
4847

49-
}
48+
}

assets/js/webinar.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"use strict";
2+
3+
class Webinar {
4+
5+
constructor(webinarId, lang, languageNames, data) {
6+
$.getJSON(`${API_BASE_URL}/connect/contact/webinar/${webinarId}`).done(d => {
7+
data.name = d.name;
8+
data.language = languageNames[d.language];
9+
data.dateStart = d.dateStart.replace(' ', 'T') + 'Z';
10+
data.lead = d.metadata.lead[lang];
11+
data.learnTitle = d.metadata.learn.title[lang];
12+
data.learnItems = (d.metadata.learn.items).map(i => i[lang]);
13+
}).fail(xhr => {
14+
console.error('Fetching webinar data failed:', xhr.responseJSON?.message || xhr.statusText);
15+
});
16+
}
17+
18+
static formatBerlin(iso, opts) {
19+
return new Intl.DateTimeFormat(document.documentElement.lang || 'en', { timeZone: 'Europe/Berlin', ...opts }).format(new Date(iso));
20+
}
21+
22+
}

config/_default/params.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ anniversaryBanner:
88
- /paddle-checkout/
99
- /hub/billing/
1010

11+
webinar:
12+
webinarId: "6a0427f47bf7eebc0"
13+
banner:
14+
enabled: false
15+
excludePaths:
16+
- /downloads-thanks/
17+
- /paddle-checkout/
18+
- /hub/billing/
19+
1120
releases:
1221
exe:
1322
version: 1.19.2

content/webinar.de.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "Webinar"
3+
description: "Nimm an unserem kostenlosen Live-Webinar teil und erfahre, wie du die Cloud-Daten deines Teams mit Zero-Knowledge-Verschlüsselung schützt."
4+
type: webinar
5+
---

content/webinar.en.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "Webinar"
3+
description: "Join our free live webinar and learn how to protect your team's cloud data with zero-knowledge encryption."
4+
type: webinar
5+
---

i18n/de.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,46 @@
13281328
- id: success_story_read_link
13291329
translation: "Erfolgsgeschichte lesen"
13301330

1331+
# Live Webinar Banner
1332+
- id: webinar_banner
1333+
translation: "Live-Webinar – <a class=\"whitespace-nowrap font-bold\" href=\"/de/webinar/\">Jetzt anmelden<i class=\"fa-regular fa-arrow-right ml-1\" aria-hidden=\"true\"></i></a>"
1334+
1335+
# Webinar Form
1336+
- id: webinar_first_name
1337+
translation: "Vorname"
1338+
- id: webinar_last_name
1339+
translation: "Nachname"
1340+
- id: webinar_email
1341+
translation: "E-Mail-Adresse"
1342+
- id: webinar_company
1343+
translation: "Unternehmen / Organisation"
1344+
- id: webinar_submit
1345+
translation: "Jetzt anmelden"
1346+
- id: webinar_form_title
1347+
translation: "Sichere dir deinen Platz"
1348+
- id: webinar_form_subtitle
1349+
translation: "Du erhältst die Bestätigung und vor dem Termin eine Erinnerung per E-Mail."
1350+
- id: webinar_success_title
1351+
translation: "Du bist angemeldet!"
1352+
- id: webinar_success_message
1353+
translation: "Vielen Dank für deine Anmeldung. Du erhältst in Kürze eine Bestätigungs-E-Mail mit den Webinar-Details."
1354+
- id: webinar_success_inbox_hint
1355+
translation: "Bitte prüfe auch deinen Spam-Ordner."
1356+
- id: webinar_details_title
1357+
translation: "Webinar-Details"
1358+
- id: webinar_date_label
1359+
translation: "Datum"
1360+
- id: webinar_time_label
1361+
translation: "Uhrzeit"
1362+
- id: webinar_language_label
1363+
translation: "Sprache"
1364+
- id: webinar_language_en
1365+
translation: "Englisch"
1366+
- id: webinar_language_de
1367+
translation: "Deutsch"
1368+
- id: webinar_accept_privacy
1369+
translation: "Ich akzeptiere die <a class=\"text-link\" href=\"/de/privacy/\">Datenschutzerklärung</a>."
1370+
13311371
# Sale
13321372
- id: sale_off
13331373
translation: "Rabatt"

i18n/en.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,46 @@
13671367
- id: success_story_read_link
13681368
translation: "Read success story"
13691369

1370+
# Live Webinar Banner
1371+
- id: webinar_banner
1372+
translation: "Live Webinar – <a class=\"whitespace-nowrap font-bold\" href=\"/webinar/\">Sign up<i class=\"fa-regular fa-arrow-right ml-1\" aria-hidden=\"true\"></i></a>"
1373+
1374+
# Webinar Form
1375+
- id: webinar_first_name
1376+
translation: "First Name"
1377+
- id: webinar_last_name
1378+
translation: "Last Name"
1379+
- id: webinar_email
1380+
translation: "Email Address"
1381+
- id: webinar_company
1382+
translation: "Company / Organization"
1383+
- id: webinar_submit
1384+
translation: "Register Now"
1385+
- id: webinar_form_title
1386+
translation: "Reserve your seat"
1387+
- id: webinar_form_subtitle
1388+
translation: "We'll email you a confirmation and a reminder before the session."
1389+
- id: webinar_success_title
1390+
translation: "You're registered!"
1391+
- id: webinar_success_message
1392+
translation: "Thank you for registering. You will receive a confirmation email with the webinar details shortly."
1393+
- id: webinar_success_inbox_hint
1394+
translation: "Please also check your spam folder."
1395+
- id: webinar_details_title
1396+
translation: "Webinar Details"
1397+
- id: webinar_date_label
1398+
translation: "Date"
1399+
- id: webinar_time_label
1400+
translation: "Time"
1401+
- id: webinar_language_label
1402+
translation: "Language"
1403+
- id: webinar_language_en
1404+
translation: "English"
1405+
- id: webinar_language_de
1406+
translation: "German"
1407+
- id: webinar_accept_privacy
1408+
translation: "I accept the <a class=\"text-link\" href=\"/privacy/\" target=\"_blank\">Privacy Policy</a>."
1409+
13701410
# Sale
13711411
- id: sale_off
13721412
translation: "Off"

layouts/_default/baseof.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,29 @@
7676
{{- end -}}
7777
{{- end -}}
7878
{{- .Scratch.Set "anniversaryBannerActive" $showAnniversaryBanner -}}
79+
{{- $webinarBanner := .Site.Params.webinar.banner -}}
80+
{{- $showWebinarBanner := false -}}
81+
{{- if and $webinarBanner $webinarBanner.enabled -}}
82+
{{- $showWebinarBanner = true -}}
83+
{{- $currentPath := .RelPermalink -}}
84+
{{- range $webinarBanner.excludePaths -}}
85+
{{- if hasPrefix $currentPath . -}}
86+
{{- $showWebinarBanner = false -}}
87+
{{- end -}}
88+
{{- end -}}
89+
{{- end -}}
90+
{{- .Scratch.Set "webinarBannerActive" $showWebinarBanner -}}
7991
{{ partial "nav.html" . }}
8092
{{- if $showAnniversaryBanner -}}
8193
{{ partial "anniversary-banner.html" . }}
8294
{{- end -}}
8395
{{- $topPadding := cond .IsHome "" "pt-12" -}}
84-
{{- if $showAnniversaryBanner -}}
96+
{{- if and $showWebinarBanner (not $showAnniversaryBanner) -}}
97+
{{- $topPadding = cond .IsHome "" "pt-24 md:pt-18" -}}
98+
{{- else if and (not $showWebinarBanner) $showAnniversaryBanner -}}
8599
{{- $topPadding = cond .IsHome "" "pt-28 md:pt-24" -}}
100+
{{- else if and $showWebinarBanner $showAnniversaryBanner -}}
101+
{{- $topPadding = cond .IsHome "" "pt-40 md:pt-32" -}}
86102
{{- end -}}
87103
<div class="bg-gray-100 min-h-[80vh] {{ $topPadding }}">
88104
<!-- Code that all your templates share, like a header -->

layouts/become-a-partner/single.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
{{ partial "altcha-css.html" . }}
33
{{ end }}
44
{{ define "main" }}
5-
<section x-data="{feedbackData: {success: false, inProgress: false, errorMessage: ''}, submitData: {firstName: '', lastName: '', email: '', phone: '', company: '', website: '', partnershipType: '', message: '', captcha: null, acceptNewsletter: false, formType: 'become-partner'}, acceptTerms: false, hubContact: null, captchaState: null}" x-init="hubContact = new HubContact($refs.form, feedbackData, submitData)" class="container py-12">
5+
<section x-data="{feedbackData: {success: false, inProgress: false, errorMessage: ''}, submitData: {firstName: '', lastName: '', email: '', phone: '', company: '', website: '', partnershipType: '', message: '', captcha: null, acceptNewsletter: false, formType: 'become-partner'}, acceptTerms: false, apiForm: null, captchaState: null}" x-init="apiForm = new ApiForm($refs.form, feedbackData, submitData, API_BASE_URL + '/connect/contact/request-contact')" class="container py-12">
66
<header class="mb-6">
77
<h1 class="font-h1 mb-8">{{ .Title }}</h1>
88
<p class="lead">{{ .Description }}</p>
99
</header>
1010

11-
<form x-ref="form" @submit.prevent="hubContact.request(); $refs.captcha.reset()">
11+
<form x-ref="form" @submit.prevent="apiForm.request(); $refs.captcha.reset()">
1212
<div x-show="!feedbackData.success" class="grid grid-cols-1 md:grid-cols-3 gap-6 items-start">
1313
<!-- Left Side - Partner Form -->
1414
<section class="white-box md:col-span-2">
@@ -218,17 +218,17 @@ <h3 class="font-h3">
218218
{{ if hugo.IsDevelopment }}
219219
{{ $newsletterJs := resources.Get "js/newsletter.js" }}
220220
<script type="text/javascript" src="{{ $newsletterJs.RelPermalink }}" defer></script>
221-
{{ $hubContactJs := resources.Get "js/hubcontact.js" }}
222-
<script type="text/javascript" src="{{ $hubContactJs.RelPermalink }}" defer></script>
221+
{{ $apiFormJs := resources.Get "js/apiform.js" }}
222+
<script type="text/javascript" src="{{ $apiFormJs.RelPermalink }}" defer></script>
223223
{{ $altchaJs := resources.Get "js/altcha/altcha.js" }}
224224
<script type="module" src="{{ $altchaJs.RelPermalink }}" defer></script>
225225
{{ $altchaWorkerJs := resources.Get "js/altcha/worker.js" }}
226226
<script type="module" src="{{ $altchaWorkerJs.RelPermalink }}" defer></script>
227227
{{ else }}
228228
{{ $newsletterJs := resources.Get "js/newsletter.js" | minify | fingerprint }}
229229
<script type="text/javascript" src="{{ $newsletterJs.RelPermalink }}" integrity="{{ $newsletterJs.Data.Integrity }}" defer></script>
230-
{{ $hubContactJs := resources.Get "js/hubcontact.js" | minify | fingerprint }}
231-
<script type="text/javascript" src="{{ $hubContactJs.RelPermalink }}" integrity="{{ $hubContactJs.Data.Integrity }}" defer></script>
230+
{{ $apiFormJs := resources.Get "js/apiform.js" | minify | fingerprint }}
231+
<script type="text/javascript" src="{{ $apiFormJs.RelPermalink }}" integrity="{{ $apiFormJs.Data.Integrity }}" defer></script>
232232
{{ $altchaJs := resources.Get "js/altcha/altcha.js" }}
233233
<script type="module" src="{{ $altchaJs.RelPermalink }}" integrity="{{ $altchaJs.Data.Integrity }}" defer></script>
234234
{{ $altchaWorkerJs := resources.Get "js/altcha/worker.js" }}

layouts/book-a-demo/single.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
{{ partial "altcha-css.html" . }}
33
{{ end }}
44
{{ define "main" }}
5-
<section x-data="{feedbackData: {success: false, inProgress: false, errorMessage: ''}, submitData: {firstName: '', lastName: '', email: '', phone: '', company: '', interests: [], attendees: [], message: '', captcha: null, acceptNewsletter: false, formType: 'book-demo'}, acceptTerms: false, hubContact: null, captchaState: null}" x-init="hubContact = new HubContact($refs.form, feedbackData, submitData)" class="container py-12">
5+
<section x-data="{feedbackData: {success: false, inProgress: false, errorMessage: ''}, submitData: {firstName: '', lastName: '', email: '', phone: '', company: '', interests: [], attendees: [], message: '', captcha: null, acceptNewsletter: false, formType: 'book-demo'}, acceptTerms: false, apiForm: null, captchaState: null}" x-init="apiForm = new ApiForm($refs.form, feedbackData, submitData, API_BASE_URL + '/connect/contact/request-contact')" class="container py-12">
66
<header class="mb-6">
77
<h1 class="font-h1 mb-8">{{ .Title }}</h1>
88
<p class="lead">{{ .Description }}</p>
99
</header>
1010

11-
<form x-ref="form" @submit.prevent="hubContact.request(); $refs.captcha.reset()">
11+
<form x-ref="form" @submit.prevent="apiForm.request(); $refs.captcha.reset()">
1212
<div x-show="!feedbackData.success" class="grid grid-cols-1 md:grid-cols-3 gap-6 items-start">
1313
<!-- Left Side - Contact Form -->
1414
<section class="white-box md:col-span-2">
@@ -264,17 +264,17 @@ <h3 class="font-h3">
264264
{{ if hugo.IsDevelopment }}
265265
{{ $newsletterJs := resources.Get "js/newsletter.js" }}
266266
<script type="text/javascript" src="{{ $newsletterJs.RelPermalink }}" defer></script>
267-
{{ $hubContactJs := resources.Get "js/hubcontact.js" }}
268-
<script type="text/javascript" src="{{ $hubContactJs.RelPermalink }}" defer></script>
267+
{{ $apiFormJs := resources.Get "js/apiform.js" }}
268+
<script type="text/javascript" src="{{ $apiFormJs.RelPermalink }}" defer></script>
269269
{{ $altchaJs := resources.Get "js/altcha/altcha.js" }}
270270
<script type="module" src="{{ $altchaJs.RelPermalink }}" defer></script>
271271
{{ $altchaWorkerJs := resources.Get "js/altcha/worker.js" }}
272272
<script type="module" src="{{ $altchaWorkerJs.RelPermalink }}" defer></script>
273273
{{ else }}
274274
{{ $newsletterJs := resources.Get "js/newsletter.js" | minify | fingerprint }}
275275
<script type="text/javascript" src="{{ $newsletterJs.RelPermalink }}" integrity="{{ $newsletterJs.Data.Integrity }}" defer></script>
276-
{{ $hubContactJs := resources.Get "js/hubcontact.js" | minify | fingerprint }}
277-
<script type="text/javascript" src="{{ $hubContactJs.RelPermalink }}" integrity="{{ $hubContactJs.Data.Integrity }}" defer></script>
276+
{{ $apiFormJs := resources.Get "js/apiform.js" | minify | fingerprint }}
277+
<script type="text/javascript" src="{{ $apiFormJs.RelPermalink }}" integrity="{{ $apiFormJs.Data.Integrity }}" defer></script>
278278
{{ $altchaJs := resources.Get "js/altcha/altcha.js" }}
279279
<script type="module" src="{{ $altchaJs.RelPermalink }}" integrity="{{ $altchaJs.Data.Integrity }}" defer></script>
280280
{{ $altchaWorkerJs := resources.Get "js/altcha/worker.js" }}

0 commit comments

Comments
 (0)