decidim-core 0.29.6 → 0.30.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/app/cells/decidim/activity/show.erb +6 -6
- data/app/cells/decidim/address/show.erb +3 -3
- data/app/cells/decidim/amendable/amend_button_card/show.erb +6 -4
- data/app/cells/decidim/amendable/amend_button_card_cell.rb +8 -0
- data/app/cells/decidim/amendable/amendments/show.erb +1 -1
- data/app/cells/decidim/amendable/promote_button_card/show.erb +2 -0
- data/app/cells/decidim/author/flag.erb +6 -0
- data/app/cells/decidim/author/flag_user.erb +14 -0
- data/app/cells/decidim/author/show.erb +2 -6
- data/app/cells/decidim/author_cell.rb +1 -11
- data/app/cells/decidim/card_l/extra_data.erb +1 -0
- data/app/cells/decidim/card_metadata_cell.rb +9 -16
- data/app/cells/decidim/comments_button_cell.rb +14 -2
- data/app/cells/decidim/content_blocks/highlighted_elements_cell.rb +2 -0
- data/app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/participatory_space_extra_data/extra_data.erb +2 -2
- data/app/cells/decidim/content_blocks/participatory_space_main_data/title.erb +2 -11
- data/app/cells/decidim/endorsement_block/show.erb +0 -1
- data/app/cells/decidim/endorsement_block_cell.rb +6 -0
- data/app/cells/decidim/endorsement_buttons/button_content.erb +1 -1
- data/app/cells/decidim/endorsement_buttons/select_identity_button.erb +1 -1
- data/app/cells/decidim/endorsement_buttons/show.erb +7 -7
- data/app/cells/decidim/endorsement_buttons/verification_modal.erb +4 -2
- data/app/cells/decidim/endorsers_list/empty.erb +3 -0
- data/app/cells/decidim/endorsers_list/full.erb +17 -5
- data/app/cells/decidim/endorsers_list/show.erb +19 -10
- data/app/cells/decidim/endorsers_list_cell.rb +19 -6
- data/app/cells/decidim/flag_modal/flag_user.erb +34 -0
- data/app/cells/decidim/flag_modal/show.erb +52 -0
- data/app/cells/decidim/flag_modal_cell.rb +56 -0
- data/app/cells/decidim/follow_button/show.erb +1 -2
- data/app/cells/decidim/follow_button_cell.rb +5 -0
- data/app/cells/decidim/footer_topics/show.erb +2 -2
- data/app/cells/decidim/group_admins/show.erb +1 -3
- data/app/cells/decidim/group_members/show.erb +2 -6
- data/app/cells/decidim/images_panel/show.erb +2 -5
- data/app/cells/decidim/map/show.erb +3 -0
- data/app/cells/decidim/map/template.erb +14 -0
- data/app/cells/decidim/map_cell.rb +39 -0
- data/app/cells/decidim/notification_actions/buttons_cell.rb +1 -1
- data/app/cells/decidim/onboarding_action_message/show.erb +15 -0
- data/app/cells/decidim/onboarding_action_message_cell.rb +81 -0
- data/app/cells/decidim/participatory_space_dropdown_metadata/metadata.erb +4 -4
- data/app/cells/decidim/participatory_space_dropdown_metadata/show.erb +3 -5
- data/app/cells/decidim/participatory_space_private_user/show.erb +23 -0
- data/app/cells/decidim/participatory_space_private_user_cell.rb +21 -0
- data/app/cells/decidim/profile/avatar.erb +2 -0
- data/app/cells/decidim/profile/badge.erb +3 -3
- data/app/cells/decidim/profile/details.erb +1 -2
- data/app/cells/decidim/profile_actions/show.erb +1 -1
- data/app/cells/decidim/profile_sidebar/show.erb +167 -0
- data/app/cells/decidim/profile_sidebar_cell.rb +68 -0
- data/app/cells/decidim/progress_bar/show.erb +2 -2
- data/app/cells/decidim/report_button/already_reported_modal.erb +2 -2
- data/app/cells/decidim/report_button/flag_modal.erb +36 -24
- data/app/cells/decidim/report_button_cell.rb +9 -2
- data/app/cells/decidim/resource_history/show.erb +20 -0
- data/app/cells/decidim/resource_history_cell.rb +66 -0
- data/app/cells/decidim/resource_types_filter/show.erb +1 -1
- data/app/cells/decidim/resource_types_filter_cell.rb +6 -6
- data/app/cells/decidim/share_button_cell.rb +0 -4
- data/app/cells/decidim/share_widget/modal.erb +26 -0
- data/app/cells/decidim/share_widget/show.erb +2 -0
- data/app/cells/decidim/share_widget_cell.rb +20 -0
- data/app/cells/decidim/tags/show.erb +7 -4
- data/app/cells/decidim/tags_cell.rb +11 -72
- data/app/cells/decidim/upload_modal/files.erb +4 -4
- data/app/cells/decidim/upload_modal_cell.rb +3 -5
- data/app/cells/decidim/user_activity/show.erb +1 -1
- data/app/cells/decidim/user_activity_cell.rb +1 -6
- data/app/commands/decidim/amendable/accept.rb +1 -2
- data/app/commands/decidim/amendable/create_draft.rb +2 -2
- data/app/commands/decidim/create_ephemeral_user.rb +52 -0
- data/app/commands/decidim/create_omniauth_registration.rb +21 -17
- data/app/commands/decidim/create_report.rb +8 -11
- data/app/commands/decidim/create_user_group.rb +6 -2
- data/app/commands/decidim/destroy_ephemeral_user.rb +47 -0
- data/app/commands/decidim/invite_user.rb +1 -1
- data/app/commands/decidim/search.rb +0 -14
- data/app/commands/decidim/update_account.rb +11 -3
- data/app/commands/decidim/update_notifications_settings.rb +1 -0
- data/app/commands/decidim/update_resources_taxonomies.rb +67 -0
- data/app/commands/decidim/update_user_group.rb +7 -1
- data/app/constraints/decidim/current_component.rb +1 -1
- data/app/controllers/concerns/decidim/ajax_permission_handler.rb +21 -0
- data/app/controllers/concerns/decidim/devise_authentication_methods.rb +3 -6
- data/app/controllers/concerns/decidim/devise_controllers.rb +2 -0
- data/app/controllers/concerns/decidim/disable_redirection_to_external_host.rb +1 -1
- data/app/controllers/concerns/decidim/ephemeral_session_checker.rb +87 -0
- data/app/controllers/concerns/decidim/filter_resource.rb +4 -2
- data/app/controllers/concerns/decidim/has_members_page.rb +25 -0
- data/app/controllers/concerns/decidim/locale_switcher.rb +2 -2
- data/app/controllers/concerns/decidim/needs_password_change.rb +0 -1
- data/app/controllers/concerns/decidim/needs_permission.rb +2 -1
- data/app/controllers/concerns/decidim/needs_tos_accepted.rb +4 -5
- data/app/controllers/concerns/decidim/onboarding_action_methods.rb +52 -0
- data/app/controllers/concerns/decidim/participatory_space_context.rb +1 -4
- data/app/controllers/decidim/amendments_controller.rb +3 -3
- data/app/controllers/decidim/application_controller.rb +9 -0
- data/app/controllers/decidim/authorization_modals_controller.rb +8 -2
- data/app/controllers/decidim/components/base_controller.rb +3 -7
- data/app/controllers/decidim/devise/confirmations_controller.rb +4 -0
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +8 -1
- data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/sessions_controller.rb +2 -0
- data/app/controllers/decidim/download_your_data_controller.rb +33 -2
- data/app/controllers/decidim/editor_images_controller.rb +1 -11
- data/app/controllers/decidim/follows_controller.rb +1 -1
- data/app/controllers/decidim/geolocation_controller.rb +19 -0
- data/app/controllers/decidim/homepage_controller.rb +0 -1
- data/app/controllers/decidim/open_data_controller.rb +33 -8
- data/app/controllers/decidim/profiles_controller.rb +2 -2
- data/app/controllers/decidim/reports_controller.rb +2 -7
- data/app/controllers/decidim/user_activities_controller.rb +1 -1
- data/app/controllers/decidim/user_conversations_controller.rb +1 -11
- data/app/events/decidim/soft_delete_resource_event.rb +15 -0
- data/app/forms/decidim/account_form.rb +2 -5
- data/app/forms/decidim/amendable/form.rb +4 -2
- data/app/forms/decidim/ephemeral_user_form.rb +22 -0
- data/app/forms/decidim/notifications_settings_form.rb +1 -0
- data/app/forms/decidim/omniauth_registration_form.rb +15 -2
- data/app/forms/decidim/registration_form.rb +1 -1
- data/app/forms/decidim/user_group_form.rb +0 -2
- data/app/helpers/concerns/decidim/flash_helper_extensions.rb +17 -2
- data/app/helpers/decidim/action_authorization_helper.rb +75 -14
- data/app/helpers/decidim/amendments_helper.rb +1 -11
- data/app/helpers/decidim/application_helper.rb +6 -2
- data/app/helpers/decidim/breadcrumb_helper.rb +6 -0
- data/app/helpers/decidim/cache_helper.rb +1 -1
- data/app/helpers/decidim/check_boxes_tree_helper.rb +25 -53
- data/app/helpers/decidim/decidim_form_helper.rb +0 -44
- data/app/helpers/decidim/endorsable_helper.rb +0 -10
- data/app/helpers/decidim/filters_helper.rb +0 -25
- data/app/helpers/decidim/layout_helper.rb +6 -6
- data/app/helpers/decidim/map_helper.rb +1 -1
- data/app/helpers/decidim/menu_helper.rb +2 -2
- data/app/helpers/decidim/messaging/conversation_helper.rb +2 -3
- data/app/helpers/decidim/meta_tags_helper.rb +32 -23
- data/app/helpers/decidim/modal_helper.rb +23 -0
- data/app/helpers/decidim/omniauth_helper.rb +5 -5
- data/app/helpers/decidim/onboarding_action_helper.rb +13 -0
- data/app/helpers/decidim/orders_helper.rb +1 -2
- data/app/helpers/decidim/paginate_helper.rb +1 -1
- data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
- data/app/helpers/decidim/passwords_helper.rb +2 -2
- data/app/helpers/decidim/taxonomies_helper.rb +40 -0
- data/app/helpers/decidim/tooltip_helper.rb +1 -4
- data/app/jobs/decidim/download_your_data_export_job.rb +2 -19
- data/app/jobs/decidim/event_publisher_job.rb +18 -9
- data/app/jobs/decidim/export_job.rb +5 -1
- data/app/jobs/decidim/export_participatory_space_job.rb +4 -1
- data/app/jobs/decidim/open_data_job.rb +4 -4
- data/app/mailers/decidim/export_mailer.rb +7 -12
- data/app/mailers/decidim/notifications_digest_mailer.rb +1 -7
- data/app/mailers/decidim/reported_mailer.rb +2 -18
- data/app/models/decidim/action_log.rb +20 -1
- data/app/models/decidim/category.rb +4 -0
- data/app/models/decidim/component.rb +25 -3
- data/app/models/decidim/metric.rb +2 -1
- data/app/models/decidim/moderation.rb +16 -0
- data/app/models/decidim/newsletter.rb +12 -8
- data/app/models/decidim/organization.rb +7 -3
- data/app/models/decidim/participatory_space_private_user.rb +20 -0
- data/app/models/decidim/private_export.rb +24 -0
- data/app/models/decidim/push_notification_message.rb +1 -1
- data/app/models/decidim/report.rb +1 -1
- data/app/models/decidim/scope.rb +4 -0
- data/app/models/decidim/share_token.rb +36 -10
- data/app/models/decidim/taxonomization.rb +23 -0
- data/app/models/decidim/taxonomy.rb +139 -0
- data/app/models/decidim/taxonomy_filter.rb +130 -0
- data/app/models/decidim/taxonomy_filter_item.rb +33 -0
- data/app/models/decidim/user.rb +13 -23
- data/app/models/decidim/user_base_entity.rb +12 -4
- data/app/models/decidim/user_moderation.rb +9 -0
- data/app/models/decidim/user_report.rb +4 -0
- data/app/packs/entrypoints/decidim_core.js +1 -0
- data/app/packs/entrypoints/decidim_geocoding.js +2 -0
- data/app/packs/images/decidim/brands/facebook.svg +10 -0
- data/app/packs/images/decidim/brands/google.svg +7 -1
- data/app/packs/images/decidim/brands/twitter-x.svg +3 -0
- data/app/packs/images/decidim/default-avatar.svg +1 -1
- data/app/packs/src/decidim/callout.js +8 -13
- data/app/packs/src/decidim/check_boxes_tree.js +0 -1
- data/app/packs/src/decidim/clipboard.js +18 -9
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +3 -3
- data/app/packs/src/decidim/datepicker/generate_datepicker.js +0 -2
- data/app/packs/src/decidim/datepicker/generate_timepicker.js +0 -2
- data/app/packs/src/decidim/decidim_application.js +1 -0
- data/app/packs/src/decidim/direct_uploads/upload_field.js +4 -3
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +9 -8
- data/app/packs/src/decidim/editor/common/suggestion.js +1 -11
- data/app/packs/src/decidim/form_filter.js +0 -6
- data/app/packs/src/decidim/geocoding/reverse_geocoding.js +60 -0
- data/app/packs/src/decidim/index.js +9 -5
- data/app/packs/src/decidim/input_character_counter.js +1 -1
- data/app/packs/src/decidim/map/provider/here.js +1 -1
- data/app/packs/src/decidim/onboarding_pending_action.js +24 -0
- data/app/packs/src/decidim/sticky_footer.js +29 -0
- data/app/packs/src/decidim/sticky_header.js +6 -31
- data/app/packs/src/decidim/user_registrations.js +13 -0
- data/app/packs/src/decidim/vendor/leaflet-tilelayer-here.js +212 -0
- data/app/packs/stylesheets/decidim/_accordion.scss +30 -0
- data/app/packs/stylesheets/decidim/_activity.scss +4 -4
- data/app/packs/stylesheets/decidim/_author.scss +0 -8
- data/app/packs/stylesheets/decidim/_buttons.scss +19 -0
- data/app/packs/stylesheets/decidim/_cards.scss +1 -9
- data/app/packs/stylesheets/decidim/_content_blocks.scss +0 -4
- data/app/packs/stylesheets/decidim/_dropdown.scss +1 -1
- data/app/packs/stylesheets/decidim/_endorsers_list.scss +26 -20
- data/app/packs/stylesheets/decidim/_filters.scss +1 -1
- data/app/packs/stylesheets/decidim/_forms.scss +2 -2
- data/app/packs/stylesheets/decidim/_header.scss +39 -70
- data/app/packs/stylesheets/decidim/_layout.scss +34 -4
- data/app/packs/stylesheets/decidim/_login.scss +53 -6
- data/app/packs/stylesheets/decidim/_modal.scss +47 -1
- data/app/packs/stylesheets/decidim/_modal_tos_refuse.scss +4 -0
- data/app/packs/stylesheets/decidim/_modal_update.scss +1 -5
- data/app/packs/stylesheets/decidim/_participatory_spaces.scss +46 -0
- data/app/packs/stylesheets/decidim/_profile.scss +7 -7
- data/app/packs/stylesheets/decidim/_success_image.scss +64 -0
- data/app/packs/stylesheets/decidim/_tribute.scss +36 -0
- data/app/packs/stylesheets/decidim/application.scss +1 -1
- data/app/packs/stylesheets/decidim/editor.scss +1 -3
- data/app/packs/stylesheets/decidim/geocoding_addons.scss +5 -0
- data/app/packs/stylesheets/decidim/map.scss +7 -10
- data/app/packs/stylesheets/decidim/resource_history.scss +31 -0
- data/app/permissions/decidim/default_permissions.rb +0 -2
- data/app/permissions/decidim/permissions.rb +9 -15
- data/app/presenters/decidim/admin_log/base_user_presenter.rb +67 -0
- data/app/presenters/decidim/admin_log/component_presenter.rb +32 -3
- data/app/presenters/decidim/admin_log/moderation_presenter.rb +30 -3
- data/app/presenters/decidim/admin_log/share_token_presenter.rb +39 -0
- data/app/presenters/decidim/admin_log/taxonomy_filter_presenter.rb +57 -0
- data/app/presenters/decidim/admin_log/taxonomy_presenter.rb +48 -0
- data/app/presenters/decidim/admin_log/user_group_presenter.rb +6 -6
- data/app/presenters/decidim/admin_log/user_presenter.rb +4 -18
- data/app/presenters/decidim/log/user_presenter.rb +0 -1
- data/app/presenters/decidim/log/value_types/date_presenter.rb +1 -0
- data/app/presenters/decidim/log/value_types/taxonomy_presenter.rb +29 -0
- data/app/presenters/decidim/notification_to_mailer_presenter.rb +3 -7
- data/app/presenters/decidim/participatory_space_private_user_presenter.rb +50 -0
- data/app/presenters/decidim/taxonomy_filter_presenter.rb +19 -0
- data/app/presenters/decidim/taxonomy_presenter.rb +14 -0
- data/app/presenters/decidim/user_presenter.rb +1 -1
- data/app/queries/decidim/last_activity.rb +0 -25
- data/app/queries/decidim/metrics/blocked_users_metric_manage.rb +2 -2
- data/app/queries/decidim/metrics/users_metric_manage.rb +2 -2
- data/app/queries/decidim/public_activities.rb +1 -12
- data/app/queries/decidim/stats_users_count.rb +2 -2
- data/app/resolvers/decidim/meta_image_url_resolver.rb +128 -0
- data/app/serializers/decidim/exporters/open_data_blocked_user_serializer.rb +25 -0
- data/app/serializers/decidim/exporters/open_data_metric_serializer.rb +22 -0
- data/app/serializers/decidim/exporters/open_data_moderation_serializer.rb +30 -0
- data/app/serializers/decidim/exporters/open_data_taxonomy_serializer.rb +30 -0
- data/app/serializers/decidim/exporters/open_data_user_group_serializer.rb +38 -0
- data/app/serializers/decidim/exporters/open_data_user_serializer.rb +39 -0
- data/app/serializers/decidim/exporters/participatory_space_serializer.rb +104 -0
- data/app/serializers/decidim/exporters/serializer.rb +25 -0
- data/app/serializers/decidim/schema_org_breadcrumb_list_serializer.rb +52 -0
- data/app/services/decidim/action_authorizer.rb +32 -3
- data/app/services/decidim/base_diff_renderer.rb +1 -3
- data/app/services/decidim/download_your_data_exporter.rb +58 -24
- data/app/services/decidim/onboarding_manager.rb +272 -0
- data/app/services/decidim/open_data_exporter.rb +139 -13
- data/app/services/decidim/static_map_generator.rb +1 -1
- data/app/services/decidim/traceability.rb +13 -0
- data/app/uploaders/decidim/application_uploader.rb +1 -1
- data/app/validators/etiquette_validator.rb +9 -2
- data/app/validators/passthru_validator.rb +1 -1
- data/app/validators/password_validator.rb +1 -3
- data/app/validators/translated_etiquette_validator.rb +32 -0
- data/app/views/decidim/account/_password_fields.html.erb +2 -2
- data/app/views/decidim/application/_accordion_section.html.erb +14 -0
- data/app/views/decidim/application/_collection.html.erb +30 -18
- data/app/views/decidim/application/_document.html.erb +2 -2
- data/app/views/decidim/devise/omniauth_registrations/new.html.erb +5 -1
- data/app/views/decidim/devise/omniauth_registrations/new_tos_fields.html.erb +29 -0
- data/app/views/decidim/devise/registrations/new.html.erb +10 -22
- data/app/views/decidim/devise/sessions/new.html.erb +24 -29
- data/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +2 -4
- data/app/views/decidim/devise/shared/_tos_fields.html.erb +16 -0
- data/app/views/decidim/download_your_data/_export.html.erb +15 -0
- data/app/views/decidim/download_your_data/show.html.erb +51 -5
- data/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +16 -19
- data/app/views/decidim/errors/internal_server_error.html.erb +1 -1
- data/app/views/decidim/errors/not_found.html.erb +1 -1
- data/app/views/decidim/export_mailer/download_your_data_export.html.erb +2 -2
- data/app/views/decidim/export_mailer/export.html.erb +5 -1
- data/app/views/decidim/last_activities/index.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_reply_form.html.erb +2 -1
- data/app/views/decidim/messaging/conversations/_start.html.erb +1 -1
- data/app/views/decidim/newsletters/unsubscribe.html.erb +4 -16
- data/app/views/decidim/notifications_settings/show.html.erb +22 -0
- data/app/views/decidim/open_data/_how_to_open_accordion_section.html.erb +15 -0
- data/app/views/decidim/open_data/index.html.erb +108 -0
- data/app/views/decidim/pages/show.html.erb +2 -1
- data/app/views/decidim/participatory_space_private_users/_participatory_space_private_user.html.erb +1 -0
- data/app/views/decidim/reported_mailer/hide.html.erb +9 -0
- data/app/views/decidim/reported_mailer/report.html.erb +1 -1
- data/app/views/decidim/searches/_count.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +39 -76
- data/app/views/decidim/shared/_component_announcement.html.erb +1 -1
- data/app/views/decidim/shared/_confirm_modal.html.erb +5 -3
- data/app/views/decidim/shared/_filters.html.erb +5 -7
- data/app/views/decidim/shared/_login_modal.html.erb +26 -20
- data/app/views/decidim/shared/_orders.html.erb +2 -2
- data/app/views/decidim/shared/_resource_actions.html.erb +21 -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 -2
- data/app/views/decidim/shared/filters/_collection.html.erb +1 -1
- data/app/views/decidim/shared/filters/_dropdown_label.html.erb +7 -4
- data/app/views/kaminari/decidim/_page.html.erb +1 -1
- data/app/views/kaminari/decidim/_paginator.html.erb +1 -1
- data/app/views/layouts/decidim/_application.html.erb +1 -2
- data/app/views/layouts/decidim/_logo.html.erb +2 -2
- data/app/views/layouts/decidim/_logo_mobile.html.erb +1 -1
- data/app/views/layouts/decidim/_meta_tags_config.html.erb +6 -11
- data/app/views/layouts/decidim/_schema_org_breadcrumb_list.html.erb +3 -0
- data/app/views/layouts/decidim/_wrapper.html.erb +15 -9
- data/app/views/layouts/decidim/footer/_main.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_intro.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_legal.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_links.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_mini.html.erb +2 -2
- data/app/views/layouts/decidim/header/_close_ephemeral_session.html.erb +25 -0
- data/app/views/layouts/decidim/header/_main.html.erb +14 -10
- data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +0 -6
- data/app/views/layouts/decidim/header/_main_links_dropdown.html.erb +0 -2
- data/app/views/layouts/decidim/header/_main_links_mobile_account.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +2 -0
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_desktop.html.erb +11 -5
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +5 -5
- data/app/views/layouts/decidim/header/_mobile_language_choose.html.erb +1 -1
- data/app/views/layouts/decidim/shared/_layout_item.html.erb +1 -1
- data/config/assets.rb +2 -1
- data/config/locales/ar.yml +38 -74
- data/config/locales/bg-BG.yml +2 -2
- data/config/locales/bg.yml +38 -74
- data/config/locales/bs-BA.yml +0 -2
- data/config/locales/ca.yml +382 -138
- data/config/locales/cs.yml +379 -121
- data/config/locales/de.yml +370 -133
- data/config/locales/el.yml +26 -58
- data/config/locales/en.yml +354 -110
- data/config/locales/eo.yml +0 -4
- data/config/locales/es-MX.yml +368 -127
- data/config/locales/es-PY.yml +373 -132
- data/config/locales/es.yml +374 -130
- data/config/locales/eu.yml +491 -245
- data/config/locales/fi-plain.yml +367 -130
- data/config/locales/fi.yml +372 -132
- data/config/locales/fr-CA.yml +180 -125
- data/config/locales/fr-LU.yml +3 -3
- data/config/locales/fr.yml +180 -122
- data/config/locales/ga-IE.yml +4 -25
- data/config/locales/gl.yml +23 -58
- data/config/locales/hu.yml +35 -62
- data/config/locales/id-ID.yml +24 -57
- data/config/locales/is-IS.yml +6 -25
- data/config/locales/it.yml +39 -218
- data/config/locales/ja.yml +235 -141
- data/config/locales/lb-LU.yml +2 -2
- data/config/locales/lb.yml +31 -76
- data/config/locales/lt.yml +29 -64
- data/config/locales/lv.yml +24 -58
- data/config/locales/nl.yml +26 -75
- data/config/locales/no.yml +26 -70
- data/config/locales/pl.yml +35 -72
- data/config/locales/pt-BR.yml +44 -63
- data/config/locales/pt.yml +26 -70
- data/config/locales/ro-RO.yml +118 -183
- data/config/locales/ru.yml +16 -43
- data/config/locales/sk-SK.yml +3 -3
- data/config/locales/sk.yml +27 -72
- data/config/locales/sl.yml +0 -4
- data/config/locales/sr-CS.yml +0 -2
- data/config/locales/sv.yml +141 -133
- data/config/locales/tr-TR.yml +32 -75
- data/config/locales/uk.yml +8 -29
- data/config/locales/zh-CN.yml +24 -68
- data/config/locales/zh-TW.yml +28 -62
- data/config/routes.rb +4 -10
- data/db/migrate/20171212103803_create_unique_nicknames.rb +1 -1
- data/db/migrate/20180221101934_fix_nickname_index.rb +1 -1
- data/db/migrate/20180706104107_add_nickname_to_managed_users.rb +1 -1
- data/db/migrate/20181001124950_move_users_groups_to_users_table.rb +1 -1
- data/db/migrate/20181025082245_add_timestamps_to_components.rb +2 -0
- data/db/migrate/20190412131728_fix_user_names.rb +1 -1
- data/db/migrate/20240628111905_add_visible_to_components.rb +7 -0
- data/db/migrate/20240704115429_create_decidim_taxonomies.rb +23 -0
- data/db/migrate/20240717093514_add_registered_only_to_decidim_share_tokens.rb +7 -0
- data/db/migrate/20240722215500_change_object_changes_on_versions.rb +39 -0
- data/db/migrate/20240806065417_create_decidim_taxonomy_filters.rb +23 -0
- data/db/migrate/20240822161348_add_deleted_at_to_decidim_components.rb +8 -0
- data/db/migrate/20240906162524_add_part_of_to_taxonomies.rb +26 -0
- data/db/migrate/20241001135825_add_role_to_participatory_space_private_users.rb +7 -0
- data/db/migrate/20241001140408_add_published_to_participatory_space_private_users.rb +7 -0
- data/db/migrate/20241022002600_create_private_exports.rb +18 -0
- data/db/migrate/20241028114430_add_component_counter_to_taxonomy_filters.rb +7 -0
- data/db/migrate/20241111104357_add_names_and_space_boolean_to_taxonomy_filters.rb +9 -0
- data/db/migrate/20241127093708_add_taxonomy_to_metrics.rb +7 -0
- data/db/migrate/20241204121445_add_participatory_space_manifests_from_taxonomy_filters.rb +9 -0
- data/decidim-core.gemspec +14 -17
- data/lib/decidim/action_authorization.rb +3 -2
- data/lib/decidim/amendable.rb +1 -1
- data/lib/decidim/api/input_filters/category_input_filter.rb +5 -3
- data/lib/decidim/api/input_filters/component_input_filter.rb +33 -20
- data/lib/decidim/api/input_filters/user_entity_input_filter.rb +53 -44
- data/lib/decidim/api/input_sorts/component_input_sort.rb +15 -13
- data/lib/decidim/api/input_sorts/user_entity_input_sort.rb +4 -4
- data/lib/decidim/api/interfaces/author_interface.rb +3 -2
- data/lib/decidim/api/interfaces/coauthorable_interface.rb +5 -5
- data/lib/decidim/api/interfaces/endorsable_interface.rb +2 -2
- data/lib/decidim/api/interfaces/participatory_space_interface.rb +5 -10
- data/lib/decidim/api/interfaces/taxonomizable_interface.rb +13 -0
- data/lib/decidim/api/types/amendment_type.rb +5 -7
- data/lib/decidim/api/types/area_api_type.rb +3 -3
- data/lib/decidim/api/types/attachment_type.rb +3 -3
- data/lib/decidim/api/types/category_type.rb +2 -2
- data/lib/decidim/api/types/decidim_type.rb +5 -1
- data/lib/decidim/api/types/fingerprint_type.rb +1 -1
- data/lib/decidim/api/types/localized_string_type.rb +1 -1
- data/lib/decidim/api/types/metric_history_type.rb +2 -0
- data/lib/decidim/api/types/metric_type.rb +1 -1
- data/lib/decidim/api/types/organization_type.rb +5 -0
- data/lib/decidim/api/types/participatory_space_link_type.rb +2 -2
- data/lib/decidim/api/types/participatory_space_manifest_type.rb +1 -1
- data/lib/decidim/api/types/quantifiable_translated_field_type.rb +1 -1
- data/lib/decidim/api/types/scope_api_type.rb +2 -3
- data/lib/decidim/api/types/session_type.rb +1 -2
- data/lib/decidim/api/types/taxonomy_type.rb +15 -0
- data/lib/decidim/api/types/trace_version_type.rb +2 -2
- data/lib/decidim/api/types/translated_field_type.rb +3 -5
- data/lib/decidim/api/types/user_group_type.rb +7 -20
- data/lib/decidim/api/types/user_type.rb +7 -20
- data/lib/decidim/asset_router/storage.rb +10 -15
- data/lib/decidim/assets/tailwind/tailwind.config.js.erb +3 -3
- data/lib/decidim/attachment_attributes.rb +1 -1
- data/lib/decidim/attribute_encryptor.rb +1 -1
- data/lib/decidim/attribute_object/nested_validator.rb +1 -1
- data/lib/decidim/attributes/integer_with_units.rb +27 -0
- data/lib/decidim/attributes/time_with_zone.rb +1 -5
- data/lib/decidim/attributes.rb +2 -0
- data/lib/decidim/authorization_form_builder.rb +0 -7
- data/lib/decidim/coauthorable.rb +1 -1
- data/lib/decidim/command.rb +3 -3
- data/lib/decidim/commands/destroy_resource.rb +5 -1
- data/lib/decidim/commands/resource_handler.rb +2 -2
- data/lib/decidim/commands/restore_resource.rb +45 -0
- data/lib/decidim/commands/soft_delete_resource.rb +63 -0
- data/lib/decidim/component_manifest.rb +7 -0
- data/lib/decidim/content_parsers/blob_parser.rb +8 -10
- data/lib/decidim/content_parsers/user_parser.rb +1 -1
- data/lib/decidim/core/api.rb +2 -0
- data/lib/decidim/core/engine.rb +21 -7
- data/lib/decidim/core/menu.rb +0 -5
- data/lib/decidim/core/seeds.rb +42 -2
- data/lib/decidim/core/test/factories.rb +107 -4
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +85 -0
- data/lib/decidim/core/test/shared_examples/announcements_examples.rb +0 -4
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +393 -38
- data/lib/decidim/core/test/shared_examples/components_controller_hide_shared_examples.rb +11 -0
- data/lib/decidim/core/test/shared_examples/components_controller_reorder_shared_examples.rb +21 -0
- data/lib/decidim/core/test/shared_examples/download_open_data_shared_context.rb +36 -0
- data/lib/decidim/core/test/shared_examples/download_open_data_shared_examples.rb +45 -0
- data/lib/decidim/core/test/shared_examples/download_your_data_shared_examples.rb +17 -0
- data/lib/decidim/core/test/shared_examples/etiquette_validator_examples.rb +25 -0
- data/lib/decidim/core/test/shared_examples/follows_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/has_taxonomies.rb +94 -0
- data/lib/decidim/core/test/shared_examples/manage_share_tokens_examples.rb +237 -0
- data/lib/decidim/core/test/shared_examples/map_examples.rb +2 -0
- data/lib/decidim/core/test/shared_examples/open_data_exporter_examples.rb +102 -0
- data/lib/decidim/core/test/shared_examples/participatory_space_members_page_examples.rb +46 -0
- data/lib/decidim/core/test/shared_examples/participatory_space_search_examples.rb +98 -0
- data/lib/decidim/core/test/shared_examples/permissions.rb +7 -7
- data/lib/decidim/core/test/shared_examples/preview_with_share_token_examples.rb +94 -0
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +15 -53
- data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/resource_search_examples.rb +75 -69
- data/lib/decidim/core/test/shared_examples/searchable_resources_shared_context.rb +1 -1
- data/lib/decidim/core/test/shared_examples/simple_event.rb +33 -19
- data/lib/decidim/core/test/shared_examples/social_share_examples.rb +7 -14
- data/lib/decidim/core/test/shared_examples/softdeleteable_components_examples.rb +173 -0
- data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +54 -8
- data/lib/decidim/core/test/shared_examples/taxonomizable_interface_examples.rb +20 -0
- data/lib/decidim/core/test/shared_examples/taxonomizable_resource_examples.rb +37 -0
- data/lib/decidim/core/test/shared_examples/taxonomy_settings.rb +49 -0
- data/lib/decidim/core/test/shared_examples/translated_event_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +0 -26
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +2 -28
- data/lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb +1 -1
- data/lib/decidim/core/test.rb +9 -5
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +58 -0
- data/lib/decidim/download_your_data_serializers/download_your_data_identity_serializer.rb +0 -4
- data/lib/decidim/download_your_data_serializers/download_your_data_participatory_space_private_user_serializer.rb +3 -1
- data/lib/decidim/download_your_data_serializers/download_your_data_report_serializer.rb +2 -1
- data/lib/decidim/download_your_data_serializers/download_your_data_user_serializer.rb +6 -7
- data/lib/decidim/download_your_data_serializers.rb +19 -0
- data/lib/decidim/exporters/csv.rb +6 -0
- data/lib/decidim/exporters/export_manifest.rb +14 -0
- data/lib/decidim/exporters/pdf.rb +26 -22
- data/lib/decidim/filter_form_builder.rb +12 -15
- data/lib/decidim/form_builder.rb +7 -144
- data/lib/decidim/has_category.rb +5 -1
- data/lib/decidim/has_private_users.rb +4 -0
- data/lib/decidim/has_taxonomy_settings.rb +47 -0
- data/lib/decidim/has_upload_validations.rb +1 -1
- data/lib/decidim/legacy_form_builder.rb +118 -0
- data/lib/decidim/maintenance/import_models/application_record.rb +93 -0
- data/lib/decidim/maintenance/import_models/area.rb +82 -0
- data/lib/decidim/maintenance/import_models/area_type.rb +12 -0
- data/lib/decidim/maintenance/import_models/assembly_type.rb +49 -0
- data/lib/decidim/maintenance/import_models/categorization.rb +14 -0
- data/lib/decidim/maintenance/import_models/category.rb +107 -0
- data/lib/decidim/maintenance/import_models/participatory_process_type.rb +21 -0
- data/lib/decidim/maintenance/import_models/scope.rb +163 -0
- data/lib/decidim/maintenance/import_models.rb +19 -0
- data/lib/decidim/maintenance/taxonomy_importer.rb +132 -0
- data/lib/decidim/maintenance/taxonomy_plan.rb +78 -0
- data/lib/decidim/maintenance.rb +12 -0
- data/lib/decidim/map/autocomplete.rb +52 -8
- data/lib/decidim/map/dynamic_map.rb +1 -1
- data/lib/decidim/map/provider/dynamic_map/here.rb +40 -1
- data/lib/decidim/map/provider/geocoding/here.rb +9 -3
- data/lib/decidim/map/provider/static_map/here.rb +0 -34
- data/lib/decidim/map.rb +3 -6
- data/lib/decidim/moderation_tools.rb +16 -19
- data/lib/decidim/newsletter_encryptor.rb +1 -1
- data/lib/decidim/nicknamizable.rb +9 -6
- data/lib/decidim/paddable.rb +1 -1
- data/lib/decidim/participable.rb +10 -10
- data/lib/decidim/participatory_space_user.rb +10 -0
- data/lib/decidim/private_download_helper.rb +15 -0
- data/lib/decidim/record_encryptor.rb +51 -46
- data/lib/decidim/reportable.rb +2 -6
- data/lib/decidim/resourceable.rb +16 -0
- data/lib/decidim/seeds.rb +18 -20
- data/lib/decidim/settings_manifest.rb +34 -1
- data/lib/decidim/soft_deletable.rb +17 -0
- data/lib/decidim/taxonomizable.rb +72 -0
- data/lib/decidim/translatable_attributes.rb +1 -5
- data/lib/decidim/view_model.rb +0 -1
- data/lib/tasks/decidim_download_your_data_tasks.rake +2 -4
- data/lib/tasks/decidim_procfile.rake +6 -0
- data/lib/tasks/decidim_tasks.rake +1 -0
- data/lib/tasks/decidim_taxonomies.rake +155 -0
- data/lib/tasks/upgrade/{decidim_fix_categorization.rake → clean.rake} +25 -18
- data/lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake +1 -1
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +20 -23
- data/lib/tasks/upgrade/migrations.rake +91 -0
- metadata +201 -114
- data/app/cells/decidim/amendable/amenders_list/show.erb +0 -0
- data/app/cells/decidim/author/badge.erb +0 -6
- data/app/cells/decidim/content_blocks/base/content.erb +0 -0
- data/app/cells/decidim/endorsers_list/full_endorsers_list.erb +0 -3
- data/app/cells/decidim/endorsers_list_button/content.erb +0 -1
- data/app/cells/decidim/endorsers_list_button_cell.rb +0 -15
- data/app/cells/decidim/report_user_button/already_reported_modal.erb +0 -11
- data/app/cells/decidim/report_user_button/flag_modal.erb +0 -47
- data/app/cells/decidim/report_user_button/show.erb +0 -2
- data/app/cells/decidim/report_user_button_cell.rb +0 -59
- data/app/cells/decidim/scopes_picker/scope_picker_prompt.erb +0 -3
- data/app/cells/decidim/scopes_picker/scope_picker_values.erb +0 -5
- data/app/cells/decidim/scopes_picker/show.erb +0 -14
- data/app/cells/decidim/scopes_picker_cell.rb +0 -92
- data/app/commands/decidim/update_user_interests.rb +0 -41
- data/app/controllers/decidim/scopes_controller.rb +0 -84
- data/app/controllers/decidim/user_interests_controller.rb +0 -30
- data/app/forms/decidim/user_interest_scope_form.rb +0 -25
- data/app/forms/decidim/user_interests_form.rb +0 -17
- data/app/helpers/decidim/categories_helper.rb +0 -26
- data/app/helpers/decidim/scopes_helper.rb +0 -105
- data/app/jobs/decidim/hide_child_resources_job.rb +0 -24
- data/app/packs/images/decidim/vendor/leaflet/layers-2x.png +0 -0
- data/app/packs/images/decidim/vendor/leaflet/layers.png +0 -0
- data/app/packs/images/decidim/vendor/leaflet/marker-icon-2x.png +0 -0
- data/app/packs/images/decidim/vendor/leaflet/marker-icon.png +0 -0
- data/app/packs/images/decidim/vendor/leaflet/marker-shadow.png +0 -0
- data/app/packs/src/decidim/dropdown_menu.js +0 -18
- data/app/packs/stylesheets/decidim/_hashtags.scss +0 -5
- data/app/packs/stylesheets/decidim/legacy/MarkerCluster.Default.scss +0 -67
- data/app/packs/stylesheets/decidim/legacy/MarkerCluster.scss +0 -18
- data/app/packs/stylesheets/decidim/legacy/leaflet.scss +0 -705
- data/app/validators/scope_belongs_to_component_validator.rb +0 -16
- data/app/views/decidim/account/_user_groups.html.erb +0 -0
- data/app/views/decidim/reported_mailer/hidden_automatically.html.erb +0 -25
- data/app/views/decidim/reported_mailer/hidden_manually.html.erb +0 -25
- data/app/views/decidim/scopes/_scopes_picker_input.html.erb +0 -19
- data/app/views/decidim/scopes/picker.html.erb +0 -53
- data/app/views/decidim/shared/_comments.html.erb +0 -0
- data/app/views/decidim/shared/_share_modal.html.erb +0 -26
- data/app/views/decidim/shared/_tags.html.erb +0 -1
- data/app/views/decidim/user_interests/_areas.html.erb +0 -14
- data/app/views/decidim/user_interests/_scopes.html.erb +0 -22
- data/app/views/decidim/user_interests/show.html.erb +0 -22
- data/config/initializers/foundation_rails_helper.rb +0 -4
- data/config/locales/ca-IT.yml +0 -2146
- data/lib/decidim/core/test/shared_examples/has_category.rb +0 -38
- data/lib/decidim/core/test/shared_examples/has_scope.rb +0 -11
- data/lib/decidim/core/test/shared_examples/manage_component_share_tokens.rb +0 -83
- data/lib/decidim/core/test/shared_examples/preview_component_with_share_token_examples.rb +0 -49
- data/lib/decidim/core/test/shared_examples/scope_helper_examples.rb +0 -93
- data/lib/decidim/seven_zip_wrapper.rb +0 -29
- data/lib/tasks/upgrade/clean_hidden_resources.rake +0 -33
|
@@ -28,12 +28,16 @@ module Decidim
|
|
|
28
28
|
|
|
29
29
|
# Public: fetches the participatory space of the resource's component or from the resource itself
|
|
30
30
|
def participatory_space
|
|
31
|
-
@participatory_space ||=
|
|
31
|
+
@participatory_space ||= if reportable.class.respond_to?(:participatory_space?)
|
|
32
|
+
reportable
|
|
33
|
+
else
|
|
34
|
+
reportable.component&.participatory_space || reportable.try(:participatory_space)
|
|
35
|
+
end
|
|
32
36
|
end
|
|
33
37
|
|
|
34
38
|
# Public: updates the reported content for the moderation object associated with resource
|
|
35
39
|
def update_reported_content!
|
|
36
|
-
moderation.update!(reported_content:
|
|
40
|
+
moderation.update!(reported_content: reportable.reported_searchable_content_text)
|
|
37
41
|
end
|
|
38
42
|
|
|
39
43
|
# Public: creates a new report for the given resource, having a basic set of options
|
|
@@ -59,18 +63,16 @@ module Decidim
|
|
|
59
63
|
event_class: Decidim::ResourceHiddenEvent,
|
|
60
64
|
resource: @reportable,
|
|
61
65
|
extra: {
|
|
62
|
-
report_reasons
|
|
63
|
-
force_email: true
|
|
66
|
+
report_reasons:
|
|
64
67
|
},
|
|
65
|
-
affected_users
|
|
66
|
-
force_send: true
|
|
68
|
+
affected_users: @reportable.try(:authors) || [@reportable.try(:normalized_author)]
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
Decidim::EventsManager.publish(**data)
|
|
70
72
|
end
|
|
71
73
|
|
|
72
74
|
# Public: hides the resource
|
|
73
|
-
def
|
|
75
|
+
def hide_with_admin_log!
|
|
74
76
|
Decidim.traceability.perform_action!(
|
|
75
77
|
"hide",
|
|
76
78
|
moderation,
|
|
@@ -79,25 +81,20 @@ module Decidim
|
|
|
79
81
|
reportable_type: @reportable.class.name
|
|
80
82
|
}
|
|
81
83
|
) do
|
|
82
|
-
|
|
83
|
-
@reportable.try(:touch)
|
|
84
|
+
hide!
|
|
84
85
|
end
|
|
86
|
+
end
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
# Public: hides the resources
|
|
89
|
+
def hide!
|
|
90
|
+
Decidim.traceability.perform_action_without_log!(current_user) do
|
|
91
|
+
@reportable.moderation.update!(hidden_at: Time.current)
|
|
92
|
+
@reportable.try(:touch)
|
|
90
93
|
end
|
|
91
|
-
|
|
92
|
-
send_notification_to_author
|
|
93
94
|
end
|
|
94
95
|
|
|
95
96
|
private
|
|
96
97
|
|
|
97
|
-
def affected_users
|
|
98
|
-
@affected_users ||= (@reportable.try(:authors) || [@reportable.try(:author)]).select { |author| author.is_a?(Decidim::User) }
|
|
99
|
-
end
|
|
100
|
-
|
|
101
98
|
def report_reasons
|
|
102
99
|
@reportable.moderation.reports.pluck(:reason).uniq
|
|
103
100
|
end
|
|
@@ -14,7 +14,7 @@ module Decidim
|
|
|
14
14
|
|
|
15
15
|
def self.crypt_data
|
|
16
16
|
key = ActiveSupport::KeyGenerator.new("sent_at").generate_key(
|
|
17
|
-
Rails.application.
|
|
17
|
+
Rails.application.secret_key_base, ActiveSupport::MessageEncryptor.key_len
|
|
18
18
|
)
|
|
19
19
|
ActiveSupport::MessageEncryptor.new(key)
|
|
20
20
|
end
|
|
@@ -27,16 +27,19 @@ module Decidim
|
|
|
27
27
|
# * Disambiguates it so it is unique.
|
|
28
28
|
#
|
|
29
29
|
# name - the String to nicknamize
|
|
30
|
-
#
|
|
30
|
+
# scope - a Hash with extra values to scope the nickname to
|
|
31
31
|
#
|
|
32
32
|
# Example to nicknamize a user name, scoped to the organization:
|
|
33
33
|
#
|
|
34
|
-
# nicknamize(user_name,
|
|
34
|
+
# nicknamize(user_name, organization: current_organization)
|
|
35
35
|
#
|
|
36
|
-
def nicknamize(name,
|
|
36
|
+
def nicknamize(name, scope = {})
|
|
37
37
|
return unless name
|
|
38
38
|
|
|
39
|
-
disambiguate(
|
|
39
|
+
disambiguate(
|
|
40
|
+
name.parameterize(separator: "_")[nickname_length_range],
|
|
41
|
+
scope
|
|
42
|
+
)
|
|
40
43
|
end
|
|
41
44
|
|
|
42
45
|
private
|
|
@@ -45,11 +48,11 @@ module Decidim
|
|
|
45
48
|
(0...nickname_max_length)
|
|
46
49
|
end
|
|
47
50
|
|
|
48
|
-
def disambiguate(name,
|
|
51
|
+
def disambiguate(name, scope)
|
|
49
52
|
candidate = name
|
|
50
53
|
|
|
51
54
|
2.step do |n|
|
|
52
|
-
return candidate if Decidim::UserBaseEntity.where(nickname
|
|
55
|
+
return candidate if Decidim::UserBaseEntity.where("nickname ILIKE ?", candidate.downcase).where(scope).empty?
|
|
53
56
|
|
|
54
57
|
candidate = numbered_variation_of(name, n)
|
|
55
58
|
end
|
data/lib/decidim/paddable.rb
CHANGED
data/lib/decidim/participable.rb
CHANGED
|
@@ -14,25 +14,25 @@ module Decidim
|
|
|
14
14
|
|
|
15
15
|
def skip_space_slug?(method_name)
|
|
16
16
|
[
|
|
17
|
-
"edit_#{underscored_name}_path"
|
|
18
|
-
"edit_#{underscored_name}_url"
|
|
19
|
-
"new_#{underscored_name}_path"
|
|
20
|
-
"new_#{underscored_name}_url"
|
|
21
|
-
"#{underscored_name}_path"
|
|
22
|
-
"#{underscored_name}_url"
|
|
23
|
-
"#{underscored_name.pluralize}_path"
|
|
24
|
-
"#{underscored_name.pluralize}_url"
|
|
17
|
+
:"edit_#{underscored_name}_path",
|
|
18
|
+
:"edit_#{underscored_name}_url",
|
|
19
|
+
:"new_#{underscored_name}_path",
|
|
20
|
+
:"new_#{underscored_name}_url",
|
|
21
|
+
:"#{underscored_name}_path",
|
|
22
|
+
:"#{underscored_name}_url",
|
|
23
|
+
:"#{underscored_name.pluralize}_path",
|
|
24
|
+
:"#{underscored_name.pluralize}_url"
|
|
25
25
|
].include?(method_name)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def slug_param_name
|
|
29
|
-
"#{underscored_name}_slug"
|
|
29
|
+
:"#{underscored_name}_slug"
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def mounted_params
|
|
33
33
|
{
|
|
34
34
|
:host => organization.host,
|
|
35
|
-
"#{underscored_name}_slug"
|
|
35
|
+
:"#{underscored_name}_slug" => slug
|
|
36
36
|
}
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -37,6 +37,16 @@ module Decidim
|
|
|
37
37
|
raise "Not implemented"
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
def self.ransackable_attributes(auth_object = nil)
|
|
41
|
+
return [] unless auth_object&.admin?
|
|
42
|
+
|
|
43
|
+
%w(name nickname email invitation_accepted_at last_sign_in_at role)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def self.ransackable_associations(_auth_object = nil)
|
|
47
|
+
[]
|
|
48
|
+
end
|
|
49
|
+
|
|
40
50
|
def self.order_by_name
|
|
41
51
|
includes(:user).order("decidim_users.name ASC")
|
|
42
52
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module PrivateDownloadHelper
|
|
5
|
+
def attach_archive(export_data, name, user)
|
|
6
|
+
private_exports = user.private_exports.build
|
|
7
|
+
private_exports.export_type = name
|
|
8
|
+
private_exports.file.attach(io: StringIO.open(FileZipper.new(export_data.filename(name), export_data.read).zip), filename: "#{name}.zip")
|
|
9
|
+
private_exports.expires_at = Decidim.download_your_data_expiry_time.from_now
|
|
10
|
+
private_exports.metadata = {}
|
|
11
|
+
private_exports.save!
|
|
12
|
+
private_exports.reload
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -53,54 +53,59 @@ module Decidim
|
|
|
53
53
|
# def name=(value)
|
|
54
54
|
# super(encrypt_value(value))
|
|
55
55
|
# end
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
56
|
+
create_encrypted_getter(attribute, method_suffix)
|
|
57
|
+
create_encrypted_setter(attribute, method_suffix)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# def full_name
|
|
61
|
+
# return @full_name_decrypted if instance_variable_defined?(:@full_name_decrypted)
|
|
62
|
+
#
|
|
63
|
+
# encrypted_value = begin
|
|
64
|
+
# if defined?(super)
|
|
65
|
+
# super
|
|
66
|
+
# elsif instance_variable_defined?(:@full_name)
|
|
67
|
+
# @full_name
|
|
68
|
+
# end
|
|
69
|
+
# end
|
|
70
|
+
# @full_name_decrypted = decrypt_value(encrypted_value)
|
|
71
|
+
# end
|
|
72
|
+
def create_encrypted_getter(attribute, method_suffix)
|
|
73
|
+
define_method(attribute) do
|
|
74
|
+
return instance_variable_get(:"@#{attribute}_decrypted") if instance_variable_defined?(:"@#{attribute}_decrypted")
|
|
75
|
+
|
|
76
|
+
encrypted_value = if defined?(super)
|
|
77
|
+
super()
|
|
78
|
+
elsif instance_variable_defined?(:"@#{attribute}")
|
|
79
|
+
instance_variable_get(:"@#{attribute}")
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
decrypted_value = send(:"decrypt_#{method_suffix}", encrypted_value)
|
|
83
|
+
instance_variable_set(:"@#{attribute}_decrypted", decrypted_value)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
82
86
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
# def full_name=(value)
|
|
88
|
+
# remove_instance_variable(:@full_name_decrypted) if instance_variable_defined?(:@full_name_decrypted)
|
|
89
|
+
# encrypted_value = encrypt_value(value)
|
|
90
|
+
#
|
|
91
|
+
# if defined?(super)
|
|
92
|
+
# super(encrypted_value)
|
|
93
|
+
# else
|
|
94
|
+
# @full_name = encrypted_value
|
|
95
|
+
# end
|
|
96
|
+
# end
|
|
97
|
+
def create_encrypted_setter(attribute, method_suffix)
|
|
98
|
+
define_method("#{attribute}=") do |value|
|
|
99
|
+
remove_instance_variable(:"@#{attribute}_decrypted") if instance_variable_defined?(:"@#{attribute}_decrypted")
|
|
100
|
+
|
|
101
|
+
encrypted_value = send(:"encrypt_#{method_suffix}", value)
|
|
102
|
+
|
|
103
|
+
if defined?(super)
|
|
104
|
+
super(encrypted_value)
|
|
105
|
+
else
|
|
106
|
+
instance_variable_set(:"@#{attribute}", encrypted_value)
|
|
102
107
|
end
|
|
103
|
-
|
|
108
|
+
end
|
|
104
109
|
end
|
|
105
110
|
end
|
|
106
111
|
|
data/lib/decidim/reportable.rb
CHANGED
|
@@ -53,12 +53,8 @@ module Decidim
|
|
|
53
53
|
# Public: The reported content url
|
|
54
54
|
#
|
|
55
55
|
# Returns String
|
|
56
|
-
def reported_content_url
|
|
57
|
-
|
|
58
|
-
ResourceLocatorPresenter.new(self).index(options)
|
|
59
|
-
else
|
|
60
|
-
ResourceLocatorPresenter.new(self).url(options)
|
|
61
|
-
end
|
|
56
|
+
def reported_content_url
|
|
57
|
+
raise NotImplementedError
|
|
62
58
|
end
|
|
63
59
|
|
|
64
60
|
# Public: The collection of attribute names that are considered
|
data/lib/decidim/resourceable.rb
CHANGED
|
@@ -50,6 +50,22 @@ module Decidim
|
|
|
50
50
|
scope.where(id: from).or(scope.where(id: to))
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
def linked_resources_from(resource_name, link_name, component_published: true)
|
|
54
|
+
scope = sibling_scope(resource_name, component_published:)
|
|
55
|
+
|
|
56
|
+
scope
|
|
57
|
+
.joins(:resource_links_from)
|
|
58
|
+
.where(decidim_resource_links: { name: link_name, to_id: id, to_type: self.class.name })
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def linked_resources_to(resource_name, link_name, component_published: true)
|
|
62
|
+
scope = sibling_scope(resource_name, component_published:)
|
|
63
|
+
|
|
64
|
+
scope
|
|
65
|
+
.joins(:resource_links_to)
|
|
66
|
+
.where(decidim_resource_links: { name: link_name, from_id: id, from_type: self.class.name })
|
|
67
|
+
end
|
|
68
|
+
|
|
53
69
|
# Builds an ActiveRecord::Relation in order to load all the resources
|
|
54
70
|
# that are in the same parent as this model.
|
|
55
71
|
#
|
data/lib/decidim/seeds.rb
CHANGED
|
@@ -21,7 +21,7 @@ module Decidim
|
|
|
21
21
|
user = Decidim::User.find_or_initialize_by(email:)
|
|
22
22
|
user.update!(
|
|
23
23
|
name: ::Faker::Name.name,
|
|
24
|
-
nickname: ::Faker::Twitter.unique.screen_name,
|
|
24
|
+
nickname: "#{::Faker::Twitter.unique.screen_name}-#{rand(10_000)}"[0...20],
|
|
25
25
|
password: "decidim123456789",
|
|
26
26
|
organization:,
|
|
27
27
|
confirmed_at: Time.current,
|
|
@@ -38,18 +38,6 @@ module Decidim
|
|
|
38
38
|
user
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
def random_scope(participatory_space:)
|
|
42
|
-
if participatory_space.scope
|
|
43
|
-
scopes = participatory_space.scope.descendants
|
|
44
|
-
global = participatory_space.scope
|
|
45
|
-
else
|
|
46
|
-
scopes = participatory_space.organization.scopes
|
|
47
|
-
global = nil
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
::Faker::Boolean.boolean(true_ratio: 0.5) ? global : scopes.sample
|
|
51
|
-
end
|
|
52
|
-
|
|
53
41
|
def seeds_root = File.join(__dir__, "..", "..", "db", "seeds")
|
|
54
42
|
|
|
55
43
|
def hero_image = create_blob!(seeds_file: "city.jpeg", filename: "hero_image.jpeg", content_type: "image/jpeg")
|
|
@@ -97,13 +85,23 @@ module Decidim
|
|
|
97
85
|
)
|
|
98
86
|
end
|
|
99
87
|
|
|
100
|
-
def
|
|
101
|
-
Decidim::
|
|
102
|
-
name: Decidim::Faker::Localized.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
88
|
+
def create_taxonomy!(name:, parent:)
|
|
89
|
+
Decidim::Taxonomy.create!(
|
|
90
|
+
name: Decidim::Faker::Localized.literal(name),
|
|
91
|
+
organization:,
|
|
92
|
+
parent:
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def create_taxonomy_filter!(root_taxonomy:, taxonomies:, participatory_space_manifests: [])
|
|
97
|
+
Decidim::TaxonomyFilter.create!(
|
|
98
|
+
root_taxonomy:,
|
|
99
|
+
participatory_space_manifests:,
|
|
100
|
+
filter_items: taxonomies.map do |taxonomy_item|
|
|
101
|
+
Decidim::TaxonomyFilterItem.new(
|
|
102
|
+
taxonomy_item:
|
|
103
|
+
)
|
|
104
|
+
end
|
|
107
105
|
)
|
|
108
106
|
end
|
|
109
107
|
|
|
@@ -70,6 +70,8 @@ module Decidim
|
|
|
70
70
|
validates name, presence: true if attribute.required
|
|
71
71
|
validates name, inclusion: { in: attribute.build_choices } if attribute.type == :enum
|
|
72
72
|
end
|
|
73
|
+
|
|
74
|
+
SettingsManifest.add_integer_with_units_validation(self, name, attribute) if attribute.type == :integer_with_units
|
|
73
75
|
end
|
|
74
76
|
end
|
|
75
77
|
|
|
@@ -77,6 +79,20 @@ module Decidim
|
|
|
77
79
|
@schema
|
|
78
80
|
end
|
|
79
81
|
|
|
82
|
+
def self.add_integer_with_units_validation(schema, name, attribute)
|
|
83
|
+
schema.class_eval do
|
|
84
|
+
validate do
|
|
85
|
+
value = send(name)
|
|
86
|
+
value = [value["0"].to_i, value["1"].to_s] if value.is_a?(::Hash)
|
|
87
|
+
|
|
88
|
+
errors.add(name, :invalid) unless value.is_a?(::Array) &&
|
|
89
|
+
value.size == 2 &&
|
|
90
|
+
value[0].is_a?(Integer) &&
|
|
91
|
+
attribute.build_units.include?(value[1])
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
80
96
|
def required_attributes_for_authorization
|
|
81
97
|
attributes.select { |_, attribute| attribute.required_for_authorization? }
|
|
82
98
|
end
|
|
@@ -91,6 +107,7 @@ module Decidim
|
|
|
91
107
|
TYPES = {
|
|
92
108
|
boolean: { klass: Boolean, default: false },
|
|
93
109
|
integer: { klass: Integer, default: 0 },
|
|
110
|
+
integer_with_units: { klass: Decidim::Attributes::IntegerWithUnits, default: [5, "minutes"] },
|
|
94
111
|
string: { klass: String, default: nil },
|
|
95
112
|
float: { klass: Float, default: nil },
|
|
96
113
|
text: { klass: String, default: nil },
|
|
@@ -98,7 +115,8 @@ module Decidim
|
|
|
98
115
|
enum: { klass: String, default: nil },
|
|
99
116
|
select: { klass: String, default: nil },
|
|
100
117
|
scope: { klass: Integer, default: nil },
|
|
101
|
-
time: { klass: Decidim::Attributes::TimeWithZone, default: nil }
|
|
118
|
+
time: { klass: Decidim::Attributes::TimeWithZone, default: nil },
|
|
119
|
+
taxonomy_filters: { klass: Array, default: [] }
|
|
102
120
|
}.freeze
|
|
103
121
|
|
|
104
122
|
attribute :type, Symbol, default: :boolean
|
|
@@ -111,9 +129,20 @@ module Decidim
|
|
|
111
129
|
attribute :required_for_authorization, Boolean, default: false
|
|
112
130
|
attribute :readonly
|
|
113
131
|
attribute :choices
|
|
132
|
+
attribute :units
|
|
114
133
|
attribute :include_blank, Boolean, default: false
|
|
115
134
|
|
|
116
135
|
validates :type, inclusion: { in: TYPES.keys }
|
|
136
|
+
validate :validate_integer_with_units_structure
|
|
137
|
+
|
|
138
|
+
def validate_integer_with_units_structure
|
|
139
|
+
return unless type == :integer_with_units
|
|
140
|
+
|
|
141
|
+
errors.add(:default, :invalid) unless default_value.is_a?(::Array) &&
|
|
142
|
+
default_value.size == 2 &&
|
|
143
|
+
default_value[0].is_a?(Integer) &&
|
|
144
|
+
build_units.include?(default_value[1])
|
|
145
|
+
end
|
|
117
146
|
|
|
118
147
|
def type_class
|
|
119
148
|
return Decidim::Attributes::RichText if type == :text && editor == true
|
|
@@ -129,6 +158,10 @@ module Decidim
|
|
|
129
158
|
choices.try(:call) || choices
|
|
130
159
|
end
|
|
131
160
|
|
|
161
|
+
def build_units
|
|
162
|
+
units.try(:call) || units
|
|
163
|
+
end
|
|
164
|
+
|
|
132
165
|
def readonly?(context)
|
|
133
166
|
readonly&.call(context)
|
|
134
167
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "active_support/concern"
|
|
4
|
+
require "paranoia"
|
|
5
|
+
|
|
6
|
+
module Decidim
|
|
7
|
+
# This concern contains the logic related to soft deletion (trashing).
|
|
8
|
+
module SoftDeletable
|
|
9
|
+
extend ActiveSupport::Concern
|
|
10
|
+
|
|
11
|
+
included do
|
|
12
|
+
acts_as_paranoid
|
|
13
|
+
|
|
14
|
+
scope :deleted_at_desc, -> { order(deleted_at: :desc) }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "active_support/concern"
|
|
4
|
+
|
|
5
|
+
module Decidim
|
|
6
|
+
# A concern with the components needed when you want a model to have taxonomies.
|
|
7
|
+
#
|
|
8
|
+
# The including model needs to implement the following interface:
|
|
9
|
+
#
|
|
10
|
+
# @abstract method that gives an associated organization
|
|
11
|
+
# @method organization
|
|
12
|
+
# @return [Decidim::Organization]
|
|
13
|
+
#
|
|
14
|
+
module Taxonomizable
|
|
15
|
+
extend ActiveSupport::Concern
|
|
16
|
+
|
|
17
|
+
included do
|
|
18
|
+
has_many :taxonomizations, as: :taxonomizable, class_name: "Decidim::Taxonomization", dependent: :destroy
|
|
19
|
+
has_many :taxonomies, through: :taxonomizations
|
|
20
|
+
|
|
21
|
+
validate :no_root_taxonomies
|
|
22
|
+
validate :taxonomies_belong_to_organization
|
|
23
|
+
|
|
24
|
+
# finds taxonomizables belonging to a specific taxonomy
|
|
25
|
+
scope :with_taxonomy, ->(taxonomy_id) { includes(:taxonomies).references(:decidim_taxonomies).where("? = ANY(decidim_taxonomies.part_of)", taxonomy_id) }
|
|
26
|
+
|
|
27
|
+
# finds taxonomizables belonging to any of the taxonomies specified (or its children)
|
|
28
|
+
scope :with_taxonomies, lambda { |*taxonomy_ids|
|
|
29
|
+
conditions = ["? = ANY(part_of)"] * taxonomy_ids.count
|
|
30
|
+
taxonomies = Decidim::Taxonomy.where(conditions.join(" OR "), *taxonomy_ids.map(&:to_i))
|
|
31
|
+
includes(:taxonomies).joins(:taxonomies).where(decidim_taxonomies: { id: taxonomies })
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# finds taxonomizables belonging to all groups of taxonomies specified, each group is an array of taxonomy ids that are ORed together
|
|
35
|
+
scope :with_any_taxonomies, lambda { |*taxonomy_groups|
|
|
36
|
+
return with_taxonomies(*taxonomy_groups) unless taxonomy_groups.first.is_a?(Array)
|
|
37
|
+
|
|
38
|
+
queries = []
|
|
39
|
+
taxonomy_groups.each do |root_id, taxonomy_ids|
|
|
40
|
+
taxonomy_ids = taxonomy_ids.flatten.compact_blank
|
|
41
|
+
next if taxonomy_ids.empty?
|
|
42
|
+
|
|
43
|
+
taxonomy_ids = [root_id] if taxonomy_ids.include?("all")
|
|
44
|
+
|
|
45
|
+
queries << with_taxonomies(*taxonomy_ids)
|
|
46
|
+
end
|
|
47
|
+
return self if queries.empty?
|
|
48
|
+
return queries.first if queries.count == 1
|
|
49
|
+
|
|
50
|
+
subquery = queries.map(&:arel).reduce do |memo, query|
|
|
51
|
+
Arel::Nodes::Intersect.new(memo, query)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
@klass.from(Arel::Nodes::As.new(subquery, Arel.sql(@klass.arel_table.name)))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def no_root_taxonomies
|
|
60
|
+
return unless taxonomies.any?(&:root?)
|
|
61
|
+
|
|
62
|
+
errors.add(:taxonomies, :invalid)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def taxonomies_belong_to_organization
|
|
66
|
+
return if taxonomies.all? { |taxonomy| taxonomy.organization == organization }
|
|
67
|
+
|
|
68
|
+
errors.add(:taxonomies, :invalid)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -62,7 +62,7 @@ module Decidim
|
|
|
62
62
|
final = super(value)
|
|
63
63
|
return unless final # Do not set the `nil` values for the parent hash
|
|
64
64
|
|
|
65
|
-
final = value_type.serialize(final) if value_type
|
|
65
|
+
final = value_type.serialize(final) if value_type
|
|
66
66
|
|
|
67
67
|
public_send("#{name}=", field.merge(locale => final))
|
|
68
68
|
end
|
|
@@ -127,9 +127,5 @@ module Decidim
|
|
|
127
127
|
locale.to_s == try(:default_locale).to_s ||
|
|
128
128
|
locale.to_s == try(:current_organization).try(:default_locale).to_s
|
|
129
129
|
end
|
|
130
|
-
|
|
131
|
-
def attachment?(value)
|
|
132
|
-
value.is_a?(String) && value.include?(ActiveStorage.routes_prefix)
|
|
133
|
-
end
|
|
134
130
|
end
|
|
135
131
|
end
|
data/lib/decidim/view_model.rb
CHANGED
|
@@ -8,7 +8,6 @@ module Decidim
|
|
|
8
8
|
include ActionView::Helpers::TranslationHelper
|
|
9
9
|
include ::Cell::Translation
|
|
10
10
|
include Decidim::ResourceHelper
|
|
11
|
-
include Decidim::ScopesHelper
|
|
12
11
|
include ActionController::Helpers
|
|
13
12
|
include Decidim::ActionAuthorization
|
|
14
13
|
include Decidim::ActionAuthorizationHelper
|
|
@@ -64,7 +64,7 @@ namespace :decidim do
|
|
|
64
64
|
input = $stdin.gets.chomp
|
|
65
65
|
if input.casecmp("y").zero?
|
|
66
66
|
puts %( Continue...)
|
|
67
|
-
Decidim::User.where(
|
|
67
|
+
Decidim::User.where(newsletter_notifications_at: ...Time.zone.parse("2018-05-25 00:00 +02:00")).find_each(&:newsletter_opt_in_notify)
|
|
68
68
|
else
|
|
69
69
|
puts %( Execution cancelled...)
|
|
70
70
|
end
|
|
@@ -76,9 +76,7 @@ namespace :decidim do
|
|
|
76
76
|
attachments = ActiveStorage::Attachment.joins(:blob).where(
|
|
77
77
|
name: "download_your_data_file",
|
|
78
78
|
record_type: "Decidim::UserBaseEntity"
|
|
79
|
-
).where(
|
|
80
|
-
"active_storage_blobs.created_at < ?", Decidim.download_your_data_expiry_time.ago
|
|
81
|
-
)
|
|
79
|
+
).where(active_storage_blobs: { created_at: ...Decidim.download_your_data_expiry_time.ago })
|
|
82
80
|
attachments.each do |attachment|
|
|
83
81
|
delete_download_your_data_file attachment
|
|
84
82
|
end
|
|
@@ -11,6 +11,12 @@ namespace :decidim do
|
|
|
11
11
|
shakapacker: bin/shakapacker-dev-server
|
|
12
12
|
RUBY
|
|
13
13
|
|
|
14
|
+
if defined?(Sidekiq)
|
|
15
|
+
actions :append_file, "Procfile.dev", <<~RUBY
|
|
16
|
+
sidekiq: bundle exec sidekiq -C config/sidekiq.yml
|
|
17
|
+
RUBY
|
|
18
|
+
end
|
|
19
|
+
|
|
14
20
|
actions :create_file, "bin/dev", %(#!/usr/bin/env sh
|
|
15
21
|
|
|
16
22
|
set -e
|