Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #420 remove enkode_emails over entire content #435

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 42 additions & 40 deletions templates/_site/_contact.twig
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% extends "_site/_layout" %}
{% extends '_site/_layout' %}

{% set breadcrumbs = [entry] %}

{% block content %}

{% include "_site/_snippet/_content/_defaultHeader" %}
{% include '_site/_snippet/_content/_defaultHeader' %}

{% include '_site/_snippet/_content/_contentBuilder'
with {
with {
settings : {
section: 'section',
container: 'container'
Expand All @@ -25,51 +25,53 @@
{% set redirectEntry = craft.entries.id(form.submitActionEntryId).siteId(currentSite.id).one() %}

{% do form.setSettings({
redirectUrl: redirectEntry.url,
}) %}
redirectUrl: redirectEntry.url,
}) %}

{{ craft.formie.renderForm(form) }}
</div>
</div>
{% endif %}
<div class="w-full px-4 md:w-1/2">
<div class="bg-light">
<div class="aspect-video leaflet-map" data-address="Vital Decosterstraat 67A/0301, 3000 Leuven"></div>
<div class="p-8">
<h3 class="text-3xl">{{ systemName }}</h3>
{% apply enkode_emails %}
<div class="w-full px-4 md:w-1/2">
<div class="bg-light">
<div class="aspect-video leaflet-map" data-address="Vital Decosterstraat 67A/0301, 3000 Leuven"></div>
<div class="p-8">
<h3 class="text-3xl">{{ systemName }}</h3>

{% if generalInfo.address|length %}
<div class="mt-6">
{{ generalInfo.address|nl2br }}
</div>
{% endif %}
{% if generalInfo.mail|length or generalInfo.phone|length %}
<div class="mt-6 space-y-2">
{% if generalInfo.mail|length %}
<div class="">
{{ icon('envelope') }}
<a class="no-underline hover:underline" href="mailto:{{generalInfo.mail}}">{{generalInfo.mail}}</a>
</div>
{% endif %}
{% if generalInfo.phone|length %}
<div class="">
{{ icon('phone') }}
<a class="no-underline hover:underline" href="tel:{{generalInfo.phone}}">{{generalInfo.phone}}</a>
</div>
{% endif %}
</div>
{% endif %}
{% if generalInfo.facebook or generalInfo.instagram or generalInfo.linkedin or generalInfo.twitter or generalInfo.youtube %}
<div class="flex items-center mt-6">
<div class="mr-2">{{ 'Volg ons: '|t }}</div>
<ul class="flex space-x-4">
{% include '_site/_snippet/_content/_socialMedia' with { generalInfo : generalInfo} %}
</ul>
</div>
{% endif %}
{% if generalInfo.address|length %}
<div class="mt-6">
{{ generalInfo.address|nl2br }}
</div>
{% endif %}
{% if generalInfo.mail|length or generalInfo.phone|length %}
<div class="mt-6 space-y-2">
{% if generalInfo.mail|length %}
<div class="">
{{ icon('envelope') }}
<a class="no-underline hover:underline" href="mailto:{{generalInfo.mail}}">{{generalInfo.mail}}</a>
</div>
{% endif %}
{% if generalInfo.phone|length %}
<div class="">
{{ icon('phone') }}
<a class="no-underline hover:underline" href="tel:{{generalInfo.phone}}">{{generalInfo.phone}}</a>
</div>
{% endif %}
</div>
{% endif %}
{% if generalInfo.facebook or generalInfo.instagram or generalInfo.linkedin or generalInfo.twitter or generalInfo.youtube %}
<div class="flex items-center mt-6">
<div class="mr-2">{{ 'Volg ons: '|t }}</div>
<ul class="flex space-x-4">
{% include '_site/_snippet/_content/_socialMedia' with { generalInfo : generalInfo} %}
</ul>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endapply %}
</div>
</div>
</div>
Expand Down
164 changes: 81 additions & 83 deletions templates/_site/_layout.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,90 +5,88 @@

