Skip to content

Commit 9b26ee5

Browse files
committed
add cal embed
1 parent 16e3752 commit 9b26ee5

File tree

2 files changed

+82
-32
lines changed

2 files changed

+82
-32
lines changed

config/config.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ config :algora,
2222
{"/create/org", "/onboarding/org"},
2323
{"/solve", "/onboarding/dev"},
2424
{"/onboarding/solver", "/onboarding/dev"},
25-
{"/onboarding/org", "https://cal.com/ioannisflo"},
2625
{"/:org/contract/:id", "/:org/contracts/:id"},
2726
{"/org/*path", "/*path"},
2827
{"/@/:handle", "/:handle/profile"},

lib/algora_web/live/onboarding/org.ex

Lines changed: 82 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -97,38 +97,89 @@ defmodule AlgoraWeb.Onboarding.OrgLive do
9797
</div>
9898
</header>
9999
100-
<div class="flex-1 p-4 md:py-4 flex items-center justify-center max-h-[calc(100vh-11rem)] overflow-y-auto scrollbar-thin">
101-
<div class="w-full max-w-[28rem] text-left">
102-
<.form for={@form} phx-submit="submit" class="flex flex-col gap-6">
103-
<.input
104-
field={@form[:email]}
105-
type="email"
106-
label="Work email"
107-
placeholder="[email protected]"
108-
/>
109-
<.input
110-
field={@form[:job_description]}
111-
type="textarea"
112-
label="Job description / careers URL"
113-
rows="3"
114-
class="resize-none"
115-
placeholder="Tell us about the role and your requirements..."
116-
/>
117-
<.input
118-
field={@form[:candidate_description]}
119-
type="textarea"
120-
label="Describe your ideal candidate, heuristics, green/red flags etc."
121-
rows="3"
122-
class="resize-none"
123-
placeholder={placeholder_text()}
124-
/>
125-
<div class="flex flex-col gap-4">
126-
<.button class="w-full" type="submit">Receive your candidates</.button>
127-
<div class="text-xs text-muted-foreground text-center">
128-
No credit card required - only pay when you hire
100+
<div class="flex-1 p-4 md:py-4 flex items-center justify-center overflow-hidden">
101+
<div class="w-full">
102+
<!-- Cal.com embed -->
103+
<div style="width: 100%; height: 100%; overflow: scroll" id="cal-embed"></div>
104+
<script type="text/javascript">
105+
(function (C, A, L) {
106+
let p = function (a, ar) {
107+
a.q.push(ar);
108+
};
109+
let d = C.document;
110+
C.Cal =
111+
C.Cal ||
112+
function () {
113+
let cal = C.Cal;
114+
let ar = arguments;
115+
if (!cal.loaded) {
116+
cal.ns = {};
117+
cal.q = cal.q || [];
118+
d.head.appendChild(d.createElement("script")).src = A;
119+
cal.loaded = true;
120+
}
121+
if (ar[0] === L) {
122+
const api = function () {
123+
p(api, arguments);
124+
};
125+
const namespace = ar[1];
126+
api.q = api.q || [];
127+
if (typeof namespace === "string") {
128+
cal.ns[namespace] = cal.ns[namespace] || api;
129+
p(cal.ns[namespace], ar);
130+
p(cal, ["initNamespace", namespace]);
131+
} else p(cal, ar);
132+
return;
133+
}
134+
p(cal, ar);
135+
};
136+
})(window, "https://app.cal.com/embed/embed.js", "init");
137+
Cal("init", { origin: "https://app.cal.com" });
138+
139+
Cal("inline", {
140+
elementOrSelector: "#cal-embed",
141+
calLink: "ioannisflo/15min",
142+
config: {
143+
theme: "dark",
144+
},
145+
});
146+
</script>
147+
148+
<!-- Commented out original form -->
149+
<!--
150+
<div class="w-full max-w-[28rem] text-left">
151+
<.form for={@form} phx-submit="submit" class="flex flex-col gap-6">
152+
<.input
153+
field={@form[:email]}
154+
type="email"
155+
label="Work email"
156+
placeholder="[email protected]"
157+
/>
158+
<.input
159+
field={@form[:job_description]}
160+
type="textarea"
161+
label="Job description / careers URL"
162+
rows="3"
163+
class="resize-none"
164+
placeholder="Tell us about the role and your requirements..."
165+
/>
166+
<.input
167+
field={@form[:candidate_description]}
168+
type="textarea"
169+
label="Describe your ideal candidate, heuristics, green/red flags etc."
170+
rows="3"
171+
class="resize-none"
172+
placeholder={placeholder_text()}
173+
/>
174+
<div class="flex flex-col gap-4">
175+
<.button class="w-full" type="submit">Receive your candidates</.button>
176+
<div class="text-xs text-muted-foreground text-center">
177+
No credit card required - only pay when you hire
178+
</div>
129179
</div>
130-
</div>
131-
</.form>
180+
</.form>
181+
</div>
182+
-->
132183
</div>
133184
</div>
134185

0 commit comments

Comments
 (0)