Skip to content

Commit

Permalink
integrates bookings for clinique numérique
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDiakite committed Oct 17, 2024
1 parent 37abd6d commit 4e2b2b8
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
58 changes: 57 additions & 1 deletion src/lib/components/ArticleAside.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,25 @@
import { t, dateToLocalizedString } from '$i18n/i18n';
import { MemberLink, Tree } from '$components';
import type { Blog, Event, Resource, Project, Meeting } from '$lib/types';
import { onMount } from 'svelte';
export let content: Blog | Event | Resource | Project | Meeting;
onMount(() => {
const dialog = document.querySelector('dialog');
const button = document.querySelector('button.register');
if (dialog && button) {
button.addEventListener('click', () => {
dialog.showModal();
});
dialog.addEventListener('click', (e) => {
if (e.target === dialog) {
dialog.close();
}
});
}
});
</script>

<aside class="infos">
Expand Down Expand Up @@ -90,7 +107,9 @@
</p>
</div>
<div class="info">
{#if content.meta.link}
{#if content.meta.recurrent}
<button class="register">{$t('news.register')}</button>
{:else if content.meta.link}
<a class="register" href={content.meta.link}>{$t('news.register')}</a>
{:else}
<p>{$t('news.noRegistration')}</p>
Expand Down Expand Up @@ -137,6 +156,18 @@
{/if}
</aside>

{#if content.meta.kind === 'event' && content.meta.recurrent === 'clinique'}
<dialog>
<iframe
title="interactive calendar"
src={content.meta.link}
frameborder="0"
scrolling="yes"
style="border:0"
></iframe>
</dialog>
{/if}

<style>
.infos {
container: aside / inline-size;
Expand Down Expand Up @@ -183,6 +214,31 @@
}
}
button {
all: unset;
font-weight: 700;
text-decoration: underline;
text-underline-offset: 0.25rem;
text-decoration-skip: ink;
&:hover {
cursor: pointer;
text-decoration: none;
}
}
iframe {
width: 100%;
height: 100%;
border: 0;
}
dialog {
width: min(90%, 58rem);
height: min(90%, 58rem);
border: none;
border-radius: var(--border-radius);
}
#links {
& * + * {
margin-top: 0.3rem;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/labouvroir
2 changes: 2 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type EventMeta = {
path: string;
kind: 'event';
slug: string;
recurrent: string;
draft: boolean;
};

type MemberMeta = {
Expand Down

0 comments on commit 4e2b2b8

Please sign in to comment.