<!DOCTYPE html>
<html class="" lang="{{ currentLocale[0] }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/frontend/inert.css" id="inert-style"/>
{# Change these when you have a multisite with different layout #}
{{ craft.vite.script("tailoff/js/site.ts", false) }}
{{ craft.vite.inline("@webroot/favicon/site/webapp.html") }}
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/frontend/inert.css" id="inert-style"/>
{# Change these when you have a multisite with different layout #}
{{ craft.vite.script('tailoff/js/site.ts', false) }}
{{ craft.vite.inline('@webroot/favicon/site/webapp.html') }}

{% hook 'seo-fields' %}
{% if 'statik.be' in baseUrl %}
<meta name="robots" content="noindex">
{% endif %}

{% block head_scripts %}
<link rel="preconnect" href="//www.googletagmanager.com">
{# <link rel="preconnect" href="//fonts.gstatic.com"> #}
{% if not craft.app.request.isPreview() %}
{{ fallback.gtmHead | raw }}
{% endif %}
{% endblock %}

{% if entry is defined and not shouldPageBeIndexed(baseUrl, entry) %}
<meta name="robots" content="noindex">
<meta name="robots" content="nofollow">
{% endif %}
</head>

<body class="page-{{ craft.app.request.getSegment(1) ?: 'home' }} {% block bodyClasses %}{% endblock %} preload-transitions">
{% apply enkode_emails %}
{% if not craft.app.request.isPreview() %}
{{ fallback.gtmBody | raw }}
{% endif %}

{% if systemOffline is not defined %}
{% set systemOffline = false %}
{% endif %}

{% if currentUser and entry is defined and entry.canSave(currentUser) and not systemOffline and not craft.app.request.isPreview() %}
<a href="{{ entry.getCpEditUrl() }}" target="_blank" class="hidden md:inline-block transform translate-x-[115px] fixed px-4 py-2 text-white bg-primary right-0 rounded-l-full shadow-lg top-10 z-99 transition ease duration-400 hover:translate-x-0">
<span>{{ icon('pencil', { class: '-mt-1' }) }} </span>
<span class="ml-2">Edit this page</span>
</a>
{% endif %}

<div class="flex flex-col min-h-screen page-wrap " id="mainContentBlock">

<div class="sr-only skip-to-main ie-sr-only">
<a href="#main">{{ 'Ga verder naar de inhoud'|t }}</a>
</div>

<div class="fixed top-0 -translate-y-full focus-within:transition-transform focus-within:duration-300 focus-within:ease-in-out ring-primary focus-within:translate-y-0 left-6 skip-to-main focus-within:shadow-card">
<a href="#main" class="block p-4 text-black bg-white">
{{ 'Ga verder naar de inhoud'|t }}
{{ icon('chevron-right', { class: 'ml-2' }) }}
{% if 'statik.be' in baseUrl %}
<meta name="robots" content="noindex">
{% endif %}

{% block head_scripts %}
<link rel="preconnect" href="//www.googletagmanager.com">
{# <link rel="preconnect" href="//fonts.gstatic.com"> #}
{% if not craft.app.request.isPreview() %}
{{ fallback.gtmHead | raw }}
{% endif %}
{% endblock %}

{% if entry is defined and not shouldPageBeIndexed(baseUrl, entry) %}
<meta name="robots" content="noindex">
<meta name="robots" content="nofollow">
{% endif %}
</head>

<body class="page-{{ craft.app.request.getSegment(1) ?: 'home' }} {% block body_classes %}{% endblock %} preload-transitions">
{% if not craft.app.request.isPreview() %}
{{ fallback.gtmBody | raw }}
{% endif %}

{% if systemOffline is not defined %}
{% set systemOffline = false %}
{% endif %}

{% if currentUser and entry is defined and entry.canSave(currentUser) and not systemOffline and not craft.app.request.isPreview() %}
<a href="{{ entry.getCpEditUrl() }}" target="_blank" class="hidden md:inline-block transform translate-x-[115px] fixed px-4 py-2 text-white bg-primary right-0 rounded-l-full shadow-lg top-10 z-99 transition ease duration-400 hover:translate-x-0">
<span>{{ icon('pencil', { class: '-mt-1' }) }} </span>
<span class="ml-2">Edit this page</span>
</a>
</div>

{% include '_site/_snippet/_global/_header' %}
{% include '_site/_snippet/_global/_flyout' %}

<main class="flex-1 page-main" id="main">
{% block content %}{% endblock %}
</main>

{% include '_site/_snippet/_global/_footer' %}

</div>

{# Cookiebanner #}
{% if not isBot %}
{{ craft.cookieBanner.render({
supportIE: true,
showCookieBanner: (entry.type is defined and entry.type.handle != 'cookiePolicy'),
}) }}
{% endif %}

{% block inline_scripts %}
<script>
window.app = window.app || {};
app.variables = {
assetsPath: "/"
};
</script>
{% endblock %}
{% endapply %}
</body>
{% endif %}

<div class="flex flex-col min-h-screen page-wrap " id="mainContentBlock">

<div class="sr-only skip-to-main ie-sr-only">
<a href="#main">{{ 'Ga verder naar de inhoud'|t }}</a>
</div>

<div class="fixed top-0 -translate-y-full focus-within:transition-transform focus-within:duration-300 focus-within:ease-in-out ring-primary focus-within:translate-y-0 left-6 skip-to-main focus-within:shadow-card">
<a href="#main" class="block p-4 text-black bg-white">
{{ 'Ga verder naar de inhoud'|t }}
{{ icon('chevron-right', { class: 'ml-2' }) }}
</a>
</div>

{% include '_site/_snippet/_global/_header' %}
{% include '_site/_snippet/_global/_flyout' %}

<main class="flex-1 page-main" id="main">
{% block content %}{% endblock %}
</main>

{% include '_site/_snippet/_global/_footer' %}

</div>

{# Cookiebanner #}
{% if not isBot %}
{{ craft.cookieBanner.render({
supportIE: true,
showCookieBanner: (entry.type is defined and entry.type.handle != 'cookiePolicy'),
}) }}
{% endif %}

{% block inline_scripts %}
<script>
window.app = window.app || {};
app.variables = {
assetsPath: "/"
};
</script>
{% endblock %}
</body>
</html>
89 changes: 46 additions & 43 deletions templates/_site/_snippet/_content/_blocks/_callToAction.twig
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
{% if block.blockTitle|length or block.text|length %}
<div class="w-full mx-auto overflow-hidden bg-white rounded-lg md:shadow-card">
<div class="flex flex-wrap -mx-4">
{% if block.image and block.image.collect()|length %}
{% set image = block.image.collect().first() ? block.image.collect().first() : fallback.image.one() %}
{% set optimizedImage = image.optimizedTextImage %}
{% if optimizedImage|length %}
<div class="w-full px-4 bg-center bg-cover md:w-1/2 js-bg-target aspect-video md:aspect-auto"
{% if optimizedImage.colorPalette %}style="background-color: {{ optimizedImage.colorPalette[0] }}; background-position: {% for focalPoint in image.getFocalPoint() %} {{ focalPoint * 100 }}% {% endfor %};"{% endif %}>
<picture>
{% if craft.imageOptimize.serverSupportsWebP() and image.extension != 'svg' and image.extension != 'gif' and image.extension != 'webp' %}
<source srcset="{{ optimizedImage.srcsetWebP() }}"
sizes="(max-width: 479px) 95vw, (min-width: 480px) and (max-width: 659px) 448px, (min-width: 660px) and (max-width: 819px) 628px, (min-width: 820px) and (max-width: 979px) 378px, (min-width: 980px) and (max-width: 1199px) 458px, (min-width: 1200px) 568px"
type="image/webp"/>
{% endif %}
<img src="{{ optimizedImage.optimizedImageUrls|length == 0 ? image.getUrl() : optimizedImage.placeholderBox() }}"
srcset="{{ optimizedImage.srcset() }}"
sizes="(max-width: 479px) 95vw, (min-width: 480px) and (max-width: 659px) 448px, (min-width: 660px) and (max-width: 819px) 628px, (min-width: 820px) and (max-width: 979px) 378px, (min-width: 980px) and (max-width: 1199px) 458px, (min-width: 1200px) 568px"
alt="{{ image.alt }}"
class="sr-only js-bg-src" loading="lazy"/>
</picture>
</div>
{% endif %}
{% endif %}
<div class="w-full {% if block.image|length %}md:w-1/2{% else %}text-center{% endif %} px-4">
<div class="p-6">
{% if block.blockTitle|length %}
<h2 id="{{ block.blockTitle|slugify }}">{{ block.blockTitle }}</h2>
{% endif %}

{% if block.text|length %}
<div class="text-editor w-full {% if not block.image|length %}md:w-2/3 mx-auto{% endif %}">
{{ block.text }}
{% apply enkode_emails %}
{% if block.blockTitle|length or block.text|length %}
<div class="w-full mx-auto overflow-hidden bg-white rounded-lg md:shadow-card">
<div class="flex flex-wrap -mx-4">
{% if block.image and block.image.collect()|length %}
{% set image = block.image.collect().first() ? block.image.collect().first() : fallback.image.one() %}
{% set optimizedImage = image.optimizedTextImage %}
{% if optimizedImage|length %}
<div class="w-full px-4 bg-center bg-cover md:w-1/2 js-bg-target aspect-video md:aspect-auto"
{% if optimizedImage.colorPalette %}style="background-color: {{ optimizedImage.colorPalette[0] }}; background-position: {% for focalPoint in image.getFocalPoint() %} {{ focalPoint * 100 }}% {% endfor %};"{% endif %}>
<picture>
{% if craft.imageOptimize.serverSupportsWebP() and image.extension != 'svg' and image.extension != 'gif' and image.extension != 'webp' %}
<source srcset="{{ optimizedImage.srcsetWebP() }}"
sizes="(max-width: 479px) 95vw, (min-width: 480px) and (max-width: 659px) 448px, (min-width: 660px) and (max-width: 819px) 628px, (min-width: 820px) and (max-width: 979px) 378px, (min-width: 980px) and (max-width: 1199px) 458px, (min-width: 1200px) 568px"
type="image/webp"/>
{% endif %}
<img src="{{ optimizedImage.optimizedImageUrls|length == 0 ? image.getUrl() : optimizedImage.placeholderBox() }}"
srcset="{{ optimizedImage.srcset() }}"
sizes="(max-width: 479px) 95vw, (min-width: 480px) and (max-width: 659px) 448px, (min-width: 660px) and (max-width: 819px) 628px, (min-width: 820px) and (max-width: 979px) 378px, (min-width: 980px) and (max-width: 1199px) 458px, (min-width: 1200px) 568px"
alt="{{ image.alt }}"
class="sr-only js-bg-src" loading="lazy"/>
</picture>
</div>
{% endif %}
{% endif %}
<div class="w-full {% if block.image|length %}md:w-1/2{% else %}text-center{% endif %} px-4">
<div class="p-6">
{% if block.blockTitle|length %}
<h2 id="{{ block.blockTitle|slugify }}">{{ block.blockTitle }}</h2>
{% endif %}

{% if not block.cta.isEmpty() %}
<div class="mt-6">
{{ render_hyper_links(block.cta) | raw }}
</div>
{% endif %}
{% if block.text|length %}
<div class="text-editor w-full {% if not block.image|length %}md:w-2/3 mx-auto{% endif %}">
{{ block.text }}
</div>
{% endif %}

{% if not block.cta.isEmpty() %}
<div class="mt-6">
{{ render_hyper_links(block.cta) | raw }}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% else %}
<div class="flex justify-center">
{{ render_hyper_links(block.cta) | raw }}
</div>
{% endif %}
{% else %}
<div class="flex justify-center">
{{ render_hyper_links(block.cta) | raw }}
</div>
{% endif %}
{% endapply %}
14 changes: 8 additions & 6 deletions templates/_site/_snippet/_content/_blocks/_customTable.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% if block.blockTitle|length %}
<h2 class="text-center">{{ block.blockTitle }}</h2>
{% endif %}
<div class="text-editor custom-table">
{{block.table}}
</div>
{% apply enkode_emails %}
{% if block.blockTitle|length %}
<h2 class="text-center">{{ block.blockTitle }}</h2>
{% endif %}
<div class="text-editor custom-table">
{{block.table}}
</div>
{% endapply %}
Loading