decidim-core 0.29.4 → 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/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 +4 -2
- data/app/cells/decidim/author_cell.rb +1 -1
- 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/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/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_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 +27 -13
- 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/user_activity/show.erb +1 -1
- 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/headers/browser_feature_permissions.rb +50 -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/application_controller.rb +10 -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/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 +0 -9
- 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/layout_helper.rb +6 -0
- 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/src/decidim/check_boxes_tree.js +0 -1
- data/app/packs/src/decidim/clipboard.js +18 -9
- data/app/packs/src/decidim/confirm.js +79 -59
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +3 -3
- data/app/packs/src/decidim/decidim_application.js +1 -0
- data/app/packs/src/decidim/form_remote.js +1 -1
- data/app/packs/src/decidim/geocoding/reverse_geocoding.js +60 -0
- data/app/packs/src/decidim/impersonation.js +1 -1
- data/app/packs/src/decidim/index.js +13 -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/session_timeouter.js +1 -1
- 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/utilities/dom.js +148 -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/_buttons.scss +19 -0
- data/app/packs/stylesheets/decidim/_cards.scss +1 -1
- 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/_forms.scss +2 -2
- data/app/packs/stylesheets/decidim/_header.scss +37 -60
- data/app/packs/stylesheets/decidim/_layout.scss +32 -2
- data/app/packs/stylesheets/decidim/_login.scss +53 -6
- data/app/packs/stylesheets/decidim/_modal.scss +42 -0
- data/app/packs/stylesheets/decidim/_modal_tos_refuse.scss +4 -0
- data/app/packs/stylesheets/decidim/_participatory_spaces.scss +46 -0
- data/app/packs/stylesheets/decidim/_profile.scss +1 -1
- 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/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 +8 -2
- 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/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/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/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/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 +38 -40
- 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 +0 -1
- data/app/views/layouts/decidim/_js_configuration.html.erb +1 -0
- 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_legal.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_links.html.erb +1 -1
- 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/_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/shared/_layout_item.html.erb +1 -1
- data/config/assets.rb +2 -1
- data/config/locales/ar.yml +35 -74
- data/config/locales/bg.yml +33 -74
- data/config/locales/bs-BA.yml +0 -2
- data/config/locales/ca.yml +370 -102
- data/config/locales/cs.yml +374 -102
- data/config/locales/de.yml +350 -88
- data/config/locales/el.yml +22 -58
- data/config/locales/en.yml +350 -82
- data/config/locales/eo.yml +0 -4
- data/config/locales/es-MX.yml +364 -99
- data/config/locales/es-PY.yml +369 -104
- data/config/locales/es.yml +370 -102
- data/config/locales/eu.yml +426 -156
- data/config/locales/fi-plain.yml +366 -76
- data/config/locales/fi.yml +370 -77
- data/config/locales/fr-CA.yml +176 -97
- data/config/locales/fr.yml +176 -94
- data/config/locales/ga-IE.yml +4 -25
- data/config/locales/gl.yml +20 -58
- data/config/locales/hu.yml +30 -62
- data/config/locales/id-ID.yml +21 -57
- data/config/locales/is-IS.yml +5 -25
- data/config/locales/it.yml +36 -94
- data/config/locales/ja.yml +231 -112
- data/config/locales/lb.yml +28 -76
- data/config/locales/lt.yml +24 -64
- data/config/locales/lv.yml +21 -58
- data/config/locales/nl.yml +23 -75
- data/config/locales/no.yml +23 -70
- data/config/locales/pl.yml +30 -72
- data/config/locales/pt-BR.yml +41 -63
- data/config/locales/pt.yml +23 -70
- data/config/locales/ro-RO.yml +115 -184
- data/config/locales/ru.yml +13 -43
- data/config/locales/sk.yml +24 -70
- data/config/locales/sl.yml +0 -4
- data/config/locales/sr-CS.yml +0 -2
- data/config/locales/sv.yml +138 -106
- data/config/locales/tr-TR.yml +29 -75
- data/config/locales/uk.yml +6 -29
- data/config/locales/zh-CN.yml +21 -68
- data/config/locales/zh-TW.yml +23 -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 +6 -11
- data/lib/decidim/assets/tailwind/tailwind.config.js.erb +2 -1
- 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 +105 -2
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +85 -0
- 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 +6 -129
- 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 +203 -112
- data/app/cells/decidim/amendable/amenders_list/show.erb +0 -0
- 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 -46
- 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/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 -2122
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77df3a6de553546de92afda8c288ccedbf4412cf0546c1bf94e92efa7e8d3325
|
4
|
+
data.tar.gz: 9cd7cba3a6c3ad45e8acc75e85e0c6e2a3c0f0887eb7524d9f72b6335d978860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edf03c50896d3b4012b3132249013c9957c28449ec869d5b986793a732f423732712049c23507fb1d2a8608501c4f4df475719adaf12a5ed566deb4e26d2bb90
|
7
|
+
data.tar.gz: fb820a54a48ea4066d03748f56128683b6fa4b14aec5919b8c11e69e40b1cf6615bd15b63a6f1fd1a09198873470d49c288e8b143a9cac7189c7c0dae4cbc65a
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<%= icon "map-pin-line" %>
|
5
5
|
<div class="address">
|
6
6
|
<% if has_location? %>
|
7
|
-
<
|
7
|
+
<div class="address__location"><%= location %></div>
|
8
8
|
<% end %>
|
9
9
|
|
10
|
-
<
|
10
|
+
<div class="address__address"><%= address %></div>
|
11
11
|
|
12
12
|
<% if has_location_hints? %>
|
13
|
-
<
|
13
|
+
<div class="address__hints"><%= location_hints %></div>
|
14
14
|
<% end %>
|
15
15
|
</div>
|
16
16
|
</div>
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<li role="menuitem">
|
2
|
+
<%= action_authorized_link_to :amend, new_amend_path, resource: model, data: { "redirect_url" => new_amend_path }, id: "amend-button", class: "button button__sm button__text button__text-secondary" do %>
|
3
|
+
<span><%= t("button", scope: "decidim.amendments.amendable", model_name: nil) %></span>
|
4
|
+
<%= icon "pencil-line" %>
|
5
|
+
<% end %>
|
6
|
+
</li>
|
@@ -4,6 +4,14 @@ module Decidim
|
|
4
4
|
module Amendable
|
5
5
|
# This cell renders the button to amend the given resource.
|
6
6
|
class AmendButtonCardCell < Decidim::ViewModel
|
7
|
+
def show
|
8
|
+
return unless amendments_enabled? && model.amendable?
|
9
|
+
return unless current_component.current_settings.amendment_creation_enabled
|
10
|
+
return unless can_participate_in_private_space?
|
11
|
+
|
12
|
+
render
|
13
|
+
end
|
14
|
+
|
7
15
|
def model_name
|
8
16
|
model.model_name.human
|
9
17
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<%= action_authorized_link_to :amend,
|
2
2
|
promote_amend_path,
|
3
3
|
method: :post,
|
4
|
+
resource: emendation,
|
4
5
|
data: { confirm: promote_confirm_text },
|
6
|
+
title: promote_amend_button_label,
|
5
7
|
class: "button button__sm button__transparent-secondary" do %>
|
6
8
|
<span><%= promote_amend_button_label %></span>
|
7
9
|
<%= icon "pencil-line" %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<button type="button" data-open="<%= current_user.present? ? "flagModal" : "loginModal" %>" title="<%= t("report", scope: "decidim.shared.flag_modal" ) %>" aria-controls="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-haspopup="true" tabindex="0">
|
2
|
+
<%= icon "flag", aria_hidden: true, class: "icon--small", role: "img", "aria-hidden": true %>
|
3
|
+
<span>
|
4
|
+
<%= t("report", scope: "decidim.shared.flag_modal" ) %>
|
5
|
+
</span>
|
6
|
+
</button>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if user_flaggable? && model.try(:id) != current_user.try(:id) %>
|
2
|
+
<%= cell(
|
3
|
+
"decidim/button",
|
4
|
+
{ icon: "flag-line", text: t("decidim.shared.flag_modal.report") },
|
5
|
+
button_classes: "button button__sm button__text-secondary only:m-auto",
|
6
|
+
html_options: {
|
7
|
+
"data-open" => current_user.present? ? "flagUserModal" : "loginModal",
|
8
|
+
"aria-controls" => current_user.present? ? "flagUserModal" : "loginModal",
|
9
|
+
"aria-haspopup" => "dialog"
|
10
|
+
}
|
11
|
+
) %>
|
12
|
+
|
13
|
+
<%= cell("decidim/flag_modal", model).flag_user %>
|
14
|
+
<% end %>
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<%# If the options hash has the demo key it means we are in the decidim-design engine, so it is not a real-world scenario with actual users %>
|
2
|
+
<% tooltip = options.has_key?(:demo) ? { tooltip: render(:profile_minicard).html_safe } : nil %>
|
3
|
+
<%= content_tag(:span, class: :author, data: ) do %>
|
4
|
+
<%= content_tag :span, class: "author__container#{" is-compact" if layout == :compact}", data: tooltip do %>
|
3
5
|
<% if layout == :compact %>
|
4
6
|
<%= render :avatar %>
|
5
7
|
|
@@ -0,0 +1 @@
|
|
1
|
+
<!-- This file is intentionally left empty because it may be overwritten by the child cells in case they need to display extra data -->
|
@@ -110,22 +110,15 @@ module Decidim
|
|
110
110
|
}
|
111
111
|
end
|
112
112
|
|
113
|
-
def
|
114
|
-
return unless resource.is_a?(
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
def category_item
|
123
|
-
return unless resource.is_a?(Decidim::HasCategory) && resource.category.present?
|
124
|
-
|
125
|
-
{
|
126
|
-
text: resource.category.translated_name,
|
127
|
-
icon: resource_type_icon_key("Decidim::Category")
|
128
|
-
}
|
113
|
+
def taxonomy_items
|
114
|
+
return [] unless resource.is_a?(Taxonomizable) && resource.taxonomies.any?
|
115
|
+
|
116
|
+
resource.taxonomies.map do |taxonomy|
|
117
|
+
{
|
118
|
+
text: translated_attribute(taxonomy.name),
|
119
|
+
icon: resource_type_icon_key("Decidim::Taxonomy")
|
120
|
+
}
|
121
|
+
end
|
129
122
|
end
|
130
123
|
|
131
124
|
def enable_links?
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
class CommentsButtonCell < ButtonCell
|
5
|
+
include UserRoleChecker
|
6
|
+
|
5
7
|
def show
|
6
8
|
if options.has_key?(:display)
|
7
9
|
return render if options[:display]
|
@@ -9,13 +11,19 @@ module Decidim
|
|
9
11
|
return
|
10
12
|
end
|
11
13
|
|
12
|
-
render if
|
14
|
+
render if comments_enabled?
|
13
15
|
end
|
14
16
|
|
15
17
|
private
|
16
18
|
|
19
|
+
def comments_enabled?
|
20
|
+
return true if user_has_any_role?(current_user, current_participatory_space)
|
21
|
+
|
22
|
+
component_settings.comments_enabled? && !current_settings.try(:comments_blocked?)
|
23
|
+
end
|
24
|
+
|
17
25
|
def path
|
18
|
-
"#
|
26
|
+
"#add-comment-anchor"
|
19
27
|
end
|
20
28
|
|
21
29
|
def text
|
@@ -25,5 +33,9 @@ module Decidim
|
|
25
33
|
def icon_name
|
26
34
|
resource_type_icon_key "Decidim::Comments::Comment"
|
27
35
|
end
|
36
|
+
|
37
|
+
def button_classes
|
38
|
+
"button button__sm button__transparent-secondary add-comment-mobile"
|
39
|
+
end
|
28
40
|
end
|
29
41
|
end
|
@@ -4,6 +4,8 @@ module Decidim
|
|
4
4
|
module ContentBlocks
|
5
5
|
class HighlightedElementsCell < BaseCell
|
6
6
|
include Decidim::ContentBlocks::HasRelatedComponents
|
7
|
+
include Decidim::ComponentPathHelper
|
8
|
+
include Decidim::CardHelper
|
7
9
|
|
8
10
|
def published_components
|
9
11
|
@published_components ||= if model.settings.try(:component_id).present?
|
@@ -2,10 +2,10 @@
|
|
2
2
|
<div class="participatory-space__metadata-item">
|
3
3
|
<div class="participatory-space__metadata-item-title">
|
4
4
|
<%= icon item[:icon] %>
|
5
|
-
<
|
5
|
+
<span><%= item[:title] %></span>
|
6
6
|
</div>
|
7
7
|
<% if item[:text].present? %>
|
8
|
-
<%= content_tag :
|
8
|
+
<%= content_tag :span, item[:text] %>
|
9
9
|
<% elsif item[:partial].present? %>
|
10
10
|
<%= render item[:partial] %>
|
11
11
|
<% end %>
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<span><%=
|
1
|
+
<span><%= t("decidim.endorsement_buttons_cell.endorse") %></span>
|
2
2
|
<%= endorse_icon %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="resource-<%= resource&.id %>-endorsement-button">
|
2
|
-
<button id="select-identity-button" type="button" name="button" class="<%= button_classes %>" data-dialog-open="user-identities" data-dialog-remote-url="<%= reveal_identities_url %>">
|
2
|
+
<button id="select-identity-button" type="button" name="button" class="<%= button_classes %>" data-dialog-open="user-identities" data-dialog-remote-url="<%= reveal_identities_url %>" aria-label="<%= endorse_translated %>">
|
3
3
|
<%= render "button_content" %>
|
4
4
|
</button>
|
5
5
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
<div id="resource-<%= resource&.id %>-endorsement-button">
|
2
2
|
<% path = resource.endorsed_by?(current_user) ? path_to_destroy_endorsement(resource) : path_to_create_endorsement(resource) %>
|
3
|
-
<% label = resource.endorsed_by?(current_user) ? t("decidim.endorsement_buttons_cell.already_endorsed") : endorse_translated %>
|
4
3
|
<% method = resource.endorsed_by?(current_user) ? :delete : :post %>
|
5
4
|
<%= action_authorized_button_to(
|
6
5
|
:endorse,
|
7
6
|
path,
|
8
|
-
resource
|
9
|
-
method
|
10
|
-
remote
|
11
|
-
class
|
12
|
-
id
|
7
|
+
:resource => resource,
|
8
|
+
:method => method,
|
9
|
+
:remote => true,
|
10
|
+
:class => button_classes,
|
11
|
+
:id => "endorsement-button",
|
12
|
+
"aria-label" => endorse_translated
|
13
13
|
) do %>
|
14
|
-
|
14
|
+
<span><%= t("decidim.endorsement_buttons_cell.endorse") %></span>
|
15
15
|
<%= endorse_icon %>
|
16
16
|
<% end %>
|
17
17
|
</div>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<%= button_to(endorsement_path(resource),
|
2
|
-
data
|
3
|
-
class
|
2
|
+
:data => { "dialog-open": "authorizationModal", "dialog-remote-url": modal_path(:endorse, resource) },
|
3
|
+
:class => button_classes,
|
4
|
+
"aria-label" => endorse_translated
|
5
|
+
) do %>
|
4
6
|
<%= render "button_content" %>
|
5
7
|
<% end %>
|
@@ -1,6 +1,18 @@
|
|
1
|
-
|
2
|
-
<div
|
3
|
-
|
4
|
-
|
1
|
+
<%= decidim_modal id: "endorsersModal-#{model.id}", class: "endorsers-list__modal" do %>
|
2
|
+
<div data-dialog-container>
|
3
|
+
<%= icon "like" %>
|
4
|
+
<h2 id="dialog-title-endorsersModal" tabindex="-1" data-dialog-title><%= t("decidim.endorsers_list.title") %></h2>
|
5
|
+
<div>
|
6
|
+
<% full_endorsers.each do |author| %>
|
7
|
+
<div class="list-item__author">
|
8
|
+
<div>
|
9
|
+
<%= cell "decidim/author", author, has_actions: true, skip_profile_link: true %>
|
10
|
+
</div>
|
11
|
+
<div class="ml-auto">
|
12
|
+
<%= cell("decidim/follow_button", author, button_classes: "button button__sm button__transparent-secondary") %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
5
17
|
</div>
|
6
|
-
|
18
|
+
<% end %>
|
@@ -1,11 +1,20 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<section class="layout-main__section" id="endorser-list-<%= model.id %>">
|
2
|
+
<div class="endorsers-list__container">
|
3
|
+
<% visible_endorsers.each do |visible_endorser| %>
|
4
|
+
<span class="endorsers-list__avatar">
|
5
|
+
<%= cell "decidim/author", visible_endorser, layout: :avatar, skip_profile_link: true %>
|
6
|
+
</span>
|
7
|
+
<% end %>
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
<div class="text-center">
|
10
|
+
<div class="endorsers-list__text">
|
11
|
+
<%= t("decidim.endorsers_list.endorsed_by",
|
12
|
+
visible: display_link(voted_by_me? ? t("decidim.endorsers_list.you") : visible_endorsers.first.try(:name)),
|
13
|
+
others: display_link(t("decidim.endorsers_list.others", count: endorsers_count - 1), css_class: " first-letter:uppercase"),
|
14
|
+
count: endorsers_count
|
15
|
+
) %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<%= render :full %>
|
20
|
+
</section>
|
@@ -11,18 +11,15 @@ module Decidim
|
|
11
11
|
class EndorsersListCell < Decidim::ViewModel
|
12
12
|
include ApplicationHelper
|
13
13
|
|
14
|
-
MAX_ITEMS_STACKED =
|
14
|
+
MAX_ITEMS_STACKED = 8
|
15
15
|
|
16
16
|
def show
|
17
|
+
return render :empty if visible_endorsers.count.zero?
|
17
18
|
return render :full if full_list?
|
18
19
|
|
19
20
|
render
|
20
21
|
end
|
21
22
|
|
22
|
-
def full_endorsers_list
|
23
|
-
render
|
24
|
-
end
|
25
|
-
|
26
23
|
def endorsers_count
|
27
24
|
base_relation.count
|
28
25
|
end
|
@@ -37,7 +34,13 @@ module Decidim
|
|
37
34
|
#
|
38
35
|
# Returns an Array of presented Users/UserGroups
|
39
36
|
def visible_endorsers
|
40
|
-
@visible_endorsers ||=
|
37
|
+
@visible_endorsers ||= if voted_by_me?
|
38
|
+
base_relation.where.not(author: current_user).limit(MAX_ITEMS_STACKED - 1).map do |identity|
|
39
|
+
present(identity.normalized_author)
|
40
|
+
end + [present(current_user)]
|
41
|
+
else
|
42
|
+
base_relation.limit(MAX_ITEMS_STACKED).map { |identity| present(identity.normalized_author) }
|
43
|
+
end
|
41
44
|
end
|
42
45
|
|
43
46
|
def full_endorsers
|
@@ -47,5 +50,15 @@ module Decidim
|
|
47
50
|
def base_relation
|
48
51
|
@base_relation ||= model.endorsements.for_listing.includes(:author, :user_group)
|
49
52
|
end
|
53
|
+
|
54
|
+
def voted_by_me?
|
55
|
+
@voted_by_me ||= model.endorsed_by?(current_user)
|
56
|
+
end
|
57
|
+
|
58
|
+
def display_link(text, css_class: "")
|
59
|
+
link_to(text, "#",
|
60
|
+
class: "text-sm font-semibold text-secondary inline-block #{css_class}",
|
61
|
+
data: { "dialog-open": "endorsersModal-#{model.id}" })
|
62
|
+
end
|
50
63
|
end
|
51
64
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div class="flag-modal hidden" id="flagUserModal" data-reveal role="dialog" aria-modal="true" aria-labelledby="flagUserModal-label">
|
2
|
+
<div>
|
3
|
+
<h3 id="flagUserModal-label"><%= t("decidim.shared.flag_user_modal.title") %></h3>
|
4
|
+
<button class="close-button" data-close aria-label="<%= t("decidim.shared.flag_user_modal.close") %>" type="button">
|
5
|
+
<span aria-hidden="true">×</span>
|
6
|
+
</button>
|
7
|
+
</div>
|
8
|
+
<% if model.reported_by? current_user %>
|
9
|
+
<p><%= t("decidim.shared.flag_user_modal.already_reported") %></p>
|
10
|
+
<% else %>
|
11
|
+
<p><%= t("decidim.shared.flag_user_modal.description") %></p>
|
12
|
+
<%= decidim_form_for report_form, url: decidim.report_user_path(sgid: model.to_sgid.to_s), method: :post do |f| %>
|
13
|
+
<%= f.collection_radio_buttons :reason, [
|
14
|
+
[:spam, t("decidim.shared.flag_user_modal.spam")],
|
15
|
+
[:offensive, t("decidim.shared.flag_user_modal.offensive")],
|
16
|
+
[:does_not_belong, t("decidim.shared.flag_user_modal.does_not_belong", organization_name: current_organization.name)]
|
17
|
+
], :first, :last do |builder| %>
|
18
|
+
<%= builder.label { builder.radio_button + builder.text } %>
|
19
|
+
<% end %>
|
20
|
+
<%= f.text_area :details, rows: 4 %>
|
21
|
+
<% if current_user&.admin? %>
|
22
|
+
<%= f.check_box :block, label: t("decidim.shared.flag_user_modal.block"),
|
23
|
+
include_hidden: false,
|
24
|
+
data: {
|
25
|
+
label_action: t("decidim.shared.flag_user_modal.block"),
|
26
|
+
label_report: t("decidim.shared.flag_user_modal.report"),
|
27
|
+
block: "true"
|
28
|
+
} %>
|
29
|
+
<%= f.check_box :hide, label: t("decidim.shared.flag_user_modal.hide"), label_options: { id: "block_and_hide" } %>
|
30
|
+
<% end %>
|
31
|
+
<%= f.submit t("decidim.shared.flag_user_modal.report") %>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<%= decidim_modal id: modal_id do %>
|
2
|
+
<%= decidim_form_for report_form, url: decidim.report_path(sgid: model.to_sgid.to_s), method: :post, html: { id: nil, class: "modal__report form-defaults" } do |f| %>
|
3
|
+
<div data-dialog-container>
|
4
|
+
<%= icon "flag-line", class: "inline-block align-middle" %>
|
5
|
+
<h3 data-dialog-title id="dialog-title-<%= modal_id %>">
|
6
|
+
<%= t("decidim.shared.flag_modal.title") %>
|
7
|
+
</h3>
|
8
|
+
|
9
|
+
<% if model.reported_by? current_user %>
|
10
|
+
<div>
|
11
|
+
<p class="modal__report-text">
|
12
|
+
<%= t("decidim.shared.flag_modal.already_reported") %>
|
13
|
+
</p>
|
14
|
+
</div>
|
15
|
+
<% else %>
|
16
|
+
<div>
|
17
|
+
<p class="modal__report-text">
|
18
|
+
<%= t("decidim.shared.flag_modal.description") %>
|
19
|
+
</p>
|
20
|
+
<fieldset>
|
21
|
+
<legend><%= t("decidim.shared.flag_modal.reason") %></legend>
|
22
|
+
<%= f.collection_radio_buttons :reason, [
|
23
|
+
[:spam, t("decidim.shared.flag_modal.spam")],
|
24
|
+
[:offensive, t("decidim.shared.flag_modal.offensive")],
|
25
|
+
[:does_not_belong, t("decidim.shared.flag_modal.does_not_belong", organization_name: current_organization.name)]
|
26
|
+
], :first, :last do |builder| %>
|
27
|
+
<div class="modal__report-container__radio">
|
28
|
+
<%= builder.radio_button(id: builder.value) %>
|
29
|
+
<label for="<%= builder.value %>">
|
30
|
+
<%= builder.text %>
|
31
|
+
</label>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
</fieldset>
|
35
|
+
<% unless model.reported_by? current_user %>
|
36
|
+
<%= f.text_area :details, class: "w-full rounded border min-h-[160px] border-text-gray-2 mt-2", id: "#{modal_id}_details", label_options: { for: "#{modal_id}_details", class: "text-gray-2" } %>
|
37
|
+
<% end %>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
<div data-dialog-actions>
|
42
|
+
<% unless model.reported_by? current_user %>
|
43
|
+
<button type="submit" class="button button__lg button__secondary">
|
44
|
+
<span>
|
45
|
+
<%= t("decidim.shared.flag_modal.report") %>
|
46
|
+
</span>
|
47
|
+
<%= icon "arrow-right-line" %>
|
48
|
+
</button>
|
49
|
+
<% end %>
|
50
|
+
</div>
|
51
|
+
<% end %>
|
52
|
+
<% end %>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
class FlagModalCell < Decidim::ViewModel
|
5
|
+
include ActionView::Helpers::FormOptionsHelper
|
6
|
+
|
7
|
+
def flag_user
|
8
|
+
render
|
9
|
+
end
|
10
|
+
|
11
|
+
def cache_hash
|
12
|
+
hash = []
|
13
|
+
hash.push(I18n.locale)
|
14
|
+
hash.push(current_user.try(:id))
|
15
|
+
hash.push(model.reported_by?(current_user) ? 1 : 0)
|
16
|
+
hash.push(model.class.name.gsub("::", ":"))
|
17
|
+
hash.push(model.id)
|
18
|
+
hash.join(Decidim.cache_key_separator)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def frontend_administrable?
|
24
|
+
author.respond_to?(:nickname) &&
|
25
|
+
model.can_be_administered_by?(current_user) &&
|
26
|
+
(model.respond_to?(:official?) && !model.official?)
|
27
|
+
end
|
28
|
+
|
29
|
+
def link_to_profile
|
30
|
+
author.presenter.profile_url
|
31
|
+
end
|
32
|
+
|
33
|
+
def author
|
34
|
+
model.try(:creator_identity) || model.try(:normalized_author)
|
35
|
+
end
|
36
|
+
|
37
|
+
def user_report_form
|
38
|
+
Decidim::ReportForm.from_params(reason: "spam")
|
39
|
+
end
|
40
|
+
|
41
|
+
def modal_id
|
42
|
+
options[:modal_id] || "flagModal"
|
43
|
+
end
|
44
|
+
|
45
|
+
def hide_checkbox_id
|
46
|
+
@hide_checkbox_id ||= Digest::MD5.hexdigest("report_form_hide_#{model.class.name}_#{model.id}")
|
47
|
+
end
|
48
|
+
|
49
|
+
def report_form
|
50
|
+
@report_form ||= begin
|
51
|
+
context = { can_hide: model.try(:can_be_administered_by?, current_user) }
|
52
|
+
Decidim::ReportForm.new(reason: "spam").with_context(context)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -23,6 +23,11 @@ module Decidim
|
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
|
+
# This method is required by action_authorized_button_to
|
27
|
+
def current_component
|
28
|
+
controller.try(:current_component)
|
29
|
+
end
|
30
|
+
|
26
31
|
def button_classes
|
27
32
|
options[:button_classes] || "button button__sm button__text-secondary only:m-auto"
|
28
33
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<template id="marker-popup">
|
2
|
+
<div class="space-y-6">
|
3
|
+
<a href="${link}" class="card__list">
|
4
|
+
<div class="card__list-content">
|
5
|
+
<h3 class="h4 card__list-title">${title}</h3>
|
6
|
+
<div class="card__list-metadata">
|
7
|
+
{{each JSON.parse(items)}}
|
8
|
+
<span>{{html icon}}${text}</span>
|
9
|
+
{{/each}}
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</a>
|
13
|
+
</div>
|
14
|
+
</template>
|