decidim-core 0.28.1 → 0.28.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/address/online.erb +2 -2
- data/app/cells/decidim/address_cell.rb +4 -0
- data/app/cells/decidim/announcement/show.erb +2 -2
- data/app/cells/decidim/author/show.erb +5 -5
- data/app/cells/decidim/card/show.erb +1 -1
- data/app/cells/decidim/card_g/show.erb +1 -1
- data/app/cells/decidim/card_g_cell.rb +5 -2
- data/app/cells/decidim/card_l/image.erb +2 -2
- data/app/cells/decidim/card_l_cell.rb +5 -2
- data/app/cells/decidim/card_metadata/show.erb +2 -2
- data/app/cells/decidim/content_blocks/hero_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +1 -1
- data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +2 -2
- data/app/cells/decidim/data_consent/category.erb +1 -1
- data/app/cells/decidim/nav_links/show.erb +2 -2
- data/app/cells/decidim/notification/moderated.erb +12 -0
- data/app/cells/decidim/notification_cell.rb +5 -1
- data/app/cells/decidim/profile/details.erb +1 -1
- data/app/cells/decidim/progress_bar/show.erb +1 -1
- data/app/cells/decidim/progress_bar_cell.rb +2 -0
- data/app/cells/decidim/report_button/flag_modal.erb +5 -1
- data/app/cells/decidim/resource_types_filter/show.erb +3 -3
- data/app/cells/decidim/statistic/show.erb +2 -2
- data/app/cells/decidim/upload_modal/modal.erb +3 -4
- data/app/commands/decidim/create_omniauth_registration.rb +10 -4
- data/app/controllers/concerns/decidim/devise_controllers.rb +1 -0
- data/app/controllers/concerns/decidim/force_authentication.rb +1 -1
- data/app/controllers/concerns/decidim/paginable.rb +1 -1
- data/app/controllers/concerns/decidim/use_organization_time_zone.rb +1 -1
- data/app/controllers/decidim/application_controller.rb +1 -0
- data/app/controllers/decidim/gamification/badges_controller.rb +2 -0
- data/app/controllers/decidim/links_controller.rb +15 -2
- data/app/helpers/concerns/decidim/flash_helper_extensions.rb +2 -2
- data/app/helpers/decidim/check_boxes_tree_helper.rb +1 -2
- data/app/helpers/decidim/paginate_helper.rb +3 -5
- data/app/mailers/decidim/application_mailer.rb +40 -6
- data/app/models/decidim/attachment.rb +3 -3
- data/app/models/decidim/component.rb +4 -1
- data/app/models/decidim/content_block.rb +2 -2
- data/app/models/decidim/user.rb +12 -12
- data/app/packs/src/decidim/a11y.js +14 -0
- data/app/packs/src/decidim/abide_form_validator_fixer.js +44 -0
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +2 -6
- data/app/packs/src/decidim/index.js +29 -1
- data/app/packs/src/decidim/input_character_counter.js +1 -1
- data/app/packs/stylesheets/decidim/_accordion.scss +2 -2
- data/app/packs/stylesheets/decidim/_cards.scss +2 -2
- data/app/packs/stylesheets/decidim/_dropdown.scss +9 -9
- data/app/packs/stylesheets/decidim/_forms.scss +4 -4
- data/app/packs/stylesheets/decidim/_layout.scss +3 -3
- data/app/packs/stylesheets/decidim/_modal_update.scss +1 -3
- data/app/packs/stylesheets/decidim/_tooltip.scss +10 -10
- data/app/packs/stylesheets/decidim/editor.scss +1 -1
- data/app/presenters/decidim/admin_log/organization_presenter.rb +1 -1
- data/app/presenters/decidim/log/resource_presenter.rb +7 -1
- data/app/services/decidim/download_your_data_exporter.rb +36 -25
- data/app/services/decidim/log/diff_changeset_calculator.rb +1 -1
- data/app/services/decidim/open_data_exporter.rb +8 -7
- data/app/views/decidim/account/show.html.erb +2 -2
- data/app/views/decidim/application/_document.html.erb +2 -2
- data/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +2 -1
- data/app/views/decidim/gamification/badges/index.html.erb +34 -33
- data/app/views/decidim/links/_modal.html.erb +1 -1
- data/app/views/decidim/links/new.html.erb +3 -1
- data/app/views/decidim/manifests/show.json.erb +5 -5
- data/app/views/decidim/messaging/conversations/create.js.erb +1 -1
- data/app/views/decidim/notifications_settings/show.html.erb +6 -6
- data/app/views/decidim/pages/_tabbed.html.erb +2 -2
- data/app/views/decidim/searches/_filters.html.erb +2 -2
- data/app/views/decidim/shared/_filters.html.erb +2 -2
- data/app/views/decidim/shared/_orders.html.erb +2 -2
- data/app/views/decidim/shared/filters/_collection.html.erb +5 -3
- data/app/views/decidim/shared/filters/_dropdown_label.html.erb +21 -19
- data/app/views/layouts/decidim/_logo.html.erb +1 -1
- data/app/views/layouts/decidim/_wrapper.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_intro.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_links.html.erb +3 -1
- data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +5 -3
- data/app/views/layouts/decidim/header/_main_links_mobile_account.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +2 -0
- data/app/views/layouts/decidim/shared/_layout_user_profile.html.erb +2 -2
- data/config/locales/ar.yml +1 -5
- data/config/locales/bg.yml +878 -1
- data/config/locales/ca.yml +5 -3
- data/config/locales/cs.yml +3 -1
- data/config/locales/de.yml +3 -1
- data/config/locales/el.yml +8 -1
- data/config/locales/en.yml +3 -1
- data/config/locales/es-MX.yml +8 -6
- data/config/locales/es-PY.yml +8 -6
- data/config/locales/es.yml +32 -30
- data/config/locales/eu.yml +4 -2
- data/config/locales/fi-plain.yml +6 -4
- data/config/locales/fi.yml +32 -30
- data/config/locales/fr-CA.yml +2 -0
- data/config/locales/fr.yml +2 -0
- data/config/locales/ga-IE.yml +8 -0
- data/config/locales/gl.yml +1 -0
- data/config/locales/hu.yml +1 -2
- data/config/locales/is-IS.yml +3 -0
- data/config/locales/it.yml +7 -1
- data/config/locales/ja.yml +3 -1
- data/config/locales/kaa.yml +5 -0
- data/config/locales/lb.yml +7 -1
- data/config/locales/lt.yml +8 -2
- data/config/locales/lv.yml +8 -1
- data/config/locales/nl.yml +7 -1
- data/config/locales/no.yml +7 -1
- data/config/locales/pl.yml +35 -0
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +7 -1
- data/config/locales/ro-RO.yml +8 -0
- data/config/locales/ru.yml +8 -0
- data/config/locales/sk.yml +8 -1
- data/config/locales/sl.yml +8 -0
- data/config/locales/sv.yml +132 -88
- data/config/locales/tr-TR.yml +21 -4
- data/config/locales/uk.yml +10 -0
- data/config/locales/zh-CN.yml +0 -1
- data/config/locales/zh-TW.yml +8 -1
- data/db/migrate/20181025082245_add_timestamps_to_components.rb +5 -1
- data/decidim-core.gemspec +0 -1
- data/lib/decidim/asset_router/storage.rb +214 -11
- data/lib/decidim/core/engine.rb +8 -0
- data/lib/decidim/core/seeds.rb +1 -1
- data/lib/decidim/core/test/shared_examples/attachable_interface_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +76 -6
- data/lib/decidim/core/test/shared_examples/follows_examples.rb +8 -3
- data/lib/decidim/core/test/shared_examples/logo_email.rb +2 -2
- data/lib/decidim/core/test/shared_examples/paginated_resource_examples.rb +5 -5
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +6 -1
- data/lib/decidim/events/base_event.rb +4 -0
- data/lib/decidim/organization_settings.rb +10 -2
- data/lib/decidim/seven_zip_wrapper.rb +29 -0
- data/lib/tasks/upgrade/decidim_fix_categorization.rake +101 -1
- metadata +13 -25
- data/app/services/decidim/zip_stream/writer.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed7b2e2e440e7ab68c508dc8242f6adbee52c292cfa8fd3fd43e42fc75e8f8f
|
4
|
+
data.tar.gz: ee75d95c1002bc872483de673a2e21e23c100d387d2bd50d86bb05ed5a91d1fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d82a46910165f8510bec81d79677b26057d49e88ddc9ddd3fda2443b0d8529804faebb2eb8949313b4cf4c25fc8fd406da049dc2e33d172430d7614dc043b9cd
|
7
|
+
data.tar.gz: e86a808c22abc5db470d2bcf7d9427a2d8ea13588a73fcbde936fbd22c381d606f30b45353e3638f39150e16966cf75edcf6d81698164b3bdef9055b1881a02f
|
@@ -5,8 +5,8 @@
|
|
5
5
|
<div class="address">
|
6
6
|
<div class="address__location"><%= t(model.type_of_meeting, scope: "decidim.meetings.meetings.filters.type_values") %></div>
|
7
7
|
<% if display_online_meeting_url? %>
|
8
|
-
<a href="<%=
|
9
|
-
<%=
|
8
|
+
<a href="<%= online_meeting_url %>" target="_blank" rel="noopener noreferrer" class="address__hints underline break-all">
|
9
|
+
<%= online_meeting_url %>
|
10
10
|
<% end %>
|
11
11
|
</a>
|
12
12
|
</div>
|
@@ -45,6 +45,10 @@ module Decidim
|
|
45
45
|
HTML
|
46
46
|
end
|
47
47
|
|
48
|
+
def online_meeting_url
|
49
|
+
URI::Parser.new.escape(model.online_meeting_url)
|
50
|
+
end
|
51
|
+
|
48
52
|
def display_online_meeting_url?
|
49
53
|
return true unless model.respond_to?(:online?)
|
50
54
|
return true unless model.respond_to?(:iframe_access_level_allowed_for_user?)
|
@@ -1,16 +1,16 @@
|
|
1
1
|
<% data = has_tooltip? ? { tooltip: render(:profile_minicard).html_safe } : nil %>
|
2
|
-
<
|
3
|
-
<%= content_tag :
|
2
|
+
<span class="author" data-author>
|
3
|
+
<%= content_tag :span, class: "author__container#{" is-compact" if layout == :compact}", data: do %>
|
4
4
|
<% if layout == :compact %>
|
5
5
|
<%= render :avatar %>
|
6
6
|
|
7
|
-
<
|
7
|
+
<span>
|
8
8
|
<%= render :name %>
|
9
9
|
|
10
10
|
<% context_actions.each do |action| %>
|
11
11
|
<%= render action %>
|
12
12
|
<% end %>
|
13
|
-
</
|
13
|
+
</span>
|
14
14
|
<% elsif layout == :avatar %>
|
15
15
|
<%= render :avatar %>
|
16
16
|
<% else %>
|
@@ -24,4 +24,4 @@
|
|
24
24
|
<%= render action %>
|
25
25
|
<% end %>
|
26
26
|
<% end %>
|
27
|
-
</
|
27
|
+
</span>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="py-4 space-y-2">
|
2
|
-
<a href="" class="text-lg text-secondary font-semibold hover:underline"><%= title %></a>
|
2
|
+
<a href="" class="text-lg text-secondary font-semibold hover:underline"><%= decidim_html_escape(title) %></a>
|
3
3
|
<div class="flex items-center divide-x divide-gray-3">
|
4
4
|
<% metadata.first(4).each do |item| %>
|
5
5
|
<div class="flex items-center gap-1 px-4 lg:px-6 first:pl-0 last:pr-0 max-w-xs">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= link_to resource_path, class: classes[:default], id: resource_id do %>
|
2
2
|
<div class="<%= classes[:img] %>">
|
3
3
|
<% if has_image? %>
|
4
|
-
<%= image_tag
|
4
|
+
<%= image_tag resource_image_url, alt: alt_title %>
|
5
5
|
<% else %>
|
6
6
|
<%= external_icon "media/images/placeholder-card-g.svg", class: "card__placeholder-g" %>
|
7
7
|
<% end %>
|
@@ -52,12 +52,15 @@ module Decidim
|
|
52
52
|
@id_base_name ||= resource.class.name.gsub(/\ADecidim::/, "").underscore.split("/").join("__")
|
53
53
|
end
|
54
54
|
|
55
|
-
def
|
55
|
+
def resource_image_url
|
56
|
+
# Backwards compatibility.
|
57
|
+
return resource_image_path if respond_to?(:resource_image_path)
|
58
|
+
|
56
59
|
nil
|
57
60
|
end
|
58
61
|
|
59
62
|
def has_image?
|
60
|
-
|
63
|
+
resource_image_url.present?
|
61
64
|
end
|
62
65
|
|
63
66
|
def show_description?
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="card__list-image">
|
2
|
-
<% if
|
3
|
-
<%= image_tag
|
2
|
+
<% if has_image? %>
|
3
|
+
<%= image_tag resource_image_url, class: "w-full h-full object-cover" %>
|
4
4
|
<% else %>
|
5
5
|
<div class="w-full h-full relative">
|
6
6
|
<div class="w-full h-full bg-primary opacity-10 absolute top-0 left-0 z-10">
|
@@ -68,12 +68,15 @@ module Decidim
|
|
68
68
|
"#{class_base_name}__#{class_name}"
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def resource_image_url
|
72
|
+
# Backwards compatibility.
|
73
|
+
return resource_image_path if respond_to?(:resource_image_path)
|
74
|
+
|
72
75
|
nil
|
73
76
|
end
|
74
77
|
|
75
78
|
def has_image?
|
76
|
-
|
79
|
+
resource_image_url.present?
|
77
80
|
end
|
78
81
|
|
79
82
|
def has_link_to_resource?
|
@@ -3,12 +3,12 @@
|
|
3
3
|
<% hook_output = render_hook(item[:hook]) %>
|
4
4
|
<% next if hook_output.blank? %>
|
5
5
|
|
6
|
-
<%= content_tag :
|
6
|
+
<%= content_tag :div, data: item[:data_attributes] do %>
|
7
7
|
<%= icon item[:icon] if item[:icon].present? %>
|
8
8
|
<%= hook_output %>
|
9
9
|
<% end %>
|
10
10
|
<% else %>
|
11
|
-
<%= content_tag :
|
11
|
+
<%= content_tag :div, data: item[:data_attributes] do %>
|
12
12
|
<%= icon item[:icon] if item[:icon].present? %>
|
13
13
|
<% if item[:text].present? %>
|
14
14
|
<%= link_to_if enable_links? && item.has_key?(:url), item[:text], item[:url] %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<section id="highlighted_content_banner" class="home__section-image" style="--hero-image:url('<%= current_organization.attached_uploader(:highlighted_content_banner_image).
|
1
|
+
<section id="highlighted_content_banner" class="home__section-image" style="--hero-image:url('<%= current_organization.attached_uploader(:highlighted_content_banner_image).url %>');">
|
2
2
|
<div class="home__section-content-banner home__section">
|
3
3
|
<div>
|
4
4
|
<h2 class="home__section-content-banner__title">
|
@@ -34,9 +34,9 @@ module Decidim
|
|
34
34
|
# If it is called from the landing page content block, use the background image defined there
|
35
35
|
# Else, use the banner image defined in the space (for assemblies)
|
36
36
|
def image_path
|
37
|
-
return model.images_container.attached_uploader(:background_image).
|
37
|
+
return model.images_container.attached_uploader(:background_image).url if model.respond_to?(:images_container)
|
38
38
|
|
39
|
-
attached_uploader(:banner_image).
|
39
|
+
attached_uploader(:banner_image).url
|
40
40
|
end
|
41
41
|
|
42
42
|
def has_hashtag?
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="cookies__category-trigger">
|
3
3
|
<label for="dc-<%= category[:slug] %>" class="cookies__category-toggle">
|
4
4
|
<input
|
5
|
-
|
5
|
+
<%== %(checked="checked") if category[:mandatory] %>
|
6
6
|
id="dc-<%= category[:slug] %>"
|
7
7
|
type="checkbox"
|
8
8
|
name="<%= category[:slug] %>"
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<div class="participatory-space__nav-container">
|
2
|
-
<button id="dropdown-trigger-participatory-space" data-component="dropdown" data-target="dropdown-menu-participatory-space" data-auto-close="true" data-
|
2
|
+
<button id="dropdown-trigger-participatory-space" data-component="dropdown" data-target="dropdown-menu-participatory-space" data-auto-close="true" data-scroll-to-menu="true">
|
3
3
|
<span><%= t("decidim.searches.filters.jump_to") %></span>
|
4
4
|
<%= icon "arrow-down-s-line" %>
|
5
5
|
<%= icon "arrow-up-s-line" %>
|
6
6
|
</button>
|
7
|
-
<ul id="dropdown-menu-participatory-space" class="participatory-space__nav">
|
7
|
+
<ul id="dropdown-menu-participatory-space" class="participatory-space__nav" aria-hidden="true">
|
8
8
|
<% model.each do |item| %>
|
9
9
|
<li>
|
10
10
|
<%= link_to item[:url], class: "participatory-space__nav-item" do %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="notification" data-notification>
|
2
|
+
<div class="notification__wrapper">
|
3
|
+
<div class="notification__time" title="<%= l(notification.created_at) %>"> <%= notification.created_at_in_words %></div>
|
4
|
+
<div class="notification__snippet">
|
5
|
+
<span class="notification__snippet-title text-gray"><%= t("decidim.notifications.show.moderated") %></span>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<%= link_to model, remote: true, method: :delete, class: "notification__button", data: { "notification-read": "" } do %>
|
9
|
+
<span class="sr-only md:not-sr-only"><%= t("mark_as_read", scope: "layouts.decidim.notifications_dashboard") %></span>
|
10
|
+
<%= icon "check-line", class: "fill-current" %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= content_tag :div, units_name_text, class: "progress-bar__units" if units_name %>
|
8
8
|
|
9
9
|
<% if total != 0 %>
|
10
|
-
<div class="progress-bar" role="progressbar"
|
10
|
+
<div class="progress-bar" role="progressbar" aria-label="<%= units_name.present? ? units_name_text : t("decidim.shared.progress") %>" aria-valuenow="<%= number_with_precision(percentage, separator: ".", precision: 2) %>" aria-valuemin="0" aria-valuemax="100" aria-valuetext="<%= number_to_percentage(percentage, precision: 2) %>">
|
11
11
|
<div style="width: <%= percentage %>%"></div>
|
12
12
|
</div>
|
13
13
|
<% end %>
|
@@ -34,11 +34,15 @@
|
|
34
34
|
<%= f.check_box :hide,
|
35
35
|
label: t("decidim.shared.flag_modal.hide_content"),
|
36
36
|
include_hidden: false,
|
37
|
+
id: hide_checkbox_id,
|
37
38
|
data: {
|
38
39
|
label_action: t("decidim.shared.flag_modal.hide"),
|
39
40
|
label_report: t("decidim.shared.flag_modal.report"),
|
40
41
|
hide: "true"
|
41
|
-
},
|
42
|
+
},
|
43
|
+
label_options: {
|
44
|
+
for: hide_checkbox_id
|
45
|
+
} %>
|
42
46
|
<% end %>
|
43
47
|
<% end %>
|
44
48
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="<%= id %>" class="filter-container">
|
2
|
-
<button id="dropdown-trigger-resource" data-component="dropdown" data-target="dropdown-menu-resource" data-auto-close="true"
|
2
|
+
<button id="dropdown-trigger-resource" data-component="dropdown" data-target="dropdown-menu-resource" data-auto-close="true">
|
3
3
|
<% resource_types.each do |resource_type| %>
|
4
4
|
<span data-value="<%= resource_type[0] %>" class="<%= "is-active" if filter_param == resource_type[0] %>">
|
5
5
|
<%= text_with_resource_icon(*resource_type) %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<%= icon "arrow-down-s-line" %>
|
9
9
|
<%= icon "arrow-up-s-line" %>
|
10
10
|
</button>
|
11
|
-
<%= filter_form_for filter, form_path, class
|
11
|
+
<%= filter_form_for filter, form_path, :class => "new_filter", :id => "dropdown-menu-resource", "aria-hidden" => true do |form| %>
|
12
12
|
<%= form.collection_radio_buttons(
|
13
13
|
filter_param_key,
|
14
14
|
resource_types,
|
@@ -16,7 +16,7 @@
|
|
16
16
|
:last,
|
17
17
|
{ checked: filter_param }
|
18
18
|
) do |builder|
|
19
|
-
builder.label { builder.radio_button(class: "reset-defaults", hidden: true) + content_tag(:
|
19
|
+
builder.label { builder.radio_button(class: "reset-defaults", hidden: true) + content_tag(:span, text_with_resource_icon(builder.value, builder.text), class: "filter") }
|
20
20
|
end %>
|
21
21
|
<% end %>
|
22
22
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="statistic <%= stat_dom_class %>" data-statistic>
|
2
|
-
<
|
2
|
+
<span class="statistic__title" title="<%= stat_title %>">
|
3
3
|
<%= stat_title %>
|
4
|
-
</
|
4
|
+
</span>
|
5
5
|
<span class="statistic__number">
|
6
6
|
<%= stat_number %>
|
7
7
|
</span>
|
@@ -37,10 +37,10 @@
|
|
37
37
|
<%= icon "upload-cloud-2-line", class: "w-8 h-8 text-gray fill-current" %>
|
38
38
|
<%= t("decidim.forms.upload_help.dropzone") %>
|
39
39
|
</span>
|
40
|
-
<
|
40
|
+
<label class="button button__sm button__secondary" for="files-<%= modal_id %>">
|
41
41
|
<span><%= t("decidim.forms.upload.select_file") %></span>
|
42
42
|
<%= icon "arrow-right-line", class: "fill-current" %>
|
43
|
-
</
|
43
|
+
</label>
|
44
44
|
</div>
|
45
45
|
</div>
|
46
46
|
</div>
|
@@ -60,8 +60,7 @@
|
|
60
60
|
<%= t("decidim.shared.confirm_modal.cancel") %>
|
61
61
|
</button>
|
62
62
|
<button type="button" class="button button__sm md:button__lg button__secondary" data-dropzone-save data-dialog-close="<%= modal_id %>" disabled>
|
63
|
-
<%= t("
|
64
|
-
<%= icon "arrow-right-line", class: "fill-current" %>
|
63
|
+
<%= t("save", scope: "decidim.forms.upload.labels") %>
|
65
64
|
</button>
|
66
65
|
</div>
|
67
66
|
<% end %>
|
@@ -55,7 +55,12 @@ module Decidim
|
|
55
55
|
# If user has left the account unconfirmed and later on decides to sign
|
56
56
|
# in with omniauth with an already verified account, the account needs
|
57
57
|
# to be marked confirmed.
|
58
|
-
|
58
|
+
if !@user.confirmed? && @user.email == verified_email
|
59
|
+
@user.skip_confirmation!
|
60
|
+
@user.after_confirmation
|
61
|
+
end
|
62
|
+
@user.tos_agreement = "1"
|
63
|
+
@user.save!
|
59
64
|
else
|
60
65
|
@user.email = (verified_email || form.email)
|
61
66
|
@user.name = form.name
|
@@ -69,10 +74,11 @@ module Decidim
|
|
69
74
|
@user.avatar.attach(io: file, filename:)
|
70
75
|
end
|
71
76
|
@user.skip_confirmation! if verified_email
|
72
|
-
|
77
|
+
@user.tos_agreement = "1"
|
78
|
+
@user.save!
|
73
79
|
|
74
|
-
|
75
|
-
|
80
|
+
@user.after_confirmation if verified_email
|
81
|
+
end
|
76
82
|
end
|
77
83
|
|
78
84
|
def create_identity
|
@@ -17,7 +17,7 @@ module Decidim
|
|
17
17
|
# Breaks the request lifecycle, if user is not authenticated.
|
18
18
|
# Otherwise returns.
|
19
19
|
def ensure_authenticated!
|
20
|
-
return true unless current_organization
|
20
|
+
return true unless current_organization&.force_users_to_authenticate_before_access_organization
|
21
21
|
|
22
22
|
# Next stop: Check whether auth is ok
|
23
23
|
unless user_signed_in?
|
@@ -14,7 +14,8 @@ module Decidim
|
|
14
14
|
rescue_from URI::InvalidURIError, with: :modal
|
15
15
|
|
16
16
|
def new
|
17
|
-
headers["X-Robots-Tag"] = "
|
17
|
+
headers["X-Robots-Tag"] = "none"
|
18
|
+
headers["Link"] = %(<#{url_for}>; rel="canonical")
|
18
19
|
end
|
19
20
|
|
20
21
|
private
|
@@ -36,7 +37,19 @@ module Decidim
|
|
36
37
|
end
|
37
38
|
|
38
39
|
def external_url
|
39
|
-
@external_url ||= URI.parse(
|
40
|
+
@external_url ||= URI.parse(escape_url(params[:external_url]))
|
41
|
+
end
|
42
|
+
|
43
|
+
def escape_url(external_url)
|
44
|
+
before_fragment, fragment = external_url.split("#", 2)
|
45
|
+
escaped_before_fragment = URI::Parser.new.escape(before_fragment)
|
46
|
+
|
47
|
+
if fragment
|
48
|
+
escaped_fragment = URI::Parser.new.escape(fragment)
|
49
|
+
"#{escaped_before_fragment}##{escaped_fragment}"
|
50
|
+
else
|
51
|
+
escaped_before_fragment
|
52
|
+
end
|
40
53
|
end
|
41
54
|
end
|
42
55
|
end
|
@@ -106,9 +106,9 @@ module Decidim
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def message(value)
|
109
|
-
return content_tag(:
|
109
|
+
return content_tag(:div, value, class: "flash__message flex items-center") unless value.is_a?(Hash)
|
110
110
|
|
111
|
-
content_tag(:
|
111
|
+
content_tag(:div, class: "flash__message") do
|
112
112
|
concat value[:title]
|
113
113
|
concat content_tag(:span, value[:body], class: "flash__message-body")
|
114
114
|
end
|
@@ -11,16 +11,14 @@ module Decidim
|
|
11
11
|
def decidim_paginate(collection, paginate_params = {})
|
12
12
|
return if collection.total_pages <= 1
|
13
13
|
|
14
|
+
per_page = (params[:per_page] || paginate_params[:per_page] || Decidim::Paginable::OPTIONS.first).to_i
|
15
|
+
|
14
16
|
content_tag :div, class: "flex flex-col-reverse md:flex-row items-center justify-between gap-1 py-8 md:py-16", data: { pagination: "" } do
|
15
17
|
template = ""
|
16
|
-
template += render
|
18
|
+
template += render(partial: "decidim/shared/results_per_page", locals: { per_page: }, formats: [:html]) if collection.total_pages.positive?
|
17
19
|
template += paginate collection, window: 2, outer_window: 1, theme: "decidim", params: paginate_params
|
18
20
|
template.html_safe
|
19
21
|
end
|
20
22
|
end
|
21
|
-
|
22
|
-
def per_page
|
23
|
-
params[:per_page].to_i || Decidim::Paginable::OPTIONS.first
|
24
|
-
end
|
25
23
|
end
|
26
24
|
end
|
@@ -7,23 +7,57 @@ module Decidim
|
|
7
7
|
include LocalisedMailer
|
8
8
|
include MultitenantAssetHost
|
9
9
|
after_action :set_smtp
|
10
|
+
after_action :set_from
|
10
11
|
|
11
12
|
default from: Decidim.config.mailer_sender
|
12
13
|
layout "decidim/mailer"
|
13
14
|
|
14
15
|
private
|
15
16
|
|
17
|
+
attr_reader :organization
|
18
|
+
|
16
19
|
def set_smtp
|
17
|
-
return if
|
20
|
+
return if organization.nil? || organization.smtp_settings.blank? || organization.smtp_settings.except("from", "from_label", "from_email").all?(&:blank?)
|
18
21
|
|
19
|
-
mail.from = @organization.smtp_settings["from"].presence || mail.from
|
20
22
|
mail.reply_to = mail.reply_to || Decidim.config.mailer_reply
|
21
23
|
mail.delivery_method.settings.merge!(
|
22
|
-
address:
|
23
|
-
port:
|
24
|
-
user_name:
|
25
|
-
password: Decidim::AttributeEncryptor.decrypt(
|
24
|
+
address: organization.smtp_settings["address"],
|
25
|
+
port: organization.smtp_settings["port"],
|
26
|
+
user_name: organization.smtp_settings["user_name"],
|
27
|
+
password: Decidim::AttributeEncryptor.decrypt(organization.smtp_settings["encrypted_password"])
|
26
28
|
) { |_k, o, v| v.presence || o }.compact_blank!
|
27
29
|
end
|
30
|
+
|
31
|
+
def set_from
|
32
|
+
return if organization.nil?
|
33
|
+
return if already_defined_name_in_mail?(mail.from.first)
|
34
|
+
|
35
|
+
mail.from = sender
|
36
|
+
end
|
37
|
+
|
38
|
+
def sender
|
39
|
+
return Decidim.config.mailer_sender if return_mailer_sender?
|
40
|
+
return default_sender if organization.smtp_settings.blank?
|
41
|
+
return default_sender if organization.smtp_settings["from"].nil?
|
42
|
+
return default_sender if organization.smtp_settings["from"].empty?
|
43
|
+
|
44
|
+
smtp_settings_from = organization.smtp_settings["from"]
|
45
|
+
return smtp_settings_from if already_defined_name_in_mail?(smtp_settings_from)
|
46
|
+
|
47
|
+
email_address_with_name(smtp_settings_from, organization.name)
|
48
|
+
end
|
49
|
+
|
50
|
+
def default_sender
|
51
|
+
email_address_with_name(Decidim.config.mailer_sender, organization.name)
|
52
|
+
end
|
53
|
+
|
54
|
+
def already_defined_name_in_mail?(mail_address)
|
55
|
+
# if there is an space, there is already a name in the address
|
56
|
+
mail_address.match?(/ /)
|
57
|
+
end
|
58
|
+
|
59
|
+
def return_mailer_sender?
|
60
|
+
already_defined_name_in_mail?(Decidim.config.mailer_sender) && organization.smtp_settings.present?
|
61
|
+
end
|
28
62
|
end
|
29
63
|
end
|
@@ -69,7 +69,7 @@ module Decidim
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def url
|
72
|
-
attached_uploader(:file).
|
72
|
+
attached_uploader(:file).url
|
73
73
|
end
|
74
74
|
|
75
75
|
# The URL to download the thumbnail of the file. Only works with images.
|
@@ -78,7 +78,7 @@ module Decidim
|
|
78
78
|
def thumbnail_url
|
79
79
|
return unless photo?
|
80
80
|
|
81
|
-
attached_uploader(:file).
|
81
|
+
@thumbnail_url ||= attached_uploader(:file).variant_url(:thumbnail)
|
82
82
|
end
|
83
83
|
|
84
84
|
# The URL to download the a big version of the file. Only works with images.
|
@@ -87,7 +87,7 @@ module Decidim
|
|
87
87
|
def big_url
|
88
88
|
return unless photo?
|
89
89
|
|
90
|
-
attached_uploader(:file).
|
90
|
+
@big_url ||= attached_uploader(:file).variant_url(:big)
|
91
91
|
end
|
92
92
|
|
93
93
|
def set_content_type_and_size
|
@@ -14,7 +14,10 @@ module Decidim
|
|
14
14
|
|
15
15
|
belongs_to :participatory_space, polymorphic: true
|
16
16
|
|
17
|
-
|
17
|
+
scope :registered_component_manifests, -> { where(manifest_name: Decidim.component_registry.manifests.collect(&:name)) }
|
18
|
+
scope :registered_space_manifests, -> { where(participatory_space_type: Decidim.participatory_space_registry.manifests.collect(&:model_class_name)) }
|
19
|
+
|
20
|
+
default_scope { registered_component_manifests.registered_space_manifests.order(arel_table[:weight].asc, arel_table[:manifest_name].asc) }
|
18
21
|
|
19
22
|
delegate :organization, :categories, to: :participatory_space
|
20
23
|
|
@@ -60,8 +60,8 @@ module Decidim
|
|
60
60
|
#
|
61
61
|
# # This is how you can access the image data, just like with any other
|
62
62
|
# # uploader field. You can use the uploader variants too.
|
63
|
-
# content_block.images_container.attached_uploader(:my_image).
|
64
|
-
# content_block.images_container.attached_uploader(:my_image).
|
63
|
+
# content_block.images_container.attached_uploader(:my_image).url
|
64
|
+
# content_block.images_container.attached_uploader(:my_image).variant_url(:big)
|
65
65
|
#
|
66
66
|
# # This will delete the attached image
|
67
67
|
# content_block.images_container.my_image = nil
|