diff --git a/app/assets/stylesheets/bioportal.scss b/app/assets/stylesheets/bioportal.scss
index b756e6ab9..f41146b9d 100644
--- a/app/assets/stylesheets/bioportal.scss
+++ b/app/assets/stylesheets/bioportal.scss
@@ -1254,4 +1254,44 @@ turbo-frame[busy] ~ .show-if-loading {
.hide{
display:none;
+}
+
+.cookies-modal {
+ position: fixed;
+ height: auto;
+ top: initial;
+ left: initial;
+ right: 10px;
+ bottom: 10px;
+ transform: initial;
+ grid-template-rows: minmax(0, 1fr);
+ z-index: 99999;
+ background: white;
+ border-style: solid;
+ border-color: #f2f2f2;
+ border-radius: 0;
+ border-width: 0;
+ padding: 15px 20px;
+ display: grid;
+ grid-gap: 10px;
+ box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
+ width: 526px;
+ grid-row-gap: 10px;
+
+ h4{
+ justify-self: center;
+ font-size: 16px;
+ color: var(--primary-color);
+ font-weight: 500;
+ }
+ p {
+ word-wrap: break-word;
+ font-size: 12px;
+ margin-bottom: 5px;
+ }
+ .cookie-privacy-link {
+ font-size: 12px;
+ text-align: center;
+ text-decoration: underline;
+ }
}
\ No newline at end of file
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 39de2a67e..f0fd32787 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -45,6 +45,11 @@ def index
end
+ def set_cookies
+ session[:cookies_accepted] = params[:cookies] if params[:cookies]
+ render 'cookies', layout: nil
+ end
+
def tools
@tools = {
search: {
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 608c636fa..4e25f7a53 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -648,6 +648,10 @@ def ontologies_selector(id:, label: nil, name: nil, selected: nil, placeholder:
end
end
+ def link_button_component(href: , value: , id:, size: nil)
+ render Buttons::RegularButtonComponent.new(id:id, value: value, variant: "primary", type: 'link', href: href, size: size)
+ end
+
def save_button_component(class_name: nil, id: , value:, data: nil, size: nil, type: nil)
content_tag(:div, data: data, class: class_name) do
render Buttons::RegularButtonComponent.new(id:id, value: value, variant: "primary", state: 'regular', size: size, type: type) do |btn|
diff --git a/app/views/home/cookies.html.haml b/app/views/home/cookies.html.haml
new file mode 100644
index 000000000..453490073
--- /dev/null
+++ b/app/views/home/cookies.html.haml
@@ -0,0 +1,18 @@
+= turbo_frame_tag :cookies_modal do
+ - if session[:cookies_accepted].nil? # don't re-render if a true/false selected
+ %section.cookies-modal
+ %h4
+ = t('cookies_modal.title')
+ %p
+ = t('cookies_modal.paragraph1')
+ %p
+ = t('cookies_modal.paragraph2')
+ %p
+ = t('cookies_modal.paragraph3')
+ %div.d-flex
+ %div.w-50
+ = link_button_component(id:'accept-cookie-selector', value: t('cookies_modal.accept_button'), href: cookies_path(cookies: true), size: "slim")
+ %div.w-50.ml-1
+ = link_button_component(id:'deny-cookie-selector', value: t('cookies_modal.deny_button'), href: cookies_path(cookies: false), size: "slim")
+ %div.cookie-privacy-link
+ = link_to t('cookies_modal.privacy_link'), $FOOTER_LINKS.dig(:sections, :agreements, :privacy_policy)
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb
index 7e23fd5f5..f1e1f894f 100644
--- a/app/views/layouts/_header.html.erb
+++ b/app/views/layouts/_header.html.erb
@@ -39,6 +39,7 @@
<%=render partial: 'layouts/topnav'%>
-
-
+ <%= turbo_frame_tag :cookies_modal, src: cookies_path if session[:cookies_accepted].nil? %>
+
+
<%=render partial: 'layouts/notices'%>
\ No newline at end of file
diff --git a/app/views/layouts/appliance.html.haml b/app/views/layouts/appliance.html.haml
index 2497fd07e..a27a8d054 100644
--- a/app/views/layouts/appliance.html.haml
+++ b/app/views/layouts/appliance.html.haml
@@ -26,7 +26,8 @@
%body{:class => "#{controller_name} #{action_name}"}
= render partial: "layouts/topnav"
-
+ = turbo_frame_tag :cookies_modal, src: cookies_path if session[:cookies_accepted].nil?
+
%div.flex-grow-1
= render partial: "layouts/notices"
= modal_frame_container
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 583d63f52..69ecbc62b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1346,7 +1346,7 @@ en:
export_metadata: Export all metadata
abstract: Abstract
description: Description
-
+
htaccess_modal_title: "Rewrite rules for %{acronym} semantic resource"
instructions_servers: Instructions for %{server} servers
htaccess_redirection_description: "We offer a seamless solution to make your semantic resource URIs resolvable and content negotiable by allowing URL redirection for your semantic resource URIs to our EcoPortal URIs. To facilitate this process, we've provided you with a set of .htaccess rewrite rules. By following the simple instructions below, you'll be able to implement these rules swiftly and efficiently, ensuring smooth redirection"
@@ -1374,7 +1374,7 @@ en:
instruction_4_content: "Run the following command to test the redirection configuration `sudo nginx -t`"
instruction_5: "Reload Nginx to apply the changes:"
instruction_5_content: "Restart the nginx server to apply the redirection using this command `sudo systemctl reload nginx`"
-
+
components:
check_resolvability: checking resolvability...
error_block: child_data_generator block did not provide all the child arguements
@@ -1462,4 +1462,12 @@ en:
description: >
This tool/service verifies the resolvability of Uniform Resource Identifiers (URIs) and their content negotiability.
It checks whether a given URI is accessible and whether the content associated with it can be negotiated based on the client's preferences.
- This functionality ensures the reliability and accessibility of linked resources within the RDF ecosystem, aiding in maintaining data integrity and facilitating seamless integration with external resources.
\ No newline at end of file
+ This functionality ensures the reliability and accessibility of linked resources within the RDF ecosystem, aiding in maintaining data integrity and facilitating seamless integration with external resources.
+ cookies_modal:
+ title: "Manage Cookie Consent"
+ paragraph1: "We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies in the \"Privacy Statement\" link."
+ paragraph2: "We also use third-party cookies that help us analyse how you use this website, store your preferences, and provide the content that is relevant to you. These cookies will only be stored in your browser with your prior consent."
+ paragraph3: "Please note that disabling such cookies may affect your browsing experience."
+ accept_button: "Accept"
+ deny_button: "Deny"
+ privacy_link: "Privacy Statement"
\ No newline at end of file
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 0dfc741a2..aebac8aec 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -302,9 +302,9 @@ fr:
total_results: Résultats totaux
insert_sample_text: Insérer un texte d'exemple
sample_text: Il y a eu de nombreuses études récentes sur l'utilisation d'antagonistes microbiens pour contrôler les maladies causées par des bactéries phytopathogènes telluriques
- et aériennes, dans le but de remplacer les méthodes actuelles de contrôle chimique et d'éviter l'utilisation extensive de fongicides, qui conduisent souvent à une résistance chez les pathogènes des plantes.
- En agriculture, les microorganismes promoteurs de croissance des plantes et de biocontrôle ont émergé comme des alternatives sûres aux pesticides chimiques. Les espèces de Streptomyces et leurs
- métabolites peuvent avoir un grand potentiel en tant qu'agents excellents pour contrôler divers phytopathogènes fongiques et bactériens.
+ et aériennes, dans le but de remplacer les méthodes actuelles de contrôle chimique et d'éviter l'utilisation extensive de fongicides, qui conduisent souvent à une résistance chez les pathogènes des plantes.
+ En agriculture, les microorganismes promoteurs de croissance des plantes et de biocontrôle ont émergé comme des alternatives sûres aux pesticides chimiques. Les espèces de Streptomyces et leurs
+ métabolites peuvent avoir un grand potentiel en tant qu'agents excellents pour contrôler divers phytopathogènes fongiques et bactériens.
concepts:
error_valid_concept: "Erreur : Vous devez fournir un identifiant de concept valide"
@@ -1505,3 +1505,11 @@ fr:
Cette fonctionnalité garantit la fiabilité et l'accessibilité des ressources liées dans l'écosystème RDF, aidant ainsi à maintenir l'intégrité des données et facilitant l'intégration transparente avec des ressources externes.
+ cookies_modal:
+ title: "Gérer le consentement des cookies"
+ paragraph1: "Nous utilisons des cookies pour vous aider à naviguer efficacement et à effectuer certaines fonctions. Vous trouverez des informations détaillées sur tous les cookies dans le lien \"Déclaration de confidentialité\"."
+ paragraph2: "Nous utilisons également des cookies tiers qui nous aident à analyser comment vous utilisez ce site Web, à stocker vos préférences et à fournir le contenu qui vous est pertinent. Ces cookies ne seront stockés dans votre navigateur qu'avec votre consentement préalable."
+ paragraph3: "Veuillez noter que la désactivation de ces cookies peut affecter votre expérience de navigation."
+ accept_button: "Accepter"
+ deny_button: "Refuser"
+ privacy_link: "Déclaration de confidentialité"
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index de59b5874..34fd0b2aa 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,5 @@
Rails.application.routes.draw do
+ match 'cookies', to: 'home#set_cookies', via: [:post, :get]
root to: 'home#index'
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?