Skip to content
Open
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
4 changes: 4 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ GEOCODER_UNITS=km # Units for geocoder results (e.g., km or m
# Delay until deleted authorization's versions are deleted after the authorization creation (in days, default: 30)
# DECIDIM_CLEANER_DELETE_DELETED_AUTHORIZATIONS_DATA=

# Custom color for the newsletter banner (hex value, e.g. #FFFFFF for white)
# If not set, the default Decidim color will be used
# DECIDIM_CUSTOM_NEWSLETTER_BAR_COLOR=

#= Decidim AI
# DECIDIM_AI_ENABLED="true" Default: true
# DECIDIM_AI_USER_SPAM_ANALYZER_ENABLED="true" Default: true
Expand Down
68 changes: 68 additions & 0 deletions app/cells/decidim/data_consent/category.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<div class="cookies__category" data-id="<%= category[:slug] %>">
<div class="cookies__category-trigger">
<label for="dc-<%= category[:slug] %>" class="cookies__category-toggle">
<input
<%== %(checked="checked") if category[:mandatory] %>
id="dc-<%= category[:slug] %>"
type="checkbox"
name="<%= category[:slug] %>"
<%= "disabled" if category[:mandatory] %>>
<span class="sr-only"><%= t("layouts.decidim.data_consent.modal.toggle", consent_category: category[:title]) %></span>
<span class="cookies__category-toggle-content"></span>
<%= icon "check-line", class: "cookies__category-toggle-icon" %>
<%= icon "close-line", class: "cookies__category-toggle-icon" %>
</label>

<div id="accordion-trigger-<%= category[:slug] %>" data-controls="accordion-panel-<%= category[:slug] %>" aria-labelledby="accordion-title-<%= category[:slug] %>">
<span id="accordion-title-<%= category[:slug] %>" class="cookies__category-trigger-title">
<%= category[:title] %>
</span>

<span>
<%= icon "arrow-down-s-line", class: "cookies__category-trigger-arrow" %>
<%= icon "arrow-up-s-line", class: "cookies__category-trigger-arrow" %>
</span>
</div>

</div>

<div id="accordion-panel-<%= category[:slug] %>" class="cookies__category-panel" aria-hidden="true">
<p><%= category[:description] %></p>

<% if category[:items].present? %>
<div>
<div class="cookies__category-panel__tr">
<div class="cookies__category-panel__th">
<%= t("layouts.decidim.data_consent.details.columns.type") %>
</div>
<div class="cookies__category-panel__th">
<%= t("layouts.decidim.data_consent.details.columns.name") %>
</div>
<div class="cookies__category-panel__th">
<%= t("layouts.decidim.data_consent.details.columns.service") %>
</div>
<div class="cookies__category-panel__th">
<%= t("layouts.decidim.data_consent.details.columns.description") %>
</div>
</div>

<% category[:items].each do |item| %>
<div class="cookies__category-panel__tr">
<div class="cookies__category-panel__td">
<%= t("layouts.decidim.data_consent.details.types.#{item[:type]}") %>
</div>
<div class="cookies__category-panel__td">
<%= item[:name] %>
</div>
<div class="cookies__category-panel__td">
<%= t("layouts.decidim.data_consent.details.items.#{item[:name]}.service") %>
</div>
<div class="cookies__category-panel__td">
<%= t("layouts.decidim.data_consent.details.items.#{item[:name]}.description") %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<% if Decidim::Env.new("DECIDIM_CUSTOM_NEWSLETTER_BAR_COLOR").present? %>
<style>
.decidim-bar, th.decidim-bar, td.decidim-bar {
background-color: <%= Decidim::Env.new("DECIDIM_CUSTOM_NEWSLETTER_BAR_COLOR").to_s %> !important;
}
</style>
<% end %>

<table class="main container">
<tr>
<td class="decidim-bar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
</style>
<% end %>

<% if Decidim::Env.new("DECIDIM_CUSTOM_NEWSLETTER_BAR_COLOR").present? %>
<style>
.decidim-bar, th.decidim-bar, td.decidim-bar {
background-color: <%= Decidim::Env.new("DECIDIM_CUSTOM_NEWSLETTER_BAR_COLOR").to_s %> !important;
}
</style>
<% end %>

<table class="main container">
<tr>
<td class="decidim-bar">
Expand Down
1 change: 1 addition & 0 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ ignore_missing:
- decidim.accessibility.logo
- decidim.errors.not_found.back_home
- layouts.decidim.announcements.*
- layouts.decidim.data_consent.*
- decidim.budgets.budget_information_modal.more_information
- decidim.budgets.projects.budget_summary.vote
- decidim.budgets.projects.budget_summary.cancel_order
Expand Down
Loading