...
This commit is contained in:
@@ -11,7 +11,10 @@ export function BusinessesList({ block }: { block: BusinessesListBlock }) {
|
|||||||
{t(block.title)}
|
{t(block.title)}
|
||||||
</h2>
|
</h2>
|
||||||
{block.intro && (
|
{block.intro && (
|
||||||
<p className="mt-4 max-w-3xl text-foreground/80 leading-relaxed">{t(block.intro)}</p>
|
<div
|
||||||
|
className="mt-4 max-w-3xl text-foreground/80 leading-relaxed"
|
||||||
|
dangerouslySetInnerHTML={{ __html: t(block.intro) }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<div className="mt-12 space-y-12">
|
<div className="mt-12 space-y-12">
|
||||||
{block.categories.map((cat, ci) => (
|
{block.categories.map((cat, ci) => (
|
||||||
@@ -27,9 +30,10 @@ export function BusinessesList({ block }: { block: BusinessesListBlock }) {
|
|||||||
>
|
>
|
||||||
<h4 className="font-display text-lg text-primary">{b.name}</h4>
|
<h4 className="font-display text-lg text-primary">{b.name}</h4>
|
||||||
{b.description && (
|
{b.description && (
|
||||||
<p className="mt-2 text-sm text-foreground/80 leading-relaxed">
|
<div
|
||||||
{t(b.description)}
|
className="mt-2 text-sm text-foreground/80 leading-relaxed"
|
||||||
</p>
|
dangerouslySetInnerHTML={{ __html: t(b.description) }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<div className="mt-4 space-y-1.5 text-sm">
|
<div className="mt-4 space-y-1.5 text-sm">
|
||||||
{b.address && (
|
{b.address && (
|
||||||
|
|||||||
@@ -29,7 +29,12 @@ export function ContactForm({ block }: { block: ContactFormBlock }) {
|
|||||||
<h2 className="font-display italic text-3xl sm:text-4xl md:text-5xl text-primary text-balance">
|
<h2 className="font-display italic text-3xl sm:text-4xl md:text-5xl text-primary text-balance">
|
||||||
{t(block.title)}
|
{t(block.title)}
|
||||||
</h2>
|
</h2>
|
||||||
{block.intro && <p className="mt-4 text-foreground/80">{t(block.intro)}</p>}
|
{block.intro && (
|
||||||
|
<div
|
||||||
|
className="mt-4 text-foreground/80 leading-relaxed"
|
||||||
|
dangerouslySetInnerHTML={{ __html: t(block.intro) }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<form onSubmit={onSubmit} className="mt-8 grid gap-5">
|
<form onSubmit={onSubmit} className="mt-8 grid gap-5">
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
<Label htmlFor="name">{t(UI.form.name)}</Label>
|
<Label htmlFor="name">{t(UI.form.name)}</Label>
|
||||||
|
|||||||
@@ -25,14 +25,13 @@ export function CtaSection({ block }: { block: CtaSectionBlock }) {
|
|||||||
{t(block.title)}
|
{t(block.title)}
|
||||||
</h2>
|
</h2>
|
||||||
{block.subtitle && (
|
{block.subtitle && (
|
||||||
<p
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"mt-4 text-base sm:text-lg leading-relaxed",
|
"mt-4 text-base sm:text-lg leading-relaxed",
|
||||||
isPrimary ? "text-primary-foreground/85" : "text-foreground/80",
|
isPrimary ? "text-primary-foreground/85" : "text-foreground/80",
|
||||||
)}
|
)}
|
||||||
>
|
dangerouslySetInnerHTML={{ __html: t(block.subtitle) }}
|
||||||
{t(block.subtitle)}
|
/>
|
||||||
</p>
|
|
||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
asChild
|
asChild
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ export function DocumentsList({ block }: { block: DocumentsListBlock }) {
|
|||||||
<p className="text-xs text-muted-foreground mt-0.5">{doc.date}</p>
|
<p className="text-xs text-muted-foreground mt-0.5">{doc.date}</p>
|
||||||
)}
|
)}
|
||||||
{doc.description && (
|
{doc.description && (
|
||||||
<p className="text-sm text-foreground/70 mt-1">{t(doc.description)}</p>
|
<div
|
||||||
|
className="text-sm text-foreground/70 mt-1"
|
||||||
|
dangerouslySetInnerHTML={{ __html: t(doc.description) }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<ExternalLink
|
<ExternalLink
|
||||||
|
|||||||
@@ -17,9 +17,10 @@ export function EventsList({ block }: { block: EventsListBlock }) {
|
|||||||
{t(block.title)}
|
{t(block.title)}
|
||||||
</h2>
|
</h2>
|
||||||
{block.intro && (
|
{block.intro && (
|
||||||
<p className="mt-4 text-base sm:text-lg leading-relaxed text-foreground/80">
|
<div
|
||||||
{t(block.intro)}
|
className="mt-4 text-base sm:text-lg leading-relaxed text-foreground/80"
|
||||||
</p>
|
dangerouslySetInnerHTML={{ __html: t(block.intro) }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<ol className="mt-10 space-y-4">
|
<ol className="mt-10 space-y-4">
|
||||||
@@ -45,7 +46,10 @@ export function EventsList({ block }: { block: EventsListBlock }) {
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{e.description && (
|
{e.description && (
|
||||||
<p className="mt-2 text-foreground/80 leading-relaxed">{t(e.description)}</p>
|
<div
|
||||||
|
className="mt-2 text-foreground/80 leading-relaxed"
|
||||||
|
dangerouslySetInnerHTML={{ __html: t(e.description) }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ export function PhotoGallery({ block }: { block: PhotoGalleryBlock }) {
|
|||||||
</h2>
|
</h2>
|
||||||
)}
|
)}
|
||||||
{block.intro && (
|
{block.intro && (
|
||||||
<p className="mt-4 max-w-2xl mx-auto text-center text-foreground/80">
|
<div
|
||||||
{t(block.intro)}
|
className="mt-4 max-w-2xl mx-auto text-center text-foreground/80 leading-relaxed"
|
||||||
</p>
|
dangerouslySetInnerHTML={{ __html: t(block.intro) }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<div className="mt-10 grid grid-cols-2 gap-3 md:grid-cols-4 md:gap-4">
|
<div className="mt-10 grid grid-cols-2 gap-3 md:grid-cols-4 md:gap-4">
|
||||||
{block.photos.map((p, i) => (
|
{block.photos.map((p, i) => (
|
||||||
|
|||||||
@@ -12,9 +12,10 @@ export function ServicesList({ block }: { block: ServicesListBlock }) {
|
|||||||
{t(block.title)}
|
{t(block.title)}
|
||||||
</h2>
|
</h2>
|
||||||
{block.intro && (
|
{block.intro && (
|
||||||
<p className="mt-4 text-base sm:text-lg leading-relaxed text-foreground/80">
|
<div
|
||||||
{t(block.intro)}
|
className="mt-4 text-base sm:text-lg leading-relaxed text-foreground/80"
|
||||||
</p>
|
dangerouslySetInnerHTML={{ __html: t(block.intro) }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-10 grid gap-6 md:grid-cols-2">
|
<div className="mt-10 grid gap-6 md:grid-cols-2">
|
||||||
@@ -26,7 +27,10 @@ export function ServicesList({ block }: { block: ServicesListBlock }) {
|
|||||||
<h3 className="font-display text-xl sm:text-2xl text-primary mb-2">
|
<h3 className="font-display text-xl sm:text-2xl text-primary mb-2">
|
||||||
{t(s.title)}
|
{t(s.title)}
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-foreground/80 leading-relaxed">{t(s.description)}</p>
|
<div
|
||||||
|
className="text-foreground/80 leading-relaxed"
|
||||||
|
dangerouslySetInnerHTML={{ __html: t(s.description) }}
|
||||||
|
/>
|
||||||
{s.items && s.items.length > 0 && (
|
{s.items && s.items.length > 0 && (
|
||||||
<ul className="mt-4 space-y-2">
|
<ul className="mt-4 space-y-2">
|
||||||
{s.items.map((item, j) => (
|
{s.items.map((item, j) => (
|
||||||
|
|||||||
@@ -16,9 +16,10 @@ export function TextIntro({ block }: { block: TextIntroBlock }) {
|
|||||||
<h2 className="font-display italic text-3xl sm:text-4xl md:text-5xl text-primary text-balance">
|
<h2 className="font-display italic text-3xl sm:text-4xl md:text-5xl text-primary text-balance">
|
||||||
{t(block.title)}
|
{t(block.title)}
|
||||||
</h2>
|
</h2>
|
||||||
<p className="mt-6 text-base sm:text-lg leading-relaxed text-foreground/85">
|
<div
|
||||||
{t(block.body)}
|
className="mt-6 text-base sm:text-lg leading-relaxed text-foreground/85 space-y-4 [&_strong]:font-semibold [&_strong]:text-primary"
|
||||||
</p>
|
dangerouslySetInnerHTML={{ __html: t(block.body) }}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function cascapedia_st_jules_register_acf(): void {
|
|||||||
csj_text('field_email', 'email', 'Courriel'),
|
csj_text('field_email', 'email', 'Courriel'),
|
||||||
csj_textarea('field_address', 'address', 'Adresse'),
|
csj_textarea('field_address', 'address', 'Adresse'),
|
||||||
csj_text('field_hours', 'hours', 'Heures'),
|
csj_text('field_hours', 'hours', 'Heures'),
|
||||||
csj_url('field_facebook_url', 'facebook_url', 'Facebook'),
|
csj_text('field_facebook_url', 'facebook_url', 'Facebook URL'),
|
||||||
],
|
],
|
||||||
'location' => [[['param' => 'options_page', 'operator' => '==', 'value' => 'site-settings']]],
|
'location' => [[['param' => 'options_page', 'operator' => '==', 'value' => 'site-settings']]],
|
||||||
]);
|
]);
|
||||||
@@ -47,19 +47,19 @@ function cascapedia_st_jules_register_acf(): void {
|
|||||||
acf_add_local_field_group([
|
acf_add_local_field_group([
|
||||||
'key' => 'group_document_fields',
|
'key' => 'group_document_fields',
|
||||||
'title' => 'Document',
|
'title' => 'Document',
|
||||||
'fields' => [ csj_file('field_document_file', 'document_file', 'PDF'), csj_text('field_document_group', 'document_group', 'Groupe'), csj_text('field_document_date', 'document_date', 'Date') ],
|
'fields' => [ csj_file('field_document_file', 'document_file', 'PDF'), csj_text('field_document_group', 'document_group', 'Groupe'), csj_date('field_document_date', 'document_date', 'Date') ],
|
||||||
'location' => [[['param' => 'post_type', 'operator' => '==', 'value' => 'document']]],
|
'location' => [[['param' => 'post_type', 'operator' => '==', 'value' => 'document']]],
|
||||||
]);
|
]);
|
||||||
acf_add_local_field_group([
|
acf_add_local_field_group([
|
||||||
'key' => 'group_event_fields',
|
'key' => 'group_event_fields',
|
||||||
'title' => 'Événement',
|
'title' => 'Événement',
|
||||||
'fields' => [ csj_text('field_event_date', 'event_date', 'Date ISO'), csj_text('field_event_location', 'location', 'Lieu') ],
|
'fields' => [ csj_date('field_event_date', 'event_date', 'Date'), csj_text('field_event_location', 'location', 'Lieu') ],
|
||||||
'location' => [[['param' => 'post_type', 'operator' => '==', 'value' => 'event']]],
|
'location' => [[['param' => 'post_type', 'operator' => '==', 'value' => 'event']]],
|
||||||
]);
|
]);
|
||||||
acf_add_local_field_group([
|
acf_add_local_field_group([
|
||||||
'key' => 'group_business_fields',
|
'key' => 'group_business_fields',
|
||||||
'title' => 'Entreprise',
|
'title' => 'Entreprise',
|
||||||
'fields' => [ csj_text('field_business_phone', 'phone', 'Téléphone'), csj_text('field_business_email', 'email', 'Courriel'), csj_url('field_business_website', 'website', 'Site web'), csj_textarea('field_business_address', 'address', 'Adresse') ],
|
'fields' => [ csj_text('field_business_phone', 'phone', 'Téléphone'), csj_text('field_business_email', 'email', 'Courriel'), csj_text('field_business_website', 'website', 'Site web URL'), csj_textarea('field_business_address', 'address', 'Adresse') ],
|
||||||
'location' => [[['param' => 'post_type', 'operator' => '==', 'value' => 'local_business']]],
|
'location' => [[['param' => 'post_type', 'operator' => '==', 'value' => 'local_business']]],
|
||||||
]);
|
]);
|
||||||
acf_add_local_field_group([
|
acf_add_local_field_group([
|
||||||
@@ -91,8 +91,8 @@ function cascapedia_st_jules_acf_layouts(): array {
|
|||||||
|
|
||||||
function csj_layout( string $name, string $label, array $sub_fields ): array { return [ 'key' => 'layout_' . $name, 'name' => $name, 'label' => $label, 'display' => 'block', 'sub_fields' => $sub_fields ]; }
|
function csj_layout( string $name, string $label, array $sub_fields ): array { return [ 'key' => 'layout_' . $name, 'name' => $name, 'label' => $label, 'display' => 'block', 'sub_fields' => $sub_fields ]; }
|
||||||
function csj_text($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'text']; }
|
function csj_text($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'text']; }
|
||||||
function csj_url($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'url']; }
|
|
||||||
function csj_number($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'number']; }
|
function csj_number($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'number']; }
|
||||||
|
function csj_date($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'date_picker','display_format'=>'Y-m-d','return_format'=>'Y-m-d','first_day'=>1]; }
|
||||||
function csj_textarea($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'textarea','rows'=>3]; }
|
function csj_textarea($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'textarea','rows'=>3]; }
|
||||||
function csj_wysiwyg($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'wysiwyg','tabs'=>'all','toolbar'=>'basic','media_upload'=>0]; }
|
function csj_wysiwyg($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'wysiwyg','tabs'=>'all','toolbar'=>'basic','media_upload'=>0]; }
|
||||||
function csj_image($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'image','return_format'=>'id','preview_size'=>'medium']; }
|
function csj_image($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'image','return_format'=>'id','preview_size'=>'medium']; }
|
||||||
@@ -101,4 +101,4 @@ function csj_file($key,$name,$label): array { return ['key'=>$key,'label'=>$labe
|
|||||||
function csj_select($key,$name,$label,array $choices): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'select','choices'=>$choices,'default_value'=>array_key_first($choices)]; }
|
function csj_select($key,$name,$label,array $choices): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'select','choices'=>$choices,'default_value'=>array_key_first($choices)]; }
|
||||||
function csj_true_false($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'true_false','ui'=>1]; }
|
function csj_true_false($key,$name,$label): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'true_false','ui'=>1]; }
|
||||||
function csj_repeater($key,$name,$label,array $sub_fields): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'repeater','layout'=>'row','button_label'=>'Ajouter','sub_fields'=>$sub_fields]; }
|
function csj_repeater($key,$name,$label,array $sub_fields): array { return ['key'=>$key,'label'=>$label,'name'=>$name,'type'=>'repeater','layout'=>'row','button_label'=>'Ajouter','sub_fields'=>$sub_fields]; }
|
||||||
function csj_cta_fields(string $prefix): array { return [ csj_text($prefix.'_cta_label','cta_label','Libellé CTA'), csj_url($prefix.'_cta_url','cta_url','URL CTA'), csj_true_false($prefix.'_cta_external','cta_external','Lien externe') ]; }
|
function csj_cta_fields(string $prefix): array { return [ csj_text($prefix.'_cta_label','cta_label','Libellé CTA'), csj_text($prefix.'_cta_url','cta_url','URL / courriel / téléphone'), csj_true_false($prefix.'_cta_external','cta_external','Lien externe') ]; }
|
||||||
|
|||||||
@@ -11,8 +11,12 @@ function cascapedia_st_jules_locale(): string {
|
|||||||
return str_starts_with( $path, '/en' ) ? 'en' : 'fr';
|
return str_starts_with( $path, '/en' ) ? 'en' : 'fr';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cascapedia_st_jules_clean_text( ?string $value ): string {
|
||||||
|
return html_entity_decode( (string) $value, ENT_QUOTES | ENT_HTML5, 'UTF-8' );
|
||||||
|
}
|
||||||
|
|
||||||
function cascapedia_st_jules_l( ?string $value ): array {
|
function cascapedia_st_jules_l( ?string $value ): array {
|
||||||
$value = (string) $value;
|
$value = cascapedia_st_jules_clean_text( $value );
|
||||||
return [ 'fr' => $value, 'en' => $value ];
|
return [ 'fr' => $value, 'en' => $value ];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +121,7 @@ function cascapedia_st_jules_get_businesses(): array {
|
|||||||
]);
|
]);
|
||||||
$businesses = array_map( static function ( WP_Post $post ): array {
|
$businesses = array_map( static function ( WP_Post $post ): array {
|
||||||
return [
|
return [
|
||||||
'name' => get_the_title( $post ),
|
'name' => cascapedia_st_jules_clean_text( get_the_title( $post ) ),
|
||||||
'description' => cascapedia_st_jules_l( wp_strip_all_tags( $post->post_content ) ),
|
'description' => cascapedia_st_jules_l( wp_strip_all_tags( $post->post_content ) ),
|
||||||
'phone' => (string) get_post_meta( $post->ID, 'phone', true ),
|
'phone' => (string) get_post_meta( $post->ID, 'phone', true ),
|
||||||
'email' => (string) get_post_meta( $post->ID, 'email', true ),
|
'email' => (string) get_post_meta( $post->ID, 'email', true ),
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
manifest: true,
|
manifest: true,
|
||||||
|
sourcemap: true,
|
||||||
outDir: 'assets/dist',
|
outDir: 'assets/dist',
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
|
|||||||
Reference in New Issue
Block a user