decidim-core 0.31.2 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -13
- data/app/cells/decidim/amendable/amend_button_card/show.erb +2 -2
- data/app/cells/decidim/amendable/amend_button_card_cell.rb +1 -1
- data/app/cells/decidim/author_cell.rb +0 -4
- data/app/cells/decidim/card_metadata_cell.rb +1 -1
- data/app/cells/decidim/comments_button_cell.rb +9 -1
- data/app/cells/decidim/content_blocks/announcement_settings_form/show.erb +5 -0
- data/app/cells/decidim/content_blocks/announcement_settings_form_cell.rb +17 -0
- data/app/cells/decidim/content_blocks/cta_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/hero_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb +5 -1
- data/app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/how_to_participate/show.erb +1 -1
- data/app/cells/decidim/content_blocks/html_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/participatory_space_announcement_cell.rb +1 -3
- data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +1 -5
- data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/static_page/section_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/static_page/section_settings_form/show.erb +3 -1
- data/app/cells/decidim/content_blocks/static_page/summary_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/static_page/summary_settings_form/show.erb +3 -1
- data/app/cells/decidim/content_blocks/static_page/two_pane_section_cell.rb +2 -2
- data/app/cells/decidim/content_blocks/static_page/two_pane_section_settings_form/show.erb +4 -2
- data/app/cells/decidim/data_consent/category.erb +25 -38
- data/app/cells/decidim/footer_topics/show.erb +5 -8
- data/app/cells/decidim/{participatory_space_private_user → member}/show.erb +6 -6
- data/app/cells/decidim/{participatory_space_private_user_cell.rb → member_cell.rb} +1 -5
- data/app/cells/decidim/nav_links/show.erb +3 -3
- data/app/cells/decidim/onboarding_action_message_cell.rb +1 -0
- data/app/cells/decidim/profile/details.erb +1 -1
- data/app/cells/decidim/profile_cell.rb +1 -0
- data/app/cells/decidim/profile_member_of/show.erb +13 -0
- data/app/cells/decidim/profile_member_of_cell.rb +35 -0
- data/app/cells/decidim/report_button/already_reported_modal.erb +1 -1
- data/app/cells/decidim/report_button/flag_modal.erb +1 -1
- data/app/cells/decidim/report_user_button/already_reported_modal.erb +1 -1
- data/app/cells/decidim/report_user_button/flag_modal.erb +1 -1
- data/app/cells/decidim/resource_types_filter/show.erb +2 -2
- data/app/cells/decidim/share_text_widget/modal.erb +1 -1
- data/app/cells/decidim/share_widget/qr_code_modal.erb +1 -1
- data/app/cells/decidim/tags_cell.rb +1 -1
- data/app/cells/decidim/upload_modal/files.erb +5 -1
- data/app/cells/decidim/upload_modal_cell.rb +15 -1
- data/app/cells/decidim/versions_list/show.erb +25 -0
- data/app/commands/decidim/create_follow.rb +3 -5
- data/app/commands/decidim/create_user_report.rb +1 -1
- data/app/commands/decidim/destroy_account.rb +15 -4
- data/app/commands/decidim/multiple_attachments_methods.rb +42 -24
- data/app/commands/decidim/search.rb +5 -5
- data/app/controllers/concerns/decidim/ajax_permission_handler.rb +1 -1
- data/app/controllers/concerns/decidim/devise_controllers.rb +9 -0
- data/app/controllers/concerns/decidim/direct_upload.rb +3 -2
- data/app/controllers/concerns/decidim/ephemeral_session_checker.rb +1 -1
- data/app/controllers/concerns/decidim/force_authentication.rb +10 -1
- data/app/controllers/concerns/decidim/impersonate_users.rb +4 -0
- data/app/controllers/concerns/decidim/locale_switcher.rb +52 -2
- data/app/controllers/concerns/decidim/needs_tos_accepted.rb +1 -1
- data/app/controllers/concerns/decidim/participatory_space/has_members_page.rb +27 -0
- data/app/controllers/concerns/decidim/participatory_space_context.rb +1 -5
- data/app/controllers/decidim/account_controller.rb +1 -1
- data/app/controllers/decidim/amendments_controller.rb +5 -4
- data/app/controllers/decidim/components/base_controller.rb +20 -3
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/passwords_controller.rb +1 -1
- data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/sessions_controller.rb +1 -1
- data/app/controllers/decidim/download_your_data_controller.rb +2 -2
- data/app/controllers/decidim/editor_images_controller.rb +1 -1
- data/app/controllers/decidim/follows_controller.rb +4 -3
- data/app/controllers/decidim/geolocation_controller.rb +1 -1
- data/app/controllers/decidim/likes_controller.rb +2 -1
- data/app/controllers/decidim/locales_controller.rb +3 -11
- data/app/controllers/decidim/messaging/conversations_controller.rb +3 -3
- data/app/controllers/decidim/newsletters_controller.rb +1 -1
- data/app/controllers/decidim/notifications_settings_controller.rb +1 -1
- data/app/controllers/decidim/notifications_subscriptions_controller.rb +8 -0
- data/app/controllers/decidim/open_data_controller.rb +1 -1
- data/app/controllers/decidim/private_downloads_controller.rb +29 -0
- data/app/controllers/decidim/report_users_controller.rb +2 -2
- data/app/controllers/decidim/reports_controller.rb +1 -1
- data/app/controllers/decidim/user_activities_controller.rb +1 -2
- data/app/events/decidim/amendable/amendment_base_event.rb +7 -1
- data/app/events/decidim/welcome_notification_event.rb +1 -1
- data/app/forms/decidim/upload_validation_form.rb +1 -1
- data/app/helpers/concerns/decidim/flash_helper_extensions.rb +1 -0
- data/app/helpers/decidim/active_link_to_helper.rb +136 -0
- data/app/helpers/decidim/amendments_helper.rb +3 -3
- data/app/helpers/decidim/check_boxes_tree_helper.rb +2 -2
- data/app/helpers/decidim/component_path_helper.rb +9 -4
- data/app/helpers/decidim/filters_helper.rb +0 -2
- data/app/helpers/decidim/mailer_helper.rb +36 -0
- data/app/helpers/decidim/menu_helper.rb +4 -5
- data/app/helpers/decidim/meta_tags_helper.rb +0 -2
- data/app/helpers/decidim/newsletters_helper.rb +4 -22
- data/app/helpers/decidim/paginate_helper.rb +14 -1
- data/app/helpers/decidim/sanitize_helper.rb +1 -0
- data/app/helpers/decidim/short_link_helper.rb +5 -5
- data/app/helpers/decidim/translations_helper.rb +4 -4
- data/app/jobs/decidim/delete_inactive_participants_job.rb +2 -2
- data/app/jobs/decidim/find_and_update_descendants_job.rb +8 -2
- data/app/jobs/decidim/process_inactive_participant_job.rb +0 -7
- data/app/jobs/decidim/update_search_indexes_job.rb +2 -2
- data/app/mailers/decidim/application_mailer.rb +11 -2
- data/app/mailers/decidim/decidim_devise_mailer.rb +1 -0
- data/app/mailers/decidim/delete_user_mailer.rb +14 -0
- data/app/mailers/decidim/participants_account_mailer.rb +0 -16
- data/app/mailers/decidim/reported_mailer.rb +4 -1
- data/app/models/decidim/action_log.rb +1 -1
- data/app/models/decidim/attachment.rb +20 -2
- data/app/models/decidim/authorization.rb +7 -0
- data/app/models/decidim/authorization_transfer.rb +1 -1
- data/app/models/decidim/component.rb +6 -9
- data/app/models/decidim/content_block.rb +3 -3
- data/app/models/decidim/moderation.rb +1 -1
- data/app/models/decidim/newsletter.rb +2 -2
- data/app/models/decidim/participatory_space/member.rb +55 -0
- data/app/models/decidim/private_download.rb +61 -0
- data/app/models/decidim/private_export.rb +6 -0
- data/app/models/decidim/resource_link.rb +1 -1
- data/app/models/decidim/short_link.rb +1 -1
- data/app/models/decidim/user.rb +2 -2
- data/app/models/decidim/user_base_entity.rb +17 -2
- data/app/models/decidim/user_moderation.rb +1 -1
- data/app/packs/src/decidim/a11y.js +29 -0
- data/app/packs/src/decidim/a11y.test.js +81 -0
- data/app/packs/src/decidim/confirm.js +8 -1
- data/app/packs/src/decidim/confirm.test.js +225 -0
- data/app/packs/src/decidim/controllers/accordion/accordion.test.js +272 -0
- data/app/packs/src/decidim/controllers/accordion/controller.js +117 -17
- data/app/packs/src/decidim/controllers/assign_role/assign_role.test.js +80 -0
- data/app/packs/src/decidim/controllers/assign_role/controller.js +27 -0
- data/app/packs/src/decidim/controllers/breadcrumb_truncate/breadcrumb_truncate.test.js +230 -0
- data/app/packs/src/decidim/controllers/breadcrumb_truncate/controller.js +172 -0
- data/app/packs/src/decidim/controllers/dropdown/controller.js +32 -0
- data/app/packs/src/decidim/controllers/dropdown/dropdown.test.js +215 -0
- data/app/packs/src/decidim/controllers/form_validator/form_validator.js +9 -8
- data/app/packs/src/decidim/controllers/form_validator/form_validator.test.js +28 -1
- data/app/packs/src/decidim/controllers/language_change/controller.js +1 -0
- data/app/packs/src/decidim/controllers/language_change/language_change.test.js +13 -0
- data/app/packs/src/decidim/controllers/main_menu/controller.js +152 -0
- data/app/packs/src/decidim/controllers/main_menu/main_menu.test.js +285 -0
- data/app/packs/src/decidim/controllers/mention/controller.js +296 -140
- data/app/packs/src/decidim/controllers/mention/input_mentions.test.js +120 -457
- data/app/packs/src/decidim/controllers/multiple_mentions/controller.js +68 -32
- data/app/packs/src/decidim/controllers/multiple_mentions/input_multiple_mentions.test.js +30 -23
- data/app/packs/src/decidim/controllers/password_toggler/controller.js +22 -1
- data/app/packs/src/decidim/controllers/password_toggler/password_toggler.test.js +11 -20
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +26 -0
- data/app/packs/src/decidim/datepicker/generate_datepicker.js +3 -14
- data/app/packs/src/decidim/datepicker/generate_timepicker.js +3 -2
- data/app/packs/src/decidim/datepicker/test/datepicker_functions_adjust_picker_position.test.js +234 -0
- data/app/packs/src/decidim/direct_uploads/upload_field.js +4 -4
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +12 -7
- data/app/packs/src/decidim/editor/common/suggestion.js +4 -2
- data/app/packs/src/decidim/editor/extensions/decidim_kit/index.js +4 -1
- data/app/packs/src/decidim/editor/extensions/image/index.js +57 -16
- data/app/packs/src/decidim/editor/extensions/image/node_view.js +9 -1
- data/app/packs/src/decidim/editor/extensions/indent/index.js +9 -0
- data/app/packs/src/decidim/editor/extensions/link/bubble_menu.js +34 -6
- data/app/packs/src/decidim/editor/extensions/link/index.js +53 -12
- data/app/packs/src/decidim/editor/extensions/mention/index.js +18 -5
- data/app/packs/src/decidim/editor/extensions/mention_resource/index.js +16 -7
- data/app/packs/src/decidim/editor/test/extensions/decidim_kit.test.js +13 -4
- data/app/packs/src/decidim/editor/test/extensions/heading.test.js +1 -1
- data/app/packs/src/decidim/editor/test/extensions/image.test.js +26 -28
- data/app/packs/src/decidim/editor/test/extensions/image_links.test.js +161 -0
- data/app/packs/src/decidim/editor/test/extensions/mention.test.js +6 -2
- data/app/packs/src/decidim/editor/test/extensions/video_embed.test.js +27 -15
- data/app/packs/src/decidim/editor/test/helpers.js +8 -10
- data/app/packs/src/decidim/editor/test/toolbar/full.test.js +15 -4
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_block.js +8 -4
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_formatting.js +5 -1
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_indent.js +9 -5
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_link.js +5 -1
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_list.js +8 -4
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_styling.js +13 -9
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content_styling.js +6 -2
- data/app/packs/src/decidim/geocoding/reverse_geocoding.js +15 -5
- data/app/packs/src/decidim/geocoding/reverse_geocoding.test.js +197 -0
- data/app/packs/src/decidim/index.js +4 -4
- data/app/packs/src/decidim/map/controller.js +10 -1
- data/app/packs/src/decidim/refactor/moved/focus_guard.js +16 -16
- data/app/packs/src/decidim/refactor/moved/focus_guard.test.js +136 -0
- data/app/packs/src/decidim/sw/push-permissions.js +48 -13
- data/app/packs/src/decidim/sw/sw.js +1 -1
- data/app/packs/src/decidim/utilities/text.js +6 -6
- data/app/packs/stylesheets/decidim/_cards.scss +15 -6
- data/app/packs/stylesheets/decidim/_conversations.scss +14 -0
- data/app/packs/stylesheets/decidim/_cookies.scss +13 -5
- data/app/packs/stylesheets/decidim/_datepicker.scss +0 -8
- data/app/packs/stylesheets/decidim/_documents.scss +1 -1
- data/app/packs/stylesheets/decidim/_dropdown.scss +22 -32
- data/app/packs/stylesheets/decidim/_editor_suggestions.scss +49 -0
- data/app/packs/stylesheets/decidim/_flash.scss +1 -1
- data/app/packs/stylesheets/decidim/_floating_help.scss +1 -1
- data/app/packs/stylesheets/decidim/_footer.scss +27 -31
- data/app/packs/stylesheets/decidim/_forms.scss +5 -1
- data/app/packs/stylesheets/decidim/_header.scss +183 -48
- data/app/packs/stylesheets/decidim/_language_chooser.scss +79 -0
- data/app/packs/stylesheets/decidim/_participatory_spaces.scss +1 -1
- data/app/packs/stylesheets/decidim/_rich_text.scss +17 -0
- data/app/packs/stylesheets/decidim/_tom_select.scss +23 -0
- data/app/packs/stylesheets/decidim/application.scss +3 -0
- data/app/packs/stylesheets/decidim/editor.scss +12 -33
- data/app/packs/stylesheets/decidim/geocoding_addons.scss +10 -2
- data/app/presenters/decidim/admin_log/participatory_space/member_presenter.rb +40 -0
- data/app/presenters/decidim/admin_log/static_page_resource_presenter.rb +1 -1
- data/app/presenters/decidim/authorization_transfer_presenter.rb +1 -1
- data/app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb +3 -3
- data/app/presenters/decidim/footer_menu_presenter.rb +2 -4
- data/app/presenters/decidim/log/user_presenter.rb +1 -0
- data/app/presenters/decidim/log/value_types/access_mode_presenter.rb +45 -0
- data/app/presenters/decidim/menu_item_presenter.rb +15 -3
- data/app/presenters/decidim/participatory_space/member_presenter.rb +48 -0
- data/app/presenters/decidim/resource_locator_presenter.rb +22 -3
- data/app/presenters/decidim/stats_presenter.rb +1 -1
- data/app/queries/decidim/last_activity.rb +1 -1
- data/app/resolvers/decidim/meta_image_url_resolver.rb +7 -0
- data/app/serializers/decidim/exporters/participatory_space_serializer.rb +15 -1
- data/app/services/decidim/email_notification_generator.rb +2 -0
- data/app/services/decidim/notification_generator.rb +4 -0
- data/app/services/decidim/notifications_subscriptions_persistor.rb +6 -0
- data/app/services/decidim/push_subscription_endpoint_validator.rb +34 -0
- data/app/services/decidim/send_push_notification.rb +5 -1
- data/app/uploaders/decidim/image_uploader.rb +1 -1
- data/app/uploaders/decidim/organization_favicon_uploader.rb +4 -9
- data/app/validators/uploader_image_dimensions_validator.rb +13 -11
- data/app/views/decidim/delete_user_mailer/delete.html.erb +6 -0
- data/app/views/decidim/devise/invitations/edit.html.erb +3 -3
- data/app/views/decidim/devise/registrations/new.html.erb +1 -0
- data/app/views/decidim/devise/shared/_tos_fields.html.erb +3 -3
- data/app/views/decidim/gamification/badges/index.html.erb +1 -1
- data/app/views/decidim/homepage/show.html.erb +2 -2
- data/app/views/decidim/last_activities/index.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_error_modal.html.erb +11 -19
- data/app/views/decidim/messaging/conversations/_new_conversation_button.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_reply.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/error.js.erb +12 -7
- data/app/views/decidim/messaging/conversations/new.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/show.html.erb +2 -2
- data/app/views/decidim/newsletters/unsubscribe.html.erb +1 -1
- data/app/views/decidim/notification_mailer/event_received.html.erb +3 -3
- data/app/views/decidim/notifications_settings/show.html.erb +5 -5
- data/app/views/decidim/offline/show.html.erb +1 -1
- data/app/views/decidim/pages/_tabbed.html.erb +3 -3
- data/app/views/decidim/pages/index.html.erb +1 -1
- data/app/views/decidim/participatory_space/members/_member.html.erb +1 -0
- data/app/views/decidim/profiles/show.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +1 -1
- data/app/views/decidim/shared/_filters.html.erb +5 -5
- data/app/views/decidim/shared/_resource_actions.html.erb +4 -4
- data/app/views/decidim/shared/_results_per_page.html.erb +1 -1
- data/app/views/decidim/shared/filters/_check_boxes_tree.html.erb +2 -2
- data/app/views/decidim/shared/filters/_collection.html.erb +1 -1
- data/app/views/decidim/shared/filters/_dropdown_label.html.erb +4 -3
- data/app/views/decidim/user_activities/index.html.erb +1 -1
- data/app/views/devise/mailer/{invite_private_user.html.erb → invite_member.html.erb} +2 -2
- data/app/views/devise/mailer/{invite_private_user.text.erb → invite_member.text.erb} +2 -2
- data/app/views/layouts/decidim/_head.html.erb +2 -2
- data/app/views/layouts/decidim/_wrapper.html.erb +3 -3
- data/app/views/layouts/decidim/footer/_focus_mode_main.html.erb +0 -1
- data/app/views/layouts/decidim/footer/_main.html.erb +1 -2
- data/app/views/layouts/decidim/footer/_main_links.html.erb +56 -28
- data/app/views/layouts/decidim/header/_focus_mode_back_button.html.erb +4 -1
- data/app/views/layouts/decidim/header/_main.html.erb +17 -8
- data/app/views/layouts/decidim/header/_main_language_chooser.html.erb +24 -0
- data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +56 -56
- data/app/views/layouts/decidim/header/_main_links_mobile_account.html.erb +2 -2
- data/app/views/layouts/decidim/header/_main_links_mobile_item_account.html.erb +3 -1
- data/app/views/layouts/decidim/header/_main_menu_mobile.html.erb +18 -5
- data/app/views/layouts/decidim/header/_main_search.html.erb +3 -3
- data/app/views/layouts/decidim/header/_menu.html.erb +5 -5
- data/app/views/layouts/decidim/header/_menu_breadcrumb_desktop.html.erb +40 -12
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile.html.erb +33 -0
- data/app/views/layouts/decidim/shared/_layout_center.html.erb +1 -1
- data/app/views/layouts/decidim/shared/_layout_item.html.erb +1 -1
- data/app/views/layouts/decidim/shared/_layout_two_col.html.erb +1 -1
- data/config/initializers/decidim_locale_aware_named_route_helper.rb +16 -0
- data/config/initializers/devise.rb +6 -0
- data/config/initializers/invisible_captcha.rb +1 -0
- data/config/locales/ar.yml +6 -38
- data/config/locales/bg.yml +3 -39
- data/config/locales/ca-IT.yml +91 -58
- data/config/locales/ca.yml +91 -58
- data/config/locales/cs.yml +54 -58
- data/config/locales/de.yml +45 -68
- data/config/locales/el.yml +3 -31
- data/config/locales/en.yml +88 -55
- data/config/locales/es-MX.yml +93 -60
- data/config/locales/es-PY.yml +93 -60
- data/config/locales/es.yml +95 -62
- data/config/locales/eu.yml +124 -92
- data/config/locales/fi-plain.yml +93 -55
- data/config/locales/fi.yml +96 -58
- data/config/locales/fr-CA.yml +70 -52
- data/config/locales/fr.yml +71 -54
- data/config/locales/ga-IE.yml +3 -1
- data/config/locales/gl.yml +3 -31
- data/config/locales/hu.yml +7 -40
- data/config/locales/id-ID.yml +3 -30
- data/config/locales/is-IS.yml +0 -6
- data/config/locales/it.yml +15 -33
- data/config/locales/ja.yml +105 -71
- data/config/locales/lb.yml +3 -33
- data/config/locales/lt.yml +4 -37
- data/config/locales/lv.yml +3 -30
- data/config/locales/nl.yml +3 -33
- data/config/locales/no.yml +3 -33
- data/config/locales/pl.yml +7 -41
- data/config/locales/pt-BR.yml +24 -65
- data/config/locales/pt.yml +3 -33
- data/config/locales/ro-RO.yml +12 -55
- data/config/locales/ru.yml +0 -16
- data/config/locales/sk.yml +1417 -32
- data/config/locales/sv.yml +44 -62
- data/config/locales/tr-TR.yml +20 -37
- data/config/locales/uk.yml +0 -9
- data/config/locales/zh-CN.yml +3 -30
- data/config/locales/zh-TW.yml +4 -35
- data/config/routes.rb +140 -76
- data/db/data/20251213075429_rename_members_in_action_log.rb +22 -0
- data/db/data/20260319145808_rename_send_to_members_in_newsletter.rb +27 -0
- data/db/migrate/20200730142511_add_file_upload_settings_to_decidim_organizations.rb +13 -15
- data/db/migrate/20250217192438_convert_user_groups_into_users.rb +3 -2
- data/db/migrate/20250523104311_move_cta_to_hero_content_block.rb +1 -1
- data/db/migrate/20250527122040_move_highlighted_content_banner_settings_to_content_block.rb +1 -1
- data/db/migrate/20250819110800_convert_private_exports_id_to_uuid.rb +2 -2
- data/db/migrate/20251112132305_remove_legacy_images_from_core_module.rb +27 -0
- data/db/migrate/20251205122428_rename_participatory_space_private_users_to_members.rb +9 -0
- data/db/migrate/20251216185133_rename_privatable_to_to_participatory_space_in_members.rb +10 -0
- data/db/migrate/20260208201405_remove_user_group_core.rb +21 -0
- data/db/migrate/20260208201406_remove_user_group_memberships.rb +30 -0
- data/db/migrate/20260208201407_remove_user_group_organizations.rb +11 -0
- data/db/migrate/20260217152425_remove_enable_participatory_space_filters_from_decidim_organizations.rb +7 -0
- data/db/migrate/20260314081619_add_index_on_decidim_members.rb +25 -0
- data/decidim-core.gemspec +28 -28
- data/lib/decidim/acts_as_tree.rb +12 -12
- data/lib/decidim/admin_filters_registry.rb +1 -1
- data/lib/decidim/amendable.rb +5 -1
- data/lib/decidim/api/functions/category_list.rb +1 -0
- data/lib/decidim/api/functions/component_finder_base.rb +1 -1
- data/lib/decidim/api/functions/component_list.rb +3 -1
- data/lib/decidim/api/functions/component_list_base.rb +1 -0
- data/lib/decidim/api/functions/participatory_space_finder_base.rb +1 -1
- data/lib/decidim/api/functions/participatory_space_list_base.rb +1 -0
- data/lib/decidim/api/functions/user_entity_list.rb +2 -1
- data/lib/decidim/api/interfaces/amendable_entity_interface.rb +1 -0
- data/lib/decidim/api/interfaces/amendable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/attachable_collection_interface.rb +1 -0
- data/lib/decidim/api/interfaces/attachable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/author_interface.rb +2 -1
- data/lib/decidim/api/interfaces/authorable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/categories_container_interface.rb +1 -0
- data/lib/decidim/api/interfaces/categorizable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/coauthorable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/component_interface.rb +9 -8
- data/lib/decidim/api/interfaces/fingerprint_interface.rb +1 -0
- data/lib/decidim/api/interfaces/followable_interface.rb +2 -0
- data/lib/decidim/api/interfaces/likeable_interface.rb +2 -2
- data/lib/decidim/api/interfaces/localizable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/participatory_space_interface.rb +1 -0
- data/lib/decidim/api/interfaces/referable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/scopable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/taxonomizable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/timestamps_interface.rb +1 -0
- data/lib/decidim/api/interfaces/traceable_interface.rb +1 -0
- data/lib/decidim/api/types/attachment_collection_type.rb +5 -3
- data/lib/decidim/api/types/attachment_type.rb +11 -4
- data/lib/decidim/api/types/badge_score_type.rb +28 -0
- data/lib/decidim/api/types/moderation_type.rb +25 -0
- data/lib/decidim/api/types/participant_details_type.rb +17 -0
- data/lib/decidim/api/types/reportable_type.rb +18 -0
- data/lib/decidim/api/types/reportable_user_type.rb +17 -0
- data/lib/decidim/api/types/static_page_topic_type.rb +16 -0
- data/lib/decidim/api/types/static_page_type.rb +22 -0
- data/lib/decidim/api/types/taxonomy_type.rb +2 -0
- data/lib/decidim/api/types/user_moderation_type.rb +36 -0
- data/lib/decidim/api/types/user_type.rb +13 -0
- data/lib/decidim/asset_router/pipeline.rb +1 -1
- data/lib/decidim/asset_router/storage.rb +9 -9
- data/lib/decidim/assets/tailwind/tailwind.config.js.erb +4 -1
- data/lib/decidim/attachment_attributes.rb +58 -9
- data/lib/decidim/attribute_encryptor.rb +51 -10
- data/lib/decidim/attribute_object/model.rb +0 -5
- data/lib/decidim/block_registry.rb +1 -1
- data/lib/decidim/coauthorable.rb +2 -1
- data/lib/decidim/command.rb +2 -1
- data/lib/decidim/content_parsers/blob_parser.rb +3 -3
- data/lib/decidim/content_processor.rb +1 -1
- data/lib/decidim/content_renderers/base_renderer.rb +112 -0
- data/lib/decidim/content_renderers/blob_renderer.rb +6 -9
- data/lib/decidim/content_renderers/mention_resource_renderer.rb +10 -6
- data/lib/decidim/content_renderers/resource_renderer.rb +16 -7
- data/lib/decidim/content_renderers/user_renderer.rb +11 -9
- data/lib/decidim/core/api.rb +8 -0
- data/lib/decidim/core/content_blocks/registry_manager.rb +4 -10
- data/lib/decidim/core/engine.rb +10 -34
- data/lib/decidim/core/menu.rb +0 -26
- data/lib/decidim/core/test/factories.rb +32 -18
- data/lib/decidim/core/test/shared_examples/access_mode_restricted_participatory_spaces.rb +175 -0
- data/lib/decidim/core/test/shared_examples/access_mode_transparent_participatory_spaces.rb +244 -0
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +10 -10
- data/lib/decidim/core/test/shared_examples/amendable/amendment_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +147 -117
- data/lib/decidim/core/test/shared_examples/fingerprint_examples.rb +2 -0
- data/lib/decidim/core/test/shared_examples/has_members.rb +63 -0
- data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +2 -1
- data/lib/decidim/core/test/shared_examples/manage_share_tokens_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/map_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/participant_details_examples.rb +16 -0
- data/lib/decidim/core/test/shared_examples/participatory_space_members_page_examples.rb +10 -10
- data/lib/decidim/core/test/shared_examples/participatory_space_members_shared_examples.rb +121 -0
- data/lib/decidim/core/test/shared_examples/resource_liked_event_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/resource_locator_presenter_examples.rb +7 -7
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/simple_event.rb +1 -0
- data/lib/decidim/core/test/shared_examples/translated_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +1 -1
- data/lib/decidim/core/test.rb +2 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +222 -335
- data/lib/decidim/download_your_data_serializers/{download_your_data_participatory_space_private_user_serializer.rb → download_your_data_member_serializer.rb} +6 -6
- data/lib/decidim/download_your_data_serializers.rb +2 -2
- data/lib/decidim/engine_router.rb +31 -6
- data/lib/decidim/exporters/csv.rb +1 -1
- data/lib/decidim/filter_form_builder.rb +1 -1
- data/lib/decidim/form_builder.rb +58 -36
- data/{app/controllers/concerns → lib}/decidim/form_factory.rb +11 -1
- data/lib/decidim/has_settings.rb +2 -2
- data/lib/decidim/legacy_form_builder.rb +1 -0
- data/lib/decidim/locale_router_detector.rb +41 -0
- data/lib/decidim/maintenance/import_models/scope.rb +1 -1
- data/lib/decidim/maintenance/import_models.rb +0 -2
- data/lib/decidim/maintenance/taxonomy_importer.rb +1 -1
- data/lib/decidim/map/autocomplete.rb +4 -3
- data/lib/decidim/map/dynamic_map.rb +3 -1
- data/lib/decidim/map/frontend.rb +1 -1
- data/lib/decidim/map/geocoding.rb +2 -2
- data/lib/decidim/map/static_map.rb +10 -22
- data/lib/decidim/map/utility.rb +3 -6
- data/lib/decidim/map.rb +2 -2
- data/lib/decidim/menu.rb +1 -1
- data/lib/decidim/menu_item.rb +1 -0
- data/lib/decidim/menu_registry.rb +1 -1
- data/lib/decidim/moderation_tools.rb +1 -1
- data/lib/decidim/newsletter_encryptor.rb +5 -8
- data/lib/decidim/organization_settings.rb +2 -2
- data/lib/decidim/participable.rb +1 -0
- data/lib/decidim/participatory_space/has_members.rb +61 -0
- data/lib/decidim/participatory_space_manifest.rb +0 -4
- data/lib/decidim/participatory_space_resourceable.rb +10 -1
- data/lib/decidim/participatory_space_user.rb +1 -1
- data/lib/decidim/routes/locale_redirects.rb +47 -0
- data/lib/decidim/routes.rb +7 -0
- data/lib/decidim/search_resource_fields_mapper.rb +3 -4
- data/lib/decidim/searchable.rb +9 -4
- data/lib/decidim/seeds.rb +17 -0
- data/lib/decidim/shakapacker/runner.rb +4 -4
- data/lib/decidim/shakapacker/shakapacker.yml +28 -3
- data/lib/decidim/taxonomizable.rb +1 -1
- data/lib/decidim/translatable_attributes.rb +9 -3
- data/lib/decidim/view_model.rb +5 -1
- data/lib/devise/models/decidim_newsletterable.rb +1 -1
- data/lib/tasks/decidim_mailers_tasks.rake +31 -9
- data/lib/tasks/decidim_procfile.rake +1 -1
- data/lib/tasks/decidim_tasks.rake +0 -1
- data/lib/tasks/decidim_taxonomies.rake +1 -1
- data/lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake +0 -1
- data/lib/tasks/upgrade/decidim_encryption.rake +12 -0
- data/lib/tasks/upgrade/decidim_migrate_wysiwyg_content.rake +0 -1
- data/lib/tasks/upgrade/decidim_remove_deleted_users_left_data_tasks.rake +1 -1
- data/lib/tasks/upgrade/{fix_deleted_private_follows.rake → fix_deleted_members_follows.rake} +5 -5
- data/lib/tasks/upgrade/migrations.rake +0 -1
- data/lib/tasks/upgrade/user_groups_migration.rake +0 -1
- metadata +244 -132
- data/app/cells/decidim/content_blocks/global_menu/show.erb +0 -11
- data/app/cells/decidim/content_blocks/global_menu_cell.rb +0 -35
- data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity/show.erb +0 -10
- data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity_cell.rb +0 -49
- data/app/cells/decidim/participatory_space_dropdown_metadata/links.erb +0 -9
- data/app/cells/decidim/participatory_space_dropdown_metadata/metadata.erb +0 -1
- data/app/cells/decidim/participatory_space_dropdown_metadata/show.erb +0 -11
- data/app/cells/decidim/participatory_space_dropdown_metadata_cell.rb +0 -26
- data/app/commands/decidim/gallery_methods.rb +0 -107
- data/app/controllers/concerns/decidim/has_members_page.rb +0 -25
- data/app/jobs/decidim/newsletters_opt_in_job.rb +0 -11
- data/app/jobs/decidim/user_report_job.rb +0 -11
- data/app/models/decidim/participatory_space_private_user.rb +0 -51
- data/app/packs/src/decidim/controllers/sticky_header/controller.js +0 -116
- data/app/packs/src/decidim/controllers/sticky_header/sticky_header.test.js +0 -320
- data/app/packs/src/decidim/dropdown_menu.js +0 -18
- data/app/packs/src/decidim/identity_selector_dialog.js +0 -33
- data/app/packs/src/decidim/vendor/tribute.js +0 -1890
- data/app/packs/stylesheets/decidim/_tribute.scss +0 -36
- data/app/presenters/decidim/admin_log/participatory_space_private_user_presenter.rb +0 -38
- data/app/presenters/decidim/participatory_space_private_user_presenter.rb +0 -46
- data/app/views/decidim/participants_account_mailer/removal_notification.html.erb +0 -11
- data/app/views/decidim/participatory_space_private_users/_participatory_space_private_user.html.erb +0 -1
- data/app/views/layouts/decidim/footer/_main_language_chooser.html.erb +0 -26
- data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +0 -34
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_desktop.html.erb +0 -10
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_mobile.html.erb +0 -17
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_top_left.html.erb +0 -2
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +0 -33
- data/app/views/layouts/decidim/header/_mobile_language_choose.html.erb +0 -25
- data/lib/decidim/core/test/shared_examples/has_private_users.rb +0 -63
- data/lib/decidim/core/test/shared_examples/participatory_space_dropdown_metadata_cell_examples.rb +0 -81
- data/lib/decidim/has_private_users.rb +0 -57
- data/lib/decidim/maintenance/import_models/assembly_type.rb +0 -49
- data/lib/decidim/maintenance/import_models/participatory_process_type.rb +0 -21
- data/lib/decidim/query_extensions.rb +0 -64
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
# This class serializes a User so can be exported to CSV
|
|
5
5
|
module DownloadYourDataSerializers
|
|
6
|
-
class
|
|
6
|
+
class DownloadYourDataMemberSerializer < Decidim::Exporters::Serializer
|
|
7
7
|
include Decidim::ResourceHelper
|
|
8
8
|
|
|
9
9
|
# Public: Exports a hash with the serialized data for this user.
|
|
10
10
|
def serialize
|
|
11
11
|
{
|
|
12
12
|
id: resource.id,
|
|
13
|
-
|
|
14
|
-
id: resource.
|
|
15
|
-
type: resource.
|
|
16
|
-
title: resource.
|
|
17
|
-
slug: resource.
|
|
13
|
+
participatory_space: {
|
|
14
|
+
id: resource.participatory_space_id,
|
|
15
|
+
type: resource.participatory_space_type,
|
|
16
|
+
title: resource.participatory_space.title,
|
|
17
|
+
slug: resource.participatory_space.slug
|
|
18
18
|
},
|
|
19
19
|
created_at: resource.created_at,
|
|
20
20
|
updated_at: resource.updated_at,
|
|
@@ -8,12 +8,12 @@ module Decidim
|
|
|
8
8
|
autoload :DownloadYourDataFollowSerializer, "decidim/download_your_data_serializers/download_your_data_follow_serializer"
|
|
9
9
|
autoload :DownloadYourDataNotificationSerializer, "decidim/download_your_data_serializers/download_your_data_notification_serializer"
|
|
10
10
|
autoload :DownloadYourDataIdentitySerializer, "decidim/download_your_data_serializers/download_your_data_identity_serializer"
|
|
11
|
-
autoload :
|
|
11
|
+
autoload :DownloadYourDataMemberSerializer, "decidim/download_your_data_serializers/download_your_data_member_serializer"
|
|
12
12
|
|
|
13
13
|
def self.data_entities
|
|
14
14
|
["Decidim::Follow", "Decidim::Identity",
|
|
15
15
|
"Decidim::Messaging::Conversation", "Decidim::Notification",
|
|
16
|
-
"Decidim::
|
|
16
|
+
"Decidim::ParticipatorySpace::Member", "Decidim::Report", "Decidim::User"] |
|
|
17
17
|
Decidim.component_manifests.map(&:data_portable_entities).flatten |
|
|
18
18
|
Decidim.participatory_space_manifests.map(&:data_portable_entities).flatten |
|
|
19
19
|
(Decidim::Comments.data_portable_entities.flatten if defined?(Decidim::Comments))
|
|
@@ -25,13 +25,14 @@ module Decidim
|
|
|
25
25
|
#
|
|
26
26
|
# @return [EngineRouter] The new engine router
|
|
27
27
|
def self.admin_proxy(target)
|
|
28
|
-
new(target.mounted_admin_engine, target.mounted_params, target)
|
|
28
|
+
new(target.mounted_admin_engine, target.mounted_params.except(:locale), target, admin: true)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def initialize(engine, default_url_options, target = nil)
|
|
31
|
+
def initialize(engine, default_url_options, target = nil, options = {})
|
|
32
32
|
@engine = engine
|
|
33
33
|
@default_url_options = default_url_options
|
|
34
34
|
@target = target
|
|
35
|
+
@admin = options.fetch(:admin, false)
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
def default_url_options
|
|
@@ -47,13 +48,35 @@ module Decidim
|
|
|
47
48
|
|
|
48
49
|
filter_slug_params!(method_name)
|
|
49
50
|
|
|
50
|
-
send(engine).send(method_name, *)
|
|
51
|
+
result = send(engine).send(method_name, *)
|
|
52
|
+
admin? ? rewrite_locale_in_admin_path(result, method_name) : result
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
private
|
|
54
56
|
|
|
55
57
|
attr_reader :engine, :target
|
|
56
58
|
|
|
59
|
+
def admin?
|
|
60
|
+
@admin
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Rewrites the locale segment in an admin path or URL to match the current
|
|
64
|
+
# I18n.locale. The admin engine routes are mounted under /:locale/admin but
|
|
65
|
+
# sub-engines mounted inside the admin engine do not have direct access to
|
|
66
|
+
# the locale segment, so they fall back to Decidim.default_locale. This
|
|
67
|
+
# method corrects the generated path/URL after the fact.
|
|
68
|
+
#
|
|
69
|
+
# For paths: /en/admin/... -> /ca/admin/...
|
|
70
|
+
# For URLs: http://host/en/admin/... -> http://host/ca/admin/...
|
|
71
|
+
def rewrite_locale_in_admin_path(result, method_name)
|
|
72
|
+
locale = I18n.locale.to_s
|
|
73
|
+
if method_name.to_s.end_with?("_url")
|
|
74
|
+
result.sub(%r{(https?://[^/]+)/[^/]+/}, "\\1/#{locale}/")
|
|
75
|
+
else
|
|
76
|
+
result.sub(%r{\A/[^/]+/}, "/#{locale}/")
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
57
80
|
def filter_slug_params!(method_name)
|
|
58
81
|
return if target.nil?
|
|
59
82
|
return unless target.respond_to?(:mounted_params)
|
|
@@ -67,9 +90,11 @@ module Decidim
|
|
|
67
90
|
end
|
|
68
91
|
|
|
69
92
|
def configured_default_url_options
|
|
70
|
-
@configured_default_url_options ||=
|
|
71
|
-
ActionMailer::Base.default_url_options.presence ||
|
|
72
|
-
|
|
93
|
+
@configured_default_url_options ||= begin
|
|
94
|
+
opts = ActionMailer::Base.default_url_options.presence ||
|
|
95
|
+
UrlOptionResolver.new.options
|
|
96
|
+
opts
|
|
97
|
+
end
|
|
73
98
|
end
|
|
74
99
|
end
|
|
75
100
|
end
|
data/lib/decidim/form_builder.rb
CHANGED
|
@@ -45,14 +45,6 @@ module Decidim
|
|
|
45
45
|
end
|
|
46
46
|
# rubocop:enable Metrics/ParameterLists
|
|
47
47
|
|
|
48
|
-
def create_language_selector(locales, tabs_id, name)
|
|
49
|
-
if locales.count > 4
|
|
50
|
-
language_selector_select(locales, tabs_id, name)
|
|
51
|
-
else
|
|
52
|
-
language_tabs(locales, tabs_id, name)
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
|
|
56
48
|
# Public: Generates a form field for each locale.
|
|
57
49
|
#
|
|
58
50
|
# type - The form field's type, like `text_area` or `text_field`
|
|
@@ -65,23 +57,11 @@ module Decidim
|
|
|
65
57
|
|
|
66
58
|
tabs_id = sanitize_tabs_selector(options[:tabs_id] || "#{object_name}-#{name}-tabs")
|
|
67
59
|
|
|
68
|
-
|
|
69
|
-
field_label = label_i18n(name, options[:label] || label_for(name), required: options[:required])
|
|
60
|
+
error_on_locale = locales.find { |locale| error?(name_with_locale(name, locale)) }
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
language_selector = create_language_selector(locales, tabs_id, name) if options[:label] != false
|
|
62
|
+
label_tabs = translated_labels(name, options, tabs_id, error_on_locale)
|
|
73
63
|
|
|
74
|
-
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
tabs_content = content_tag(:div, class: "tabs-content", data: { tabs_content: tabs_id }) do
|
|
78
|
-
locales.each_with_index.inject("".html_safe) do |string, (locale, index)|
|
|
79
|
-
tab_content_id = "#{tabs_id}-#{name}-panel-#{index}"
|
|
80
|
-
string + content_tag(:div, class: tab_element_class_for("panel", index), id: tab_content_id, "aria-hidden": tab_attr_aria_hidden_for(index)) do
|
|
81
|
-
send(type, name_with_locale(name, locale), options.merge(label: false))
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
64
|
+
tabs_content = translated_tabs(type, name, options, tabs_id, error_on_locale)
|
|
85
65
|
|
|
86
66
|
safe_join [label_tabs, tabs_content]
|
|
87
67
|
end
|
|
@@ -452,6 +432,44 @@ module Decidim
|
|
|
452
432
|
|
|
453
433
|
private
|
|
454
434
|
|
|
435
|
+
def translated_tabs(type, name, options, tabs_id, error_on_locale = nil)
|
|
436
|
+
content_tag(:div, class: "tabs-content", data: { tabs_content: tabs_id }) do
|
|
437
|
+
locales.each_with_index.inject("".html_safe) do |string, (locale, index)|
|
|
438
|
+
tab_content_id = sanitize_tabs_selector "#{tabs_id}-#{name}-panel-#{index}"
|
|
439
|
+
|
|
440
|
+
aria_hidden = (error_on_locale.present? ? !locale.eql?(error_on_locale) : index.positive?).to_s
|
|
441
|
+
css_class = if error_on_locale.present?
|
|
442
|
+
tab_element_class_for("panel", locale.eql?(error_on_locale) ? 0 : 1)
|
|
443
|
+
else
|
|
444
|
+
tab_element_class_for("panel", index)
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
string + content_tag(:div, class: css_class, id: tab_content_id, "aria-hidden": aria_hidden) do
|
|
448
|
+
send(type, name_with_locale(name, locale), options.merge(label: false))
|
|
449
|
+
end
|
|
450
|
+
end
|
|
451
|
+
end
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
def create_language_selector(locales, tabs_id, name, error_on_locale = nil)
|
|
455
|
+
if locales.count > 4
|
|
456
|
+
language_selector_select(locales, tabs_id, name, error_on_locale)
|
|
457
|
+
else
|
|
458
|
+
language_tabs(locales, tabs_id, name, error_on_locale)
|
|
459
|
+
end
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
def translated_labels(name, options, tabs_id, error_on_locale = nil)
|
|
463
|
+
content_tag(:div, class: "label--tabs") do
|
|
464
|
+
field_label = label_i18n(name, options[:label] || label_for(name), required: options[:required])
|
|
465
|
+
|
|
466
|
+
language_selector = "".html_safe
|
|
467
|
+
language_selector = create_language_selector(locales, tabs_id, name, error_on_locale) if options[:label] != false
|
|
468
|
+
|
|
469
|
+
safe_join [field_label, language_selector]
|
|
470
|
+
end
|
|
471
|
+
end
|
|
472
|
+
|
|
455
473
|
def editor_hidden_options(name, options)
|
|
456
474
|
hidden_options = extract_validations(name, options).merge(options)
|
|
457
475
|
if hidden_options[:minlength] || hidden_options[:maxlength]
|
|
@@ -682,9 +700,7 @@ module Decidim
|
|
|
682
700
|
end
|
|
683
701
|
|
|
684
702
|
def tab_attr_aria_hidden_for(index)
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
"true"
|
|
703
|
+
index.positive?.to_s
|
|
688
704
|
end
|
|
689
705
|
|
|
690
706
|
def locales
|
|
@@ -799,29 +815,35 @@ module Decidim
|
|
|
799
815
|
class: "columns")
|
|
800
816
|
end
|
|
801
817
|
|
|
802
|
-
|
|
818
|
+
# i18n-tasks-use t('locale.name_with_error')
|
|
819
|
+
# i18n-tasks-use t('locale.name')
|
|
820
|
+
def language_selector_select(locales, tabs_id, name, error_on_locale = nil)
|
|
803
821
|
content_tag(:div) do
|
|
804
822
|
content_tag(:select, id: tabs_id, class: "language-change", data: { controller: "language-change" }) do
|
|
805
823
|
locales.each_with_index.inject("".html_safe) do |string, (locale, index)|
|
|
806
|
-
title =
|
|
807
|
-
|
|
808
|
-
else
|
|
809
|
-
I18n.with_locale(locale) { I18n.t("name", scope: "locale") }
|
|
810
|
-
end
|
|
824
|
+
title = locale.eql?(error_on_locale) ? "name_with_error" : "name"
|
|
825
|
+
title = I18n.with_locale(locale) { I18n.t(title, scope: "locale") }
|
|
811
826
|
tab_content_id = sanitize_tabs_selector "#{tabs_id}-#{name}-panel-#{index}"
|
|
812
|
-
string + content_tag(:option, title, value: "##{tab_content_id}")
|
|
827
|
+
string + content_tag(:option, title, value: "##{tab_content_id}", selected: locale.eql?(error_on_locale))
|
|
813
828
|
end
|
|
814
829
|
end
|
|
815
830
|
end
|
|
816
831
|
end
|
|
817
832
|
|
|
818
|
-
def language_tabs(locales, tabs_id, name)
|
|
833
|
+
def language_tabs(locales, tabs_id, name, error_on_locale = nil)
|
|
819
834
|
content_tag(:ul, class: "tabs tabs--lang", id: tabs_id, data: { tabs: true }) do
|
|
820
835
|
locales.each_with_index.inject("".html_safe) do |string, (locale, index)|
|
|
821
|
-
|
|
836
|
+
display = if error_on_locale.nil?
|
|
837
|
+
index
|
|
838
|
+
else
|
|
839
|
+
locale.eql?(error_on_locale) ? 0 : 1
|
|
840
|
+
end
|
|
841
|
+
|
|
842
|
+
css_class = tab_element_class_for("title", display)
|
|
843
|
+
string + content_tag(:li, class: css_class) do
|
|
822
844
|
title = I18n.with_locale(locale) { I18n.t("name", scope: "locale") }
|
|
823
845
|
element_class = nil
|
|
824
|
-
element_class = "is-tab-error" if
|
|
846
|
+
element_class = "is-tab-error" if locale.eql?(error_on_locale)
|
|
825
847
|
tab_content_id = sanitize_tabs_selector "#{tabs_id}-#{name}-panel-#{index}"
|
|
826
848
|
content_tag(:a, title, href: "##{tab_content_id}", class: element_class)
|
|
827
849
|
end
|
|
@@ -75,10 +75,20 @@ module Decidim
|
|
|
75
75
|
current_component: @controller.try(:current_component),
|
|
76
76
|
current_user: @controller.try(:current_user),
|
|
77
77
|
current_participatory_space: @controller.try(:current_participatory_space)
|
|
78
|
-
}
|
|
78
|
+
}.merge(@controller.form_context)
|
|
79
79
|
end
|
|
80
80
|
end.new(klass, self)
|
|
81
81
|
end
|
|
82
|
+
|
|
83
|
+
# Provides additional context values for forms built through this factory.
|
|
84
|
+
# Controllers (and extension gems) can override this method to inject
|
|
85
|
+
# extra context into form objects, which will be merged into the base
|
|
86
|
+
# context defined in `context`.
|
|
87
|
+
#
|
|
88
|
+
# This method must always return a Hash, typically with symbol keys.
|
|
89
|
+
def form_context
|
|
90
|
+
{}
|
|
91
|
+
end
|
|
82
92
|
end
|
|
83
93
|
end
|
|
84
94
|
end
|
data/lib/decidim/has_settings.rb
CHANGED
|
@@ -45,8 +45,8 @@ module Decidim
|
|
|
45
45
|
def step_settings
|
|
46
46
|
return {} unless participatory_space.allows_steps?
|
|
47
47
|
|
|
48
|
-
participatory_space.steps.
|
|
49
|
-
|
|
48
|
+
participatory_space.steps.to_h do |step|
|
|
49
|
+
[step.id.to_s, new_settings_schema(:step, self[:settings].dig("steps", step.id.to_s))]
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
52
|
|
|
@@ -10,6 +10,7 @@ module Decidim
|
|
|
10
10
|
class LegacyFormBuilder < ActionView::Helpers::FormBuilder
|
|
11
11
|
include ActionView::Helpers::TagHelper
|
|
12
12
|
include ActionView::Helpers::OutputSafetyHelper
|
|
13
|
+
|
|
13
14
|
%w(file_field email_field text_field url_field
|
|
14
15
|
number_field search_field color_field)
|
|
15
16
|
.each do |method_name|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Handle the locale redirects in the route files
|
|
4
|
+
# It tries to detect a place where the locale is being present, either as a GET parameter,
|
|
5
|
+
# or a session, or if there is nothing it will return the default locale of the organization.
|
|
6
|
+
module Decidim
|
|
7
|
+
class LocaleRouterDetector
|
|
8
|
+
def initialize(request, params)
|
|
9
|
+
@request = request
|
|
10
|
+
@input_params = params
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def locale
|
|
14
|
+
available_locales.map(&:to_sym).include?(extracted_locale.to_sym) ? extracted_locale : default_locale
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
attr_reader :request, :input_params
|
|
20
|
+
|
|
21
|
+
def extracted_locale
|
|
22
|
+
input_params[:locale].presence || request.parameters[:locale].presence || current_user_locale || request.session[:user_locale].presence || I18n.locale
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def current_user_locale
|
|
26
|
+
request.env["warden"]&.user("user")&.locale.presence
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def available_locales
|
|
30
|
+
(organization || Decidim).available_locales
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def default_locale
|
|
34
|
+
(organization || Decidim).default_locale
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def organization
|
|
38
|
+
request.env["decidim.current_organization"]
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -11,7 +11,7 @@ module Decidim
|
|
|
11
11
|
"Decidim::Budgets::Budget", "Decidim::Budgets::Project",
|
|
12
12
|
"Decidim::Debates::Debate",
|
|
13
13
|
"Decidim::Meetings::Meeting",
|
|
14
|
-
"Decidim::Proposals::
|
|
14
|
+
"Decidim::Proposals::Proposal"
|
|
15
15
|
]
|
|
16
16
|
participatory_space_models ["Decidim::Assembly", "Decidim::ParticipatoryProcess", "Decidim::Conference", "Decidim::Initiative"]
|
|
17
17
|
|
|
@@ -7,8 +7,6 @@ module Decidim
|
|
|
7
7
|
module Maintenance
|
|
8
8
|
module ImportModels
|
|
9
9
|
autoload :ApplicationRecord, "decidim/maintenance/import_models/application_record"
|
|
10
|
-
autoload :ParticipatoryProcessType, "decidim/maintenance/import_models/participatory_process_type"
|
|
11
|
-
autoload :AssemblyType, "decidim/maintenance/import_models/assembly_type"
|
|
12
10
|
autoload :Scope, "decidim/maintenance/import_models/scope"
|
|
13
11
|
autoload :Area, "decidim/maintenance/import_models/area"
|
|
14
12
|
autoload :AreaType, "decidim/maintenance/import_models/area_type"
|
|
@@ -85,7 +85,7 @@ module Decidim
|
|
|
85
85
|
component = GlobalID::Locator.locate(component_id)
|
|
86
86
|
if component
|
|
87
87
|
begin
|
|
88
|
-
component.update!(settings:
|
|
88
|
+
component.update!(settings: component.settings.to_h.merge(taxonomy_filters: [filter.id.to_s]))
|
|
89
89
|
result[:components_assigned][filter.internal_name[organization.default_locale]] ||= []
|
|
90
90
|
result[:components_assigned][filter.internal_name[organization.default_locale]] << component_id
|
|
91
91
|
rescue ActiveRecord::RecordInvalid
|
|
@@ -37,19 +37,20 @@ module Decidim
|
|
|
37
37
|
template.snippets.add(:decidim_geocoding_scripts, template.append_javascript_pack_tag("decidim_geocoding"))
|
|
38
38
|
template.snippets.add(:decidim_geocoding_styles, template.append_stylesheet_pack_tag("decidim_geocoding"))
|
|
39
39
|
|
|
40
|
-
template.content_tag(:div, class: "geocoding
|
|
40
|
+
template.content_tag(:div, class: "geocoding") do
|
|
41
41
|
template.text_field(
|
|
42
42
|
object_name,
|
|
43
43
|
method,
|
|
44
44
|
options.merge("data-decidim-geocoding" => view_options.to_json)
|
|
45
45
|
) +
|
|
46
|
-
template.content_tag(:div, class: "input-group-button
|
|
47
|
-
template.content_tag(:button, class: "button button__sm md:button__sm button__text-secondary", type: "button", data: {
|
|
46
|
+
template.content_tag(:div, class: "input-group-button geocoding__locate") do
|
|
47
|
+
template.content_tag(:button, class: "button button__sm md:button__sm button__text-secondary geocoding__button", type: "button", data: {
|
|
48
48
|
input: "#{object_name}_#{method}",
|
|
49
49
|
latitude: "#{object_name}_latitude",
|
|
50
50
|
longitude: "#{object_name}_longitude",
|
|
51
51
|
error_no_location: I18n.t("errors.no_device_location", scope: "decidim.proposals.forms"),
|
|
52
52
|
error_unsupported: I18n.t("errors.device_not_supported", scope: "decidim.proposals.forms"),
|
|
53
|
+
locating_text: I18n.t("locating", scope: "decidim.proposals.forms"),
|
|
53
54
|
url: Decidim::Core::Engine.routes.url_helpers.locate_path
|
|
54
55
|
}) do
|
|
55
56
|
icon("map-pin-line", role: "img", "aria-hidden": true) + " #{I18n.t("use_my_location", scope: "decidim.proposals.forms")}"
|
|
@@ -30,7 +30,9 @@ module Decidim
|
|
|
30
30
|
def builder_options
|
|
31
31
|
{
|
|
32
32
|
marker_color: organization.colors.fetch("primary", "#e02d2d"),
|
|
33
|
-
tile_layer: tile_layer_configuration
|
|
33
|
+
tile_layer: tile_layer_configuration,
|
|
34
|
+
zoom_in_text: I18n.t("zoom_in", scope: "decidim.map.dynamic"),
|
|
35
|
+
zoom_out_text: I18n.t("zoom_out", scope: "decidim.map.dynamic")
|
|
34
36
|
}
|
|
35
37
|
end
|
|
36
38
|
|
data/lib/decidim/map/frontend.rb
CHANGED
|
@@ -68,7 +68,7 @@ module Decidim
|
|
|
68
68
|
# Converts a hash with Ruby-style key names (snake_case) to JS-style key
|
|
69
69
|
# names (camelCase).
|
|
70
70
|
#
|
|
71
|
-
# @param [Hash] The original hash with Ruby-style hash keys in
|
|
71
|
+
# @param hash [Hash] The original hash with Ruby-style hash keys in
|
|
72
72
|
# snake_case format.
|
|
73
73
|
#
|
|
74
74
|
# @return [Hash] The resulting hash with JS-style hash keys in camelCase
|
|
@@ -22,7 +22,7 @@ module Decidim
|
|
|
22
22
|
# A common search method to lookup information about an address or
|
|
23
23
|
# coordinates from the geocoder.
|
|
24
24
|
#
|
|
25
|
-
# @param query [
|
|
25
|
+
# @param query [Array(Array<Float, String>, Array<Float, String>)] The
|
|
26
26
|
# search query to be passed to the geocoder
|
|
27
27
|
# @param options [Hash] Extra options to be provided for the geocoder
|
|
28
28
|
# search
|
|
@@ -55,7 +55,7 @@ module Decidim
|
|
|
55
55
|
# (latitude/longitude) coordinates and returns a clear text address for
|
|
56
56
|
# the closest result.
|
|
57
57
|
#
|
|
58
|
-
# @param coordinates [Array(<Float, String>, <Float, String>)] An array of
|
|
58
|
+
# @param coordinates [Array(Array<Float, String>, Array<Float, String>)] An array of
|
|
59
59
|
# the coordinates where the first element is the latitude and the second
|
|
60
60
|
# element is the longitude
|
|
61
61
|
# @param options [Hash] Extra options to be provided for the geocoder
|
|
@@ -11,14 +11,10 @@ module Decidim
|
|
|
11
11
|
# Creates a link for the static maps. This will point to an external map
|
|
12
12
|
# service where the user can further explore the given location.
|
|
13
13
|
#
|
|
14
|
-
# @param
|
|
15
|
-
# @
|
|
16
|
-
#
|
|
17
|
-
# @option
|
|
18
|
-
# position to be linked to
|
|
19
|
-
# @option params [Hash] :options Extra options that can be provided to the
|
|
20
|
-
# map URL containing the following keys:
|
|
21
|
-
# * zoom: A number to represent the zoom value of the map (default 17)
|
|
14
|
+
# @param latitude [Float, String] The latitude of the map position to be linked to
|
|
15
|
+
# @param longitude [Float, String] The longitude of the map position to be linked to
|
|
16
|
+
# @param options [Hash{Symbol => Object}] The parameters for the static map URL
|
|
17
|
+
# @option options [Integer] :zoom A number to represent the zoom value of the map (default 17)
|
|
22
18
|
#
|
|
23
19
|
# @return [String] The link where the static map images link to.
|
|
24
20
|
def link(latitude:, longitude:, options: {})
|
|
@@ -40,20 +36,12 @@ module Decidim
|
|
|
40
36
|
# Creates a URL that generates a static map image for the given map
|
|
41
37
|
# location with the given options.
|
|
42
38
|
#
|
|
43
|
-
# @param
|
|
44
|
-
# @
|
|
45
|
-
#
|
|
46
|
-
# @option
|
|
47
|
-
#
|
|
48
|
-
# @option
|
|
49
|
-
# the underlying map service to generate the image with containing the
|
|
50
|
-
# following keys:
|
|
51
|
-
# * zoom: A number to represent the zoom value of the map image (default
|
|
52
|
-
# 15)
|
|
53
|
-
# * width: A number to represent the pixel width of the map image
|
|
54
|
-
# (default 300)
|
|
55
|
-
# * height: A number to represent the pixel height of the map image
|
|
56
|
-
# (default 300)
|
|
39
|
+
# @param latitude [Float, String] :latitude The latitude of the map position
|
|
40
|
+
# @param longitude [Float, String] The longitude of the map position
|
|
41
|
+
# @param options [Hash] Extra options for the static map URL
|
|
42
|
+
# @option options [Integer] :zoom Zoom level of the map image (default 15)
|
|
43
|
+
# @option options [Integer] :width Pixel width of the map image (default 300)
|
|
44
|
+
# @option options [Integer] :height Pixel height of the map image (default 300)
|
|
57
45
|
#
|
|
58
46
|
# @return [String] The URL to request for the static map image.
|
|
59
47
|
def url(latitude:, longitude:, options: {})
|
data/lib/decidim/map/utility.rb
CHANGED
|
@@ -11,12 +11,9 @@ module Decidim
|
|
|
11
11
|
|
|
12
12
|
# Initializes the map utility.
|
|
13
13
|
#
|
|
14
|
-
# @param
|
|
15
|
-
# @
|
|
16
|
-
#
|
|
17
|
-
# @option options [String] :config The configuration hash specific to the
|
|
18
|
-
# utility
|
|
19
|
-
# @option options [String] :locale The locale to use for the queries
|
|
14
|
+
# @param organization [Decidim::Organization] The organization where the map functionality is used
|
|
15
|
+
# @param config [String] The configuration hash specific to the utility
|
|
16
|
+
# @param locale [String] The locale to use for the queries
|
|
20
17
|
def initialize(organization:, config:, locale: I18n.locale.to_s)
|
|
21
18
|
@organization = organization
|
|
22
19
|
@locale = locale
|
data/lib/decidim/map.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Decidim
|
|
|
24
24
|
# Public: Returns a boolean indicating if the category of mapping services
|
|
25
25
|
# is available for this instance that the provided key represents.
|
|
26
26
|
#
|
|
27
|
-
# @param
|
|
27
|
+
# @param categories [Array<Symbol>] The utility category key to check the
|
|
28
28
|
# availability for.
|
|
29
29
|
# @return [Boolean] A boolean indicating if the category of mapping services
|
|
30
30
|
# is available.
|
|
@@ -58,7 +58,7 @@ module Decidim
|
|
|
58
58
|
# map utilities. The configured utility class (through Decidim.maps) is
|
|
59
59
|
# should be under these namespaces.
|
|
60
60
|
#
|
|
61
|
-
# @return [Hash
|
|
61
|
+
# @return [Hash{Symbol => Module}] The modules within which the utility
|
|
62
62
|
# classes should be defined in.
|
|
63
63
|
def self.utility_modules
|
|
64
64
|
@utility_modules ||= {}
|
data/lib/decidim/menu.rb
CHANGED
data/lib/decidim/menu_item.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Decidim
|
|
|
11
11
|
# registers a MenuItem DSL block for the menu.
|
|
12
12
|
#
|
|
13
13
|
# @param name [Symbol] Name of the menu
|
|
14
|
-
# @param
|
|
14
|
+
# @param block [Menu] Registration body of the menu. It is stored to be
|
|
15
15
|
# evaluated at rendering time
|
|
16
16
|
#
|
|
17
17
|
def register(name, &block)
|
|
@@ -111,7 +111,7 @@ module Decidim
|
|
|
111
111
|
private
|
|
112
112
|
|
|
113
113
|
def affected_users
|
|
114
|
-
@affected_users ||= (@reportable.try(:authors) || [@reportable.try(:author)]).
|
|
114
|
+
@affected_users ||= (@reportable.try(:authors) || [@reportable.try(:author)]).grep(Decidim::User)
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
def report_reasons
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Decidim
|
|
4
|
-
class NewsletterEncryptor
|
|
4
|
+
class NewsletterEncryptor < AttributeEncryptor
|
|
5
5
|
# Method to create string encrypt using sent_at time to unsubscribe's user
|
|
6
6
|
def self.sent_at_encrypted(user_id, sent_at)
|
|
7
|
-
|
|
7
|
+
cryptor.encrypt("#{user_id}-#{sent_at.to_i}")
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
# Method to decrypt sent_at newsletter.
|
|
11
11
|
def self.sent_at_decrypted(string_encrypted)
|
|
12
|
-
|
|
12
|
+
cryptor.decrypt(string_encrypted)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.
|
|
16
|
-
|
|
17
|
-
Rails.application.secret_key_base, ActiveSupport::MessageEncryptor.key_len
|
|
18
|
-
)
|
|
19
|
-
ActiveSupport::MessageEncryptor.new(key)
|
|
15
|
+
def self.cryptor
|
|
16
|
+
@cryptor ||= new(secret: "sent_at")
|
|
20
17
|
end
|
|
21
18
|
end
|
|
22
19
|
end
|
|
@@ -48,7 +48,7 @@ module Decidim
|
|
|
48
48
|
# Note: this cannot fetch the default settings from the class instance
|
|
49
49
|
# variable "defaults" because that would cause an infinite loop.
|
|
50
50
|
#
|
|
51
|
-
# @param
|
|
51
|
+
# @param chain [Array<Symbol, String>] The configuration key(s) to dig into
|
|
52
52
|
# inside the default configurations hash.
|
|
53
53
|
# @return The value found from the default configurations hash.
|
|
54
54
|
def default(*chain)
|
|
@@ -203,7 +203,7 @@ module Decidim
|
|
|
203
203
|
# Turns the stars into wildcard regular expression matches in the matching
|
|
204
204
|
# strings.
|
|
205
205
|
#
|
|
206
|
-
# @param [Array<String>] An array of glob strings to match against.
|
|
206
|
+
# @param types [Array<String>] An array of glob strings to match against.
|
|
207
207
|
# @return [Array<Regexp>] An array of regular expressions to match against.
|
|
208
208
|
def content_type_array(types)
|
|
209
209
|
types.map do |match_string|
|