Skip to content

Commit cc92d27

Browse files
authored
Added cookies fallback page (#1280)
1 parent 5c93a79 commit cc92d27

File tree

5 files changed

+120
-10
lines changed

5 files changed

+120
-10
lines changed

web/landing/assets/controllers/cookie_consent_controller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class extends Controller {
1414
// If accepted previously, inject GA
1515
if (consentStatus === "accepted") {
1616
this.consentGranted();
17+
} else {
1718
this.showButton();
1819
}
1920
} else {
@@ -25,7 +26,6 @@ export default class extends Controller {
2526
localStorage.setItem("cookie-consent", "accepted");
2627
this.consentGranted();
2728
this.hideBanner();
28-
this.showButton()
2929
}
3030

3131
reject() {
@@ -38,6 +38,7 @@ export default class extends Controller {
3838
});
3939
this.hideBanner();
4040
this.showButton();
41+
window.location.href = '/cookies';
4142
}
4243

4344
consentGranted() {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Controller } from "@hotwired/stimulus";
2+
3+
/* stimulusFetch: 'lazy' */
4+
export default class extends Controller {
5+
6+
connect() {}
7+
8+
accept() {
9+
localStorage.setItem("cookie-consent", "accepted");
10+
11+
this.consentGranted();
12+
13+
window.location = '/';
14+
}
15+
16+
consentGranted() {
17+
gtag("consent", "update", {
18+
ad_user_data: 'granted',
19+
ad_personalization: 'granted',
20+
ad_storage: 'granted',
21+
analytics_storage: 'granted'
22+
});
23+
}
24+
}

web/landing/src/Flow/Website/Controller/HomeController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ public function __construct(
1616
) {
1717
}
1818

19+
#[Route('/cookies', name: 'cookies', options: ['sitemap' => false])]
20+
public function cookies() : Response
21+
{
22+
return $this->render('main/cookies.html.twig', [
23+
]);
24+
}
25+
1926
#[Route('/', name: 'home', options: ['sitemap' => true])]
2027
public function home() : Response
2128
{

web/landing/templates/base.html.twig

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<link rel="stylesheet" href="{{ asset('styles/app.css') }}">
3939
{% endblock %}
4040

41+
{% block tracking %}
4142
<script>
4243
window.dataLayer = window.dataLayer || [];
4344
function gtag() {
@@ -53,6 +54,7 @@
5354
gtag('config', '{{ google_analytics_id }}');
5455
</script>
5556
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_id }}">gtag('config', '{{ google_conversion_tag }}');</script>
57+
{% endblock %}
5658

5759
{% block javascripts %}
5860
<script>
@@ -147,26 +149,29 @@
147149
</footer>
148150

149151
<div data-controller="cookie-consent" data-cookie-consent-ga-id-value="{{ google_analytics_id }}">
150-
<div data-cookie-consent-target="banner" class="hidden fixed bottom-0 left-0 w-full bg-black text-white text-sm p-5 flex flex-col items-center justify-center space-y-2 md:space-y-0 md:flex-row md:justify-between z-50">
152+
<div data-cookie-consent-target="banner"
153+
class="border-t-4 border-orange-100 hidden fixed bottom-0 left-0 w-full bg-black text-white text-lg p-5 flex flex-col items-center justify-center space-y-2 md:space-y-0 md:flex-row md:justify-between z-50"
154+
>
151155
<span>
152-
We use cookies to understand how you interact with our site, so we can improve our content and tailor it to your interests.<br/>
153-
By clicking “Accept” you’ll help us analyze user behavior, deliver more relevant features, and optimize your overall experience.
156+
Oops, sorry we have to ask this—but we need your okay to use cookies for page view stats. <br/>
157+
It helps us improve this open-source project and keep it awesome!<br/>
158+
Care to help out?
154159
</span>
155160

156161
<div class="flex space-x-4 mt-2 md:mt-0">
157162
<button
158163
type="button"
159-
class="border border-blue-100 hover:border-blue-200 text-white px-4 py-2 rounded"
160-
data-action="click->cookie-consent#reject"
164+
class="bg-blue-100 hover:bg-blue-200 text-white px-4 py-2 rounded ml-4"
165+
data-action="click->cookie-consent#accept"
161166
>
162-
Reject All
167+
Accept All
163168
</button>
164169
<button
165170
type="button"
166-
class="bg-blue-100 hover:bg-blue-200 text-white px-4 py-2 rounded ml-4"
167-
data-action="click->cookie-consent#accept"
171+
class="border border-blue-100 hover:border-blue-200 text-white px-4 py-2 rounded"
172+
data-action="click->cookie-consent#reject"
168173
>
169-
Accept All
174+
Reject All
170175
</button>
171176
</div>
172177
</div>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{% extends 'base.html.twig' %}
2+
3+
{%- block title -%}
4+
Flow PHP - Data Processing Framework
5+
{%- endblock -%}
6+
7+
{%- block description -%}
8+
Flow is a PHP-based, strongly typed data processing framework with low memory footprint that can process various data sources consistently.
9+
It offers a unified API for all data sources, including CSV, JSON, XML, Text, Parquet, Avro, Rest API, RDBMS, Elasticsearch / Meilisearch.
10+
Flow not only enables you to process various data sources consistently, but also strives to accurately detect data types and cast them to the appropriate PHP types.
11+
{%- endblock -%}
12+
13+
{#{% block tracking %}#}
14+
{#{% endblock %}#}
15+
16+
{% block hero %}
17+
{% endblock %}
18+
19+
{% block main %}
20+
<div class="max-w-screen-xl mx-auto" data-controller="cookie-fallback">
21+
<section class="rounded max-w-4xl p-8 overflow-auto shadow-2xl shadow-gray rounded border-gray border-2 mx-auto my-10">
22+
<h1 class="font-bold text-4xl">Too bad... But your Privacy is our Motivation</h1>
23+
<p class="mt-4">
24+
We completely respect your decision to reject cookies. However, before you go,
25+
we’d like to share why these cookies are so vital for our open-source project’s
26+
progress.
27+
</p>
28+
29+
<h2 class="font-bold text-2xl">1. Showing Us What Matters</h2>
30+
<p class="mt-2">
31+
Cookies let us see which features people use the most and where improvements
32+
are truly needed. We don’t track personal information—only anonymized statistics
33+
that reveal which parts of our project spark the most interest.
34+
</p>
35+
36+
<h2 class="font-bold text-2xl">2. Fueling Our Motivation</h2>
37+
<p class="mt-2">
38+
We’re a team of open-source enthusiasts, and seeing active engagement gives us
39+
a real morale boost. When we notice spikes in traffic or a rise in feature usage,
40+
it affirms that the community finds our work valuable, and it inspires us to
41+
keep innovating.
42+
</p>
43+
44+
<h2 class="font-bold text-2xl">3. Free & Always Improving</h2>
45+
<p class="mt-2">
46+
By understanding usage trends, we can direct our time and limited resources
47+
toward the features that matter most. This ensures our project remains free,
48+
relevant, and beneficial for everyone who relies on it.
49+
</p>
50+
51+
<h2 class="font-bold text-2xl">4. Respecting Your Data</h2>
52+
<p class="mt-2">
53+
We take privacy seriously. Any information gathered remains anonymous and
54+
helps us enhance functionality based on collective interests rather than
55+
individual profiles.
56+
</p>
57+
58+
<p class="mt-4">
59+
Thank you for considering how essential cookies are to our open-source efforts!
60+
</p>
61+
<!-- This button can redirect or open a small dialog to change cookie preferences -->
62+
63+
<div class="text-center mt-8">
64+
<button data-action="click->cookie-fallback#accept"
65+
type="button"
66+
class="bg-blue-100 hover:bg-blue-200 text-white px-4 py-2 rounded ml-4"
67+
>
68+
Return &amp; Re-enable Cookies
69+
</button>
70+
</div>
71+
</section>
72+
</div>
73+
{% endblock %}

0 commit comments

Comments
 (0)