decidim-core 0.31.4 → 0.32.0.rc1
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_cell.rb +1 -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/how_to_participate/show.erb +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/data_consent/category.erb +1 -1
- data/app/cells/decidim/{participatory_space_private_user_cell.rb → member_cell.rb} +1 -1
- 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/tags_cell.rb +1 -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 +3 -3
- data/app/commands/decidim/search.rb +5 -5
- data/app/controllers/concerns/decidim/ajax_permission_handler.rb +1 -1
- 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 +1 -1
- 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/open_data_controller.rb +1 -1
- 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/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/menu_helper.rb +3 -3
- data/app/helpers/decidim/meta_tags_helper.rb +0 -2
- 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/mailers/decidim/application_mailer.rb +7 -2
- data/app/mailers/decidim/decidim_devise_mailer.rb +1 -0
- data/app/mailers/decidim/reported_mailer.rb +4 -1
- data/app/models/decidim/action_log.rb +1 -1
- 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/newsletter.rb +2 -2
- data/app/models/decidim/participatory_space/member.rb +55 -0
- data/app/models/decidim/resource_link.rb +1 -1
- data/app/models/decidim/short_link.rb +1 -1
- 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/main_menu/controller.js +115 -0
- data/app/packs/src/decidim/controllers/main_menu/main_menu.test.js +185 -0
- data/app/packs/src/decidim/datepicker/generate_datepicker.js +1 -13
- data/app/packs/src/decidim/editor/common/suggestion.js +1 -1
- data/app/packs/src/decidim/editor/extensions/decidim_kit/index.js +4 -1
- data/app/packs/src/decidim/editor/extensions/image/index.js +8 -5
- data/app/packs/src/decidim/editor/extensions/link/index.js +8 -0
- 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/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/index.js +0 -1
- data/app/packs/stylesheets/decidim/_cards.scss +2 -1
- data/app/packs/stylesheets/decidim/_datepicker.scss +0 -8
- data/app/packs/stylesheets/decidim/_dropdown.scss +21 -31
- data/app/packs/stylesheets/decidim/_footer.scss +0 -36
- data/app/packs/stylesheets/decidim/_forms.scss +5 -1
- data/app/packs/stylesheets/decidim/_header.scss +148 -46
- data/app/packs/stylesheets/decidim/_language_chooser.scss +79 -0
- data/app/packs/stylesheets/decidim/application.scss +1 -0
- 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/log/user_presenter.rb +1 -0
- data/app/presenters/decidim/log/value_types/access_mode_presenter.rb +45 -0
- data/app/presenters/decidim/participatory_space/member_presenter.rb +48 -0
- data/app/presenters/decidim/resource_locator_presenter.rb +22 -3
- data/app/queries/decidim/last_activity.rb +1 -1
- 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/uploaders/decidim/organization_favicon_uploader.rb +4 -9
- data/app/validators/uploader_image_dimensions_validator.rb +13 -11
- data/app/views/decidim/homepage/show.html.erb +1 -1
- 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/new.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/show.html.erb +2 -2
- data/app/views/decidim/participatory_space/members/_member.html.erb +1 -0
- data/app/views/decidim/shared/_results_per_page.html.erb +1 -1
- data/app/views/decidim/shared/filters/_check_boxes_tree.html.erb +1 -1
- data/app/views/decidim/shared/filters/_dropdown_label.html.erb +4 -3
- 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 +1 -1
- data/app/views/layouts/decidim/footer/_focus_mode_main.html.erb +0 -1
- data/app/views/layouts/decidim/footer/_main.html.erb +0 -1
- 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 +13 -12
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile.html.erb +28 -0
- data/config/initializers/invisible_captcha.rb +1 -0
- data/config/locales/ar.yml +4 -12
- data/config/locales/bg.yml +6 -14
- data/config/locales/bs-BA.yml +0 -1
- data/config/locales/ca-IT.yml +36 -23
- data/config/locales/ca.yml +36 -23
- data/config/locales/cs.yml +25 -23
- data/config/locales/da.yml +0 -1
- data/config/locales/de.yml +16 -22
- data/config/locales/el.yml +4 -9
- data/config/locales/en.yml +33 -19
- data/config/locales/eo.yml +0 -1
- data/config/locales/es-MX.yml +36 -23
- data/config/locales/es-PY.yml +36 -23
- data/config/locales/es.yml +36 -23
- data/config/locales/et.yml +0 -1
- data/config/locales/eu.yml +36 -23
- data/config/locales/fa-IR.yml +0 -1
- data/config/locales/fi-plain.yml +31 -23
- data/config/locales/fi.yml +31 -23
- data/config/locales/fr-CA.yml +36 -23
- data/config/locales/fr.yml +36 -23
- data/config/locales/ga-IE.yml +3 -2
- data/config/locales/gl.yml +4 -9
- data/config/locales/gn-PY.yml +0 -1
- data/config/locales/hr.yml +0 -1
- data/config/locales/hu.yml +4 -12
- data/config/locales/id-ID.yml +4 -9
- data/config/locales/is-IS.yml +1 -2
- data/config/locales/it.yml +4 -12
- data/config/locales/ja.yml +21 -23
- data/config/locales/ka-GE.yml +0 -1
- data/config/locales/kaa.yml +0 -1
- data/config/locales/ko.yml +0 -1
- data/config/locales/lb.yml +4 -10
- data/config/locales/lt.yml +4 -12
- data/config/locales/lv.yml +4 -9
- data/config/locales/mt.yml +0 -1
- data/config/locales/nl.yml +4 -10
- data/config/locales/no.yml +4 -10
- data/config/locales/oc-FR.yml +0 -1
- data/config/locales/pl.yml +6 -14
- data/config/locales/pt-BR.yml +20 -23
- data/config/locales/pt.yml +4 -10
- data/config/locales/ro-RO.yml +11 -20
- data/config/locales/ru.yml +0 -7
- data/config/locales/sk.yml +4 -9
- data/config/locales/sl.yml +0 -1
- data/config/locales/sr-CS.yml +0 -1
- data/config/locales/sv.yml +36 -23
- data/config/locales/tr-TR.yml +4 -10
- data/config/locales/uk.yml +0 -4
- data/config/locales/vi.yml +0 -1
- data/config/locales/zh-CN.yml +4 -9
- data/config/locales/zh-TW.yml +4 -10
- data/config/routes.rb +138 -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/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 +25 -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 +0 -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 +3 -0
- 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 +1 -0
- data/lib/decidim/content_processor.rb +1 -1
- data/lib/decidim/core/api.rb +8 -0
- data/lib/decidim/core/content_blocks/registry_manager.rb +0 -6
- data/lib/decidim/core/engine.rb +2 -34
- data/lib/decidim/core/menu.rb +0 -26
- data/lib/decidim/core/test/factories.rb +29 -18
- data/lib/decidim/core/test/shared_examples/access_mode_restricted_participatory_spaces.rb +172 -0
- data/lib/decidim/core/test/shared_examples/access_mode_transparent_participatory_spaces.rb +241 -0
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +115 -111
- 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/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/resource_liked_event_examples.rb +1 -1
- 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/{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/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/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/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 +4 -0
- data/lib/devise/models/decidim_newsletterable.rb +1 -1
- 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 +206 -130
- 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/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/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/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
- /data/app/cells/decidim/{participatory_space_private_user → member}/show.erb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: caaaf7bbddd64f7bb5d4341c6ebeab59b35dd0f69326b136d11958165e513801
|
|
4
|
+
data.tar.gz: e18600f3eec00c3fbf76b58e90a34bf4888a114f7dc5a9d35896540d30a7a20f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 847ec9bd0ae30f358fd5330e3bf61cd34adedca669986b5082e391473e3f66df4e7eab20bac8ad4478827fd66b2d3e94e46559ef4138cf289d5a71caf60e904b
|
|
7
|
+
data.tar.gz: b832cfbd8827d809a1792ff0f7a6688f2282e3f2bfc8975bf821175465333ade87ef0e2fd92bf9ac3512f54e40d31872d2f35a28424b8549de717e2f645141b3
|
data/README.md
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# decidim-core
|
|
2
2
|
|
|
3
3
|
Core functionality in Decidim. Every single decidim functionality depends on this gem.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This module will be using indirectly on any decidim application.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```ruby
|
|
14
|
-
gem 'decidim'
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
And then execute:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
bundle
|
|
21
|
-
```
|
|
11
|
+
This is on the default Decidim installation so you should not change anything to use this feature.
|
|
22
12
|
|
|
23
13
|
## Users
|
|
24
14
|
|
|
@@ -7,7 +7,7 @@ module Decidim
|
|
|
7
7
|
def show
|
|
8
8
|
return unless amendments_enabled? && model.amendable?
|
|
9
9
|
return unless current_component.current_settings.amendment_creation_enabled
|
|
10
|
-
return unless
|
|
10
|
+
return unless can_participate_in_restricted_space?
|
|
11
11
|
|
|
12
12
|
render
|
|
13
13
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module ContentBlocks
|
|
5
|
+
class AnnouncementSettingsFormCell < Decidim::ViewModel
|
|
6
|
+
alias form model
|
|
7
|
+
|
|
8
|
+
def content_block
|
|
9
|
+
options[:content_block]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def label
|
|
13
|
+
I18n.t("decidim.content_blocks.announcement.body")
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
|
-
<%= link_to decidim.pages_path, class: "button button__sm md:button__lg button__secondary mt-6" do %>
|
|
40
|
+
<%= link_to decidim.pages_path(), class: "button button__sm md:button__lg button__secondary mt-6" do %>
|
|
41
41
|
<%= t("more_info", scope: "decidim.pages.home.extended", resource_name: current_organization_name) %>
|
|
42
42
|
<%= icon "arrow-right-line", class: "fill-current" %>
|
|
43
43
|
<% end %>
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module ContentBlocks
|
|
5
5
|
class ParticipatorySpaceAnnouncementCell < BaseCell
|
|
6
|
-
delegate :announcement, to: :resource
|
|
7
|
-
|
|
8
6
|
def show
|
|
9
7
|
return if announcement_cell.blank_content?
|
|
10
8
|
|
|
@@ -12,7 +10,7 @@ module Decidim
|
|
|
12
10
|
end
|
|
13
11
|
|
|
14
12
|
def announcement_cell
|
|
15
|
-
@announcement_cell ||= cell("decidim/announcement", announcement)
|
|
13
|
+
@announcement_cell ||= cell("decidim/announcement", model.settings.announcement)
|
|
16
14
|
end
|
|
17
15
|
end
|
|
18
16
|
end
|
|
@@ -27,12 +27,8 @@ module Decidim
|
|
|
27
27
|
decidim_escape_translated(resource.subtitle)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
# If it is called from the landing page content block, use the background image defined there
|
|
31
|
-
# Else, use the banner image defined in the space (for assemblies)
|
|
32
30
|
def image_path
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
attached_uploader(:banner_image).url
|
|
31
|
+
model.images_container.attached_uploader(:background_image).url
|
|
36
32
|
end
|
|
37
33
|
|
|
38
34
|
def has_cta?
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<%= icon "close-line", class: "cookies__category-toggle-icon" %>
|
|
14
14
|
</label>
|
|
15
15
|
|
|
16
|
-
<div id="accordion-trigger-<%= category[:slug] %>" data-controls="accordion-panel-<%= category[:slug] %>" aria-labelledby="accordion-title-<%= category[:slug] %>">
|
|
16
|
+
<div id="accordion-trigger-<%= category[:slug] %>" role="group" data-controls="accordion-panel-<%= category[:slug] %>" aria-labelledby="accordion-title-<%= category[:slug] %>">
|
|
17
17
|
<h3 id="accordion-title-<%= category[:slug] %>" class="cookies__category-trigger-title">
|
|
18
18
|
<%= category[:title] %>
|
|
19
19
|
</h3>
|
|
@@ -7,6 +7,7 @@ module Decidim
|
|
|
7
7
|
include Decidim::AriaSelectedLinkToHelper
|
|
8
8
|
include Decidim::ViewHooksHelper
|
|
9
9
|
include ActiveLinkTo
|
|
10
|
+
include Decidim::ActiveLinkToHelper
|
|
10
11
|
|
|
11
12
|
delegate :current_organization, :current_user, to: :controller
|
|
12
13
|
delegate :avatar_url, :nickname, :personal_url, :followers_count, :users_followings, :officialized_as, to: :presented_profile
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="profile__description">
|
|
2
|
+
<div class="font-semibold"><%= t("member_of", scope: "decidim.participatory_space.pages.user_profile.member_of") %></div>
|
|
3
|
+
<% shown = false %>
|
|
4
|
+
<% sorted_types.each do |type| %>
|
|
5
|
+
<% spaces = grouped_members[type].map(&:participatory_space).sort_by { |s| translated_attribute(s.title) } %>
|
|
6
|
+
<% spaces.each do |space| %>
|
|
7
|
+
<%= " · ".html_safe if shown %>
|
|
8
|
+
<% path = Decidim::EngineRouter.main_proxy(space).public_send("#{type.demodulize.underscore}_path", space) %>
|
|
9
|
+
<%= link_to decidim_escape_translated(space.title), path, class: "hover:underline" %>
|
|
10
|
+
<% shown = true %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
class ProfileMemberOfCell < Decidim::ViewModel
|
|
5
|
+
include Decidim::Core::Engine.routes.url_helpers
|
|
6
|
+
|
|
7
|
+
def members
|
|
8
|
+
@members ||= Decidim::ParticipatorySpace::Member.where(user:)
|
|
9
|
+
.includes(:participatory_space)
|
|
10
|
+
.published
|
|
11
|
+
.select { |m| m.participatory_space.present? && m.participatory_space.published? }
|
|
12
|
+
.sort_by { |m| translated_attribute(m.participatory_space.title) }
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def show
|
|
16
|
+
return unless members.any?
|
|
17
|
+
|
|
18
|
+
render
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def user
|
|
24
|
+
model
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def grouped_members
|
|
28
|
+
@grouped_members ||= members.group_by(&:participatory_space_type)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def sorted_types
|
|
32
|
+
@sorted_types ||= grouped_members.keys.sort_by { |k| k.split("::").last.downcase }
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -25,7 +25,7 @@ module Decidim
|
|
|
25
25
|
@taxonomies ||= model.taxonomies.map do |taxonomy|
|
|
26
26
|
{
|
|
27
27
|
name: decidim_sanitize_translated(taxonomy.name),
|
|
28
|
-
url: resource_locator(model).index(filter: { "with_any_taxonomies
|
|
28
|
+
url: resource_locator(model).index(filter: { "with_any_taxonomies" => { taxonomy.root_taxonomy.id => [taxonomy.id.to_s] } })
|
|
29
29
|
}
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -1,3 +1,28 @@
|
|
|
1
1
|
<% reverse_ordered_versions.each_with_index do |version, index| %>
|
|
2
2
|
<%= cell("decidim/versions_list_item", version, index:, versioned_resource:, version_path:, i18n_scope:, total:) %>
|
|
3
3
|
<% end %>
|
|
4
|
+
|
|
5
|
+
<% if versioned_resource.class.include?(Decidim::Fingerprintable) %>
|
|
6
|
+
<% fingerprint_id = dom_id(versioned_resource, :fingerprint_dialog) %>
|
|
7
|
+
<section class="mt-4 ml-2">
|
|
8
|
+
<%= content_tag :button, t("decidim.fingerprint.check"), class: "button button__lg button__text-secondary font-normal text-sm underline", data: { dialog_open: fingerprint_id } %>
|
|
9
|
+
</section>
|
|
10
|
+
<%= decidim_modal id: fingerprint_id, class: "fingerprint-modal" do %>
|
|
11
|
+
<div data-dialog-container>
|
|
12
|
+
<%= icon "fingerprint-line" %>
|
|
13
|
+
<h2 id="dialog-title-<%= fingerprint_id %>" tabindex="-1" data-dialog-title><%= t "decidim.fingerprint.title" %></h2>
|
|
14
|
+
<div class="fingerprint-modal__container">
|
|
15
|
+
<p id="dialog-desc-<%= fingerprint_id %>"><%= t "decidim.fingerprint.explanation" %></p>
|
|
16
|
+
<div>
|
|
17
|
+
<span class="fingerprint-modal__span"><%= t "decidim.fingerprint.value" %>:</span>
|
|
18
|
+
<code class="fingerprint-modal__code"><%= decidim_html_escape versioned_resource.fingerprint.value %></code>
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<span class="fingerprint-modal__span"><%= t "decidim.fingerprint.source" %>:</span>
|
|
22
|
+
<code class="fingerprint-modal__code"><%= decidim_html_escape versioned_resource.fingerprint.source %></code>
|
|
23
|
+
</div>
|
|
24
|
+
<p><%= t("decidim.fingerprint.replicate_help", online_calculator_link: link_to(t("decidim.fingerprint.online_calculator_name"), "https://www.md5calc.com/sha256", target: "_blank", rel: "noopener")).html_safe %></p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<% end %>
|
|
28
|
+
<% end %>
|
|
@@ -20,6 +20,7 @@ module Decidim
|
|
|
20
20
|
# Returns nothing.
|
|
21
21
|
def call
|
|
22
22
|
return broadcast(:invalid) if form.invalid?
|
|
23
|
+
return broadcast(:invalid) unless current_user.is_a?(Decidim::User)
|
|
23
24
|
|
|
24
25
|
create_follow!
|
|
25
26
|
increment_score
|
|
@@ -32,13 +33,10 @@ module Decidim
|
|
|
32
33
|
attr_reader :follow, :form
|
|
33
34
|
|
|
34
35
|
def create_follow!
|
|
35
|
-
@follow = Follow.
|
|
36
|
+
@follow = Follow.where(
|
|
36
37
|
followable: form.followable,
|
|
37
38
|
user: current_user
|
|
38
|
-
)
|
|
39
|
-
followable: form.followable,
|
|
40
|
-
user: current_user
|
|
41
|
-
)
|
|
39
|
+
).first_or_create!
|
|
42
40
|
end
|
|
43
41
|
|
|
44
42
|
def increment_score
|
|
@@ -28,7 +28,7 @@ module Decidim
|
|
|
28
28
|
destroy_user_badges
|
|
29
29
|
destroy_user_likes
|
|
30
30
|
destroy_user_reports
|
|
31
|
-
|
|
31
|
+
destroy_member
|
|
32
32
|
delegate_destroy_to_participatory_spaces
|
|
33
33
|
end
|
|
34
34
|
|
|
@@ -101,8 +101,8 @@ module Decidim
|
|
|
101
101
|
Decidim::Follow.where(user: current_user).find_each(&:destroy)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
def
|
|
105
|
-
Decidim::
|
|
104
|
+
def destroy_member
|
|
105
|
+
Decidim::ParticipatorySpace::Member.where(user: current_user).find_each(&:destroy)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def delegate_destroy_to_participatory_spaces
|
|
@@ -7,10 +7,10 @@ module Decidim
|
|
|
7
7
|
|
|
8
8
|
# Public: Initializes the command.
|
|
9
9
|
#
|
|
10
|
-
# @param term
|
|
11
|
-
# @param organization
|
|
12
|
-
# @param filters
|
|
13
|
-
# @param page_params
|
|
10
|
+
# @param term [String] - The term to search for.
|
|
11
|
+
# @param organization [Decidim::Organization] - The Organization to which the results are constrained.
|
|
12
|
+
# @param filters [Hash] - (optional) A Hash of SearchableResource attributes to filter for.
|
|
13
|
+
# @param page_params [Hash] - (optional) A Hash with `page` and `per_page` options to paginate.
|
|
14
14
|
def initialize(term, organization, filters = {}, page_params = {})
|
|
15
15
|
@term = term
|
|
16
16
|
@organization = organization
|
|
@@ -91,7 +91,7 @@ module Decidim
|
|
|
91
91
|
query = query.where(decidim_participatory_space: spaces)
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
-
query = query.order(
|
|
94
|
+
query = query.order(datetime: :desc)
|
|
95
95
|
query = query.global_search(I18n.transliterate(term)) if term.present?
|
|
96
96
|
query
|
|
97
97
|
end
|
|
@@ -15,7 +15,7 @@ module Decidim
|
|
|
15
15
|
def ajax_user_has_no_permission
|
|
16
16
|
return user_has_no_permission unless request.xhr?
|
|
17
17
|
|
|
18
|
-
render json: { message: I18n.t("actions.unauthorized", scope: "decidim.core") }, status: :
|
|
18
|
+
render json: { message: I18n.t("actions.unauthorized", scope: "decidim.core") }, status: :unprocessable_content
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -6,6 +6,7 @@ module Decidim
|
|
|
6
6
|
|
|
7
7
|
included do
|
|
8
8
|
include Decidim::NeedsOrganization
|
|
9
|
+
|
|
9
10
|
skip_before_action :verify_organization
|
|
10
11
|
|
|
11
12
|
before_action :check_organization!,
|
|
@@ -18,14 +19,14 @@ module Decidim
|
|
|
18
19
|
# We skip the validation if we are in system panel. `current_admin` refers to the main system admin user.
|
|
19
20
|
return if current_admin.present?
|
|
20
21
|
|
|
21
|
-
head :
|
|
22
|
+
head :unprocessable_content unless [
|
|
22
23
|
maximum_allowed_size.try(:to_i) >= blob_args[:byte_size].try(:to_i),
|
|
23
24
|
content_types.any? { |pattern| pattern.match?(blob_args[:content_type]) },
|
|
24
25
|
content_types.any? { |pattern| pattern.match?(MiniMime.lookup_by_extension(extension)&.content_type) },
|
|
25
26
|
allowed_extensions.any? { |pattern| pattern.match?(extension) }
|
|
26
27
|
].all?
|
|
27
28
|
rescue NoMethodError
|
|
28
|
-
head :
|
|
29
|
+
head :unprocessable_content
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
def extension
|
|
@@ -78,7 +78,7 @@ module Decidim
|
|
|
78
78
|
end
|
|
79
79
|
paths_list.prepend(
|
|
80
80
|
pending_authorizations_path,
|
|
81
|
-
decidim.page_path(terms_of_service_page)
|
|
81
|
+
decidim.page_path(terms_of_service_page, locale: current_locale)
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
paths_list.find { |el| /\A#{URI.parse(el).path}/.match?(request.path) }
|
|
@@ -38,12 +38,21 @@ module Decidim
|
|
|
38
38
|
default_unauthorized_paths + Decidim::StaticPage.where(
|
|
39
39
|
organization: current_organization,
|
|
40
40
|
allow_public_access: true
|
|
41
|
-
).pluck(
|
|
41
|
+
).pluck(
|
|
42
|
+
Arel::Nodes::Concat.new(
|
|
43
|
+
Arel::Nodes.build_quoted("/#{current_locale}/pages/"),
|
|
44
|
+
Arel::Table.new(Decidim::StaticPage.table_name)[:slug]
|
|
45
|
+
)
|
|
46
|
+
)
|
|
42
47
|
end
|
|
43
48
|
|
|
44
49
|
def default_unauthorized_paths
|
|
45
50
|
# /locale is for changing the locale and /manifest.webmanifest to request PWA manifest
|
|
46
51
|
%w(/locale /manifest.webmanifest)
|
|
47
52
|
end
|
|
53
|
+
|
|
54
|
+
def current_locale
|
|
55
|
+
@current_locale ||= I18n.locale.to_s
|
|
56
|
+
end
|
|
48
57
|
end
|
|
49
58
|
end
|
|
@@ -71,6 +71,10 @@ module Decidim
|
|
|
71
71
|
# Prevent redirect on non-HTML responses, because we want redirect AFTER impersonation.js inits a reload.
|
|
72
72
|
return if request && request.negotiate_mime([Mime[:html]]).blank?
|
|
73
73
|
return unless can_impersonate_users?
|
|
74
|
+
|
|
75
|
+
# Keep the expiration check in sync with the active impersonation log so
|
|
76
|
+
# the redirect happens in the same request when the session just expired.
|
|
77
|
+
impersonation_log&.ensure_not_expired!
|
|
74
78
|
return unless expired_log
|
|
75
79
|
|
|
76
80
|
expired_log.update!(ended_at: Time.current)
|
|
@@ -9,7 +9,7 @@ module Decidim
|
|
|
9
9
|
|
|
10
10
|
included do
|
|
11
11
|
around_action :switch_locale
|
|
12
|
-
helper_method :current_locale, :available_locales, :default_locale
|
|
12
|
+
helper_method :current_locale, :available_locales, :default_locale, :canonical_url
|
|
13
13
|
|
|
14
14
|
# Sets the locale for the current session.
|
|
15
15
|
# Saves current locale in a session variable in case some links are locale-orphaned
|
|
@@ -21,6 +21,7 @@ module Decidim
|
|
|
21
21
|
else
|
|
22
22
|
locale = default_locale
|
|
23
23
|
end
|
|
24
|
+
|
|
24
25
|
I18n.with_locale(locale, &)
|
|
25
26
|
end
|
|
26
27
|
|
|
@@ -29,7 +30,7 @@ module Decidim
|
|
|
29
30
|
#
|
|
30
31
|
# Returns a Hash.
|
|
31
32
|
def default_url_options
|
|
32
|
-
return {} if
|
|
33
|
+
return {} if locale_in_script_name?
|
|
33
34
|
|
|
34
35
|
{ locale: current_locale }
|
|
35
36
|
end
|
|
@@ -99,6 +100,55 @@ module Decidim
|
|
|
99
100
|
end
|
|
100
101
|
lang == "*" ? nil : lang
|
|
101
102
|
end
|
|
103
|
+
|
|
104
|
+
def canonical_url(desired_url, target_locale = default_locale)
|
|
105
|
+
uri = URI(desired_url)
|
|
106
|
+
desired_locale = available_locales.include?(target_locale) ? target_locale : default_locale
|
|
107
|
+
|
|
108
|
+
path_segments = uri.path.split("/").compact_blank
|
|
109
|
+
locale_segment = path_segments.first
|
|
110
|
+
|
|
111
|
+
query = uri.query.to_s.gsub(/locale=[a-zA-Z-]{2,5}/, "")
|
|
112
|
+
|
|
113
|
+
if available_locales.include?(locale_segment)
|
|
114
|
+
path_segments[0] = desired_locale
|
|
115
|
+
|
|
116
|
+
uri.path = "/#{path_segments.join("/")}"
|
|
117
|
+
|
|
118
|
+
if query.present?
|
|
119
|
+
params = URI.decode_www_form(query)
|
|
120
|
+
uri.query = URI.encode_www_form(params)
|
|
121
|
+
else
|
|
122
|
+
uri.query = nil
|
|
123
|
+
end
|
|
124
|
+
elsif uri.host.blank? || uri.host == request.host
|
|
125
|
+
uri.path = if uri.path == "/"
|
|
126
|
+
"/#{desired_locale}"
|
|
127
|
+
else
|
|
128
|
+
"/#{desired_locale}#{uri.path}"
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if query.present?
|
|
132
|
+
params = URI.decode_www_form(query)
|
|
133
|
+
uri.query = URI.encode_www_form(params)
|
|
134
|
+
else
|
|
135
|
+
uri.query = nil
|
|
136
|
+
end
|
|
137
|
+
else
|
|
138
|
+
params = URI.decode_www_form(query) << ["locale", desired_locale]
|
|
139
|
+
uri.query = URI.encode_www_form(params)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
uri.to_s
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def locale_in_script_name?
|
|
146
|
+
script_name = request&.script_name.to_s
|
|
147
|
+
return false if script_name.blank?
|
|
148
|
+
|
|
149
|
+
locale_segment = script_name.split("/").compact_blank.first
|
|
150
|
+
available_locales.include?(locale_segment)
|
|
151
|
+
end
|
|
102
152
|
# rubocop: enable Metrics/CyclomaticComplexity
|
|
103
153
|
# rubocop: enable Metrics/PerceivedComplexity
|
|
104
154
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "active_support/concern"
|
|
4
|
+
|
|
5
|
+
module Decidim
|
|
6
|
+
module ParticipatorySpace
|
|
7
|
+
module HasMembersPage
|
|
8
|
+
extend ActiveSupport::Concern
|
|
9
|
+
|
|
10
|
+
included do
|
|
11
|
+
helper_method :collection
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def can_visit_index?
|
|
16
|
+
current_user_can_visit_space? && current_participatory_space.members_public_page?
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def members
|
|
20
|
+
@members ||= current_participatory_space.members.published
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
alias_method :collection, :members
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -36,8 +36,6 @@ module Decidim
|
|
|
36
36
|
# title of the space (mandatory).
|
|
37
37
|
# * url - The url of the resource (optional).
|
|
38
38
|
# * active - Whether the item is active (optional).
|
|
39
|
-
# * dropdown_cell - When this value is present is used to generate a dropdown
|
|
40
|
-
# associated to the item (optional).
|
|
41
39
|
# * resource - The resource of the item. This value is passed to the
|
|
42
40
|
# dropdown cell, so it is mandatory if the dropdown cell is
|
|
43
41
|
# present.
|
|
@@ -48,7 +46,6 @@ module Decidim
|
|
|
48
46
|
label: current_participatory_space.title,
|
|
49
47
|
url: Decidim::ResourceLocatorPresenter.new(current_participatory_space).path,
|
|
50
48
|
active: true,
|
|
51
|
-
dropdown_cell: current_participatory_space_manifest.breadcrumb_cell,
|
|
52
49
|
resource: current_participatory_space
|
|
53
50
|
}
|
|
54
51
|
end
|
|
@@ -79,8 +76,7 @@ module Decidim
|
|
|
79
76
|
|
|
80
77
|
# Method for current user can visit the space (assembly or process)
|
|
81
78
|
def current_user_can_visit_space?
|
|
82
|
-
return true unless current_participatory_space.
|
|
83
|
-
!current_participatory_space.try(:is_transparent?)
|
|
79
|
+
return true unless current_participatory_space.respond_to?(:restricted?) && current_participatory_space.restricted?
|
|
84
80
|
return false unless current_user
|
|
85
81
|
return true if current_user.admin?
|
|
86
82
|
return true if user_has_any_role?(current_user, current_participatory_space, broad_check: true)
|
|
@@ -31,7 +31,7 @@ module Decidim
|
|
|
31
31
|
on(:invalid) do |password|
|
|
32
32
|
fetch_entered_password(password)
|
|
33
33
|
flash[:alert] = t("account.update.error", scope: "decidim")
|
|
34
|
-
render action: :show, status: :
|
|
34
|
+
render action: :show, status: :unprocessable_content
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
include Decidim::ApplicationHelper
|
|
6
6
|
include FormFactory
|
|
7
7
|
include HasSpecificBreadcrumb
|
|
8
|
+
|
|
8
9
|
helper Decidim::ResourceReferenceHelper
|
|
9
10
|
|
|
10
11
|
before_action :authenticate_user!
|
|
@@ -38,7 +39,7 @@ module Decidim
|
|
|
38
39
|
|
|
39
40
|
on(:invalid) do
|
|
40
41
|
flash.now[:alert] = t("created.error", scope: "decidim.amendments")
|
|
41
|
-
render :new, status: :
|
|
42
|
+
render :new, status: :unprocessable_content
|
|
42
43
|
end
|
|
43
44
|
end
|
|
44
45
|
end
|
|
@@ -62,7 +63,7 @@ module Decidim
|
|
|
62
63
|
|
|
63
64
|
on(:invalid) do
|
|
64
65
|
flash.now[:alert] = t("error", scope: "decidim.amendments.update_draft")
|
|
65
|
-
render :edit_draft, status: :
|
|
66
|
+
render :edit_draft, status: :unprocessable_content
|
|
66
67
|
end
|
|
67
68
|
end
|
|
68
69
|
end
|
|
@@ -100,7 +101,7 @@ module Decidim
|
|
|
100
101
|
|
|
101
102
|
on(:invalid) do
|
|
102
103
|
flash.now[:alert] = t("error", scope: "decidim.amendments.publish_draft")
|
|
103
|
-
render :edit_draft, status: :
|
|
104
|
+
render :edit_draft, status: :unprocessable_content
|
|
104
105
|
end
|
|
105
106
|
end
|
|
106
107
|
end
|
|
@@ -160,7 +161,7 @@ module Decidim
|
|
|
160
161
|
|
|
161
162
|
on(:invalid) do
|
|
162
163
|
flash.now[:alert] = t("accepted.error", scope: "decidim.amendments")
|
|
163
|
-
render :review, status: :
|
|
164
|
+
render :review, status: :unprocessable_content
|
|
164
165
|
end
|
|
165
166
|
end
|
|
166
167
|
end
|