-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
234 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
import Modal from '../Modal.astro'; | ||
import Themes from './Themes.astro'; | ||
import Roles from './Roles.astro'; | ||
export interface Props { | ||
actor: object; | ||
} | ||
const { actor } = Astro.props; | ||
--- | ||
|
||
<Modal id={actor.id} title={actor['pair:label']}> | ||
<img class="w-40 h-40 object-cover rounded-full" src={actor.image} alt={actor['pair:label']} /> | ||
{actor['pair:comment'] && <p class="text-base leading-relaxed"><strong>En 2 mots</strong>: {actor['pair:comment']}</p>} | ||
{actor['pair:hasTopic'] && <p class="text-base leading-relaxed"><strong>Intérêts</strong>: <Themes themesUris={actor['pair:hasTopic']}></p>} | ||
{actor['pair:actorOfMembership'] && | ||
<p class="text-base leading-relaxed font-bold">Rôles</p> | ||
<Roles associations={Array.isArray(actor['pair:actorOfMembership']) ? actor['pair:actorOfMembership'] : [actor['pair:actorOfMembership']]} /> | ||
} | ||
</Modal> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
import dataProvider from '~/config/dataProvider'; | ||
import ActorModal from './ActorModal.astro'; | ||
export interface Props { | ||
actorsUris: string | [string]; | ||
} | ||
const { actorsUris } = Astro.props; | ||
const { data: actors } = await dataProvider.getMany('Person', { | ||
ids: Array.isArray(actorsUris) ? actorsUris : [actorsUris], | ||
}); | ||
--- | ||
|
||
<div class="grid gap-4 grid-cols-6"> | ||
{ | ||
actors?.map((actor) => ( | ||
<div> | ||
<a data-modal-target={actor.id} data-modal-toggle={actor.id} class="cursor-pointer"> | ||
<img class="w-full h-[160px] object-cover rounded-full" src={actor.image} alt={actor['pair:label']} /> | ||
<div class="text-center truncate font-bold">{actor['pair:label']}</div> | ||
</a> | ||
<ActorModal actor={actor}> | ||
</div> | ||
)) | ||
} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
import { marked } from 'marked'; | ||
import type { Post } from '~/types'; | ||
export interface Props { | ||
post: Post; | ||
} | ||
const { post } = Astro.props; | ||
--- | ||
|
||
<section class="py-8 sm:py-16 lg:py-20 mx-auto"> | ||
<article> | ||
<h1 | ||
class="px-4 sm:px-6 max-w-4xl mx-auto text-4xl md:text-5xl font-bold leading-tighter tracking-tighter font-heading" | ||
> | ||
{post['pair:label']} | ||
</h1> | ||
<div | ||
class="mx-auto px-6 sm:px-6 max-w-4xl prose prose-md prose-headings:font-heading prose-headings:leading-tighter prose-headings:tracking-tighter prose-headings:font-bold prose-a:text-primary prose-img:rounded-md prose-img:shadow-lg mt-8 prose-headings:scroll-mt-[80px]" | ||
> | ||
<Fragment set:html={marked.parse(post['pair:description'])} /> | ||
</div> | ||
</article> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
import dataProvider from '~/config/dataProvider'; | ||
export interface Props { | ||
associations: object | [object]; | ||
} | ||
const { associations } = Astro.props; | ||
// const { data: associations } = await dataProvider.getMany('MembershipAssociation', { | ||
// ids: Array.isArray(associationsUris) ? associationsUris : [associationsUris], | ||
// }); | ||
const { data: organizations } = await dataProvider.getMany('Organization', { | ||
ids: associations.filter((a) => a?.['pair:membershipOrganization']).map((a) => a['pair:membershipOrganization']), | ||
}); | ||
const { data: roles } = await dataProvider.getMany('Person', { | ||
ids: [...new Set(associations.filter((a) => a?.['pair:membershipRole']).map((a) => a['pair:membershipRole']))], | ||
}); | ||
--- | ||
|
||
<div class="grid gap-4 grid-cols-4"> | ||
{ | ||
associations?.map((association) => { | ||
const organization = organizations.find((m) => m.id === association['pair:membershipOrganization']); | ||
const role = roles.find((r) => r.id === association['pair:membershipRole']); | ||
return ( | ||
<a href={`/organisations/${encodeURIComponent(organization?.id)}`}> | ||
<img class="w-full h-[142.5px] rounded-full" src={organization?.image} alt={organization?.['pair:label']} /> | ||
<div class="text-center truncate font-bold">{organization?.['pair:label']}</div> | ||
<div class="text-center truncate">{role?.['pair:label']}</div> | ||
</a> | ||
); | ||
}) | ||
} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import dataProvider from '~/config/dataProvider'; | ||
export interface Props { | ||
themesUris: string | [string]; | ||
} | ||
const { themesUris } = Astro.props; | ||
const { data: themes } = await dataProvider.getMany('Theme', { | ||
ids: Array.isArray(themesUris) ? themesUris : [themesUris], | ||
}); | ||
--- | ||
|
||
<span> | ||
{themes.map((theme) => theme['pair:label']).join(', ')} | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
import Layout from '~/layouts/PageLayout.astro'; | ||
import dataProvider from '~/config/dataProvider'; | ||
import Document from '~/components/common/Document.astro'; | ||
export const prerender = true; | ||
export async function getStaticPaths() { | ||
const { data: posts } = await dataProvider.getList('Document'); | ||
return posts.map((post) => ({ | ||
params: { slug: post.id }, | ||
props: post, | ||
})); | ||
} | ||
const post = Astro.props; | ||
const metadata = { | ||
title: post['pair:label'], | ||
description: post['pair:comment'], | ||
}; | ||
--- | ||
|
||
<Layout metadata={metadata}> | ||
<Document post={post} /> | ||
</Layout> |
Oops, something went wrong.