Module: Decidim::DecidimAwesome::DataConsentCellOverride
- Defined in:
- app/cells/concerns/decidim/decidim_awesome/data_consent_cell_override.rb
Instance Method Summary collapse
-
#categories ⇒ Object
- { slug: “essential”, mandatory: true, title: “Essential cookies”, description: “These cookies are necessary for the website to function and cannot be switched” visibility: visible items: [ { type: “cookie”, name: “_session_id”, service: “this page”, description: “Session ID cookie”, expiration: … }, { type: “cookie”, name: “decidim-consent”, service: “this page”, description: “Consent cookie”, expiration: … }, { type: “local_storage”, name: “pwaInstallPromptSeen”, service: “this page”, description: “PWA install prompt seen”, expiration: … }
-
}, etc… ].
Instance Method Details
#categories ⇒ Object
[ {
slug: "essential",
mandatory: true,
title: "Essential cookies",
description: "These cookies are necessary for the website to function and cannot be switched"
visibility: visible
items: [
{ type: "cookie", name: "_session_id", service: "this page", description: "Session ID cookie", expiration: ... },
{ type: "cookie", name: "decidim-consent", service: "this page", description: "Consent cookie", expiration: ... },
{ type: "local_storage", name: "pwaInstallPromptSeen", service: "this page", description: "PWA install prompt seen", expiration: ... }
]
}, etc... ]
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/cells/concerns/decidim/decidim_awesome/data_consent_cell_override.rb', line 19 def categories @categories ||= CookieManagementStore.new(model, awesome_categories).categories.values.map do |category| next if category["visibility"] == "hidden" category.tap do |cat| cat["title"] = translated_attribute(category["title"]) cat["description"] = translated_attribute(category["description"]) cat["items"] = cat["items"].values.map do |item| item.tap do |i| i["service"] = translated_attribute(i["service"]) i["description"] = translated_attribute(i["description"]) i["expiration"] = translated_attribute(i["expiration"]) end end.compact end end.compact end |