decidim-core 0.29.3 → 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/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_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/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/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 +7 -6
- data/app/commands/decidim/create_user_group.rb +6 -2
- data/app/commands/decidim/destroy_ephemeral_user.rb +47 -0
- 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/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 +1 -1
- 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 +14 -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/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/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/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/reported_mailer.rb +0 -1
- 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/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/_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 +2 -6
- 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/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/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/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/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 +1 -17
- 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/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/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 +1 -1
- 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/shared/_layout_item.html.erb +1 -1
- data/config/assets.rb +2 -1
- data/config/locales/ar.yml +29 -74
- data/config/locales/bg.yml +27 -74
- data/config/locales/bs-BA.yml +0 -2
- data/config/locales/ca.yml +369 -90
- data/config/locales/cs.yml +370 -84
- data/config/locales/de.yml +348 -72
- data/config/locales/el.yml +16 -58
- data/config/locales/en.yml +349 -70
- data/config/locales/eo.yml +0 -4
- data/config/locales/es-MX.yml +362 -86
- data/config/locales/es-PY.yml +367 -91
- data/config/locales/es.yml +369 -90
- data/config/locales/eu.yml +422 -140
- data/config/locales/fi-plain.yml +360 -76
- data/config/locales/fi.yml +364 -77
- data/config/locales/fr-CA.yml +172 -83
- data/config/locales/fr.yml +172 -80
- data/config/locales/ga-IE.yml +4 -25
- data/config/locales/gl.yml +15 -58
- data/config/locales/hu.yml +24 -62
- data/config/locales/id-ID.yml +16 -57
- data/config/locales/is-IS.yml +0 -25
- data/config/locales/it.yml +31 -94
- data/config/locales/ja.yml +226 -97
- data/config/locales/lb.yml +23 -76
- data/config/locales/lt.yml +18 -64
- data/config/locales/lv.yml +16 -58
- data/config/locales/nl.yml +18 -75
- data/config/locales/no.yml +18 -70
- data/config/locales/pl.yml +24 -72
- data/config/locales/pt-BR.yml +35 -63
- data/config/locales/pt.yml +18 -70
- data/config/locales/ro-RO.yml +109 -188
- data/config/locales/ru.yml +8 -43
- data/config/locales/sk.yml +19 -70
- data/config/locales/sl.yml +0 -4
- data/config/locales/sr-CS.yml +0 -2
- data/config/locales/sv.yml +127 -79
- data/config/locales/tr-TR.yml +24 -74
- data/config/locales/uk.yml +1 -29
- data/config/locales/zh-CN.yml +16 -68
- data/config/locales/zh-TW.yml +17 -62
- data/config/routes.rb +4 -10
- data/db/migrate/20181025082245_add_timestamps_to_components.rb +2 -0
- 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 +1 -1
- 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 +202 -110
- 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/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 -2111
- 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
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# This cell renders an announcement of pending onboarding action
|
5
|
+
# if exists for a user
|
6
|
+
#
|
7
|
+
# The `model` is expected to be a user
|
8
|
+
#
|
9
|
+
class OnboardingActionMessageCell < Decidim::ViewModel
|
10
|
+
include ActiveLinkTo
|
11
|
+
|
12
|
+
alias user model
|
13
|
+
|
14
|
+
def show
|
15
|
+
return if is_active_link?(onboarding_path)
|
16
|
+
return unless onboarding_manager.valid?
|
17
|
+
return unless onboarding_manager.pending_action?
|
18
|
+
return if authorization_status == :unauthorized
|
19
|
+
return if pending_authorization_link_active?
|
20
|
+
return if ephemeral_authorized?
|
21
|
+
|
22
|
+
render :show
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def onboarding_path
|
28
|
+
decidim_verifications.onboarding_pending_authorizations_path
|
29
|
+
end
|
30
|
+
|
31
|
+
def onboarding_manager
|
32
|
+
@onboarding_manager ||= OnboardingManager.new(user)
|
33
|
+
end
|
34
|
+
|
35
|
+
def authorizations
|
36
|
+
@authorizations ||= action_authorized_to(onboarding_manager.action, **onboarding_manager.action_authorized_resources)
|
37
|
+
end
|
38
|
+
|
39
|
+
def authorization_status
|
40
|
+
@authorization_status ||= authorizations.global_code
|
41
|
+
end
|
42
|
+
|
43
|
+
def pending_authorization_link_active?
|
44
|
+
return unless authorizations.single_authorization_required?
|
45
|
+
|
46
|
+
is_active_link? authorizations.statuses.first.current_path
|
47
|
+
end
|
48
|
+
|
49
|
+
def message_text
|
50
|
+
t(
|
51
|
+
"cta_html",
|
52
|
+
scope: "decidim.onboarding_action_message",
|
53
|
+
link_text:,
|
54
|
+
path: onboarding_path,
|
55
|
+
action: onboarding_manager.action_text.downcase,
|
56
|
+
resource_name: onboarding_manager.model_name.human.downcase,
|
57
|
+
resource_title: decidim_sanitize_translated(onboarding_manager.model_title)
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def link_text
|
62
|
+
if onboarding_manager.finished_verifications?
|
63
|
+
t("click_link", scope: "decidim.onboarding_action_message")
|
64
|
+
else
|
65
|
+
t("finish_authorization_process", scope: "decidim.onboarding_action_message")
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def ephemeral_authorized?
|
70
|
+
user.ephemeral? && authorization_status == :ok
|
71
|
+
end
|
72
|
+
|
73
|
+
def info_icon
|
74
|
+
icon("information-line")
|
75
|
+
end
|
76
|
+
|
77
|
+
def close_icon
|
78
|
+
icon("close-line")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -3,9 +3,7 @@
|
|
3
3
|
<%= render :metadata %>
|
4
4
|
<%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", model, hide_participatory_space: true %>
|
5
5
|
</div>
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
</ul>
|
10
|
-
</nav>
|
6
|
+
<ul class="menu-bar__secondary-dropdown__menu">
|
7
|
+
<%= render :links %>
|
8
|
+
</ul>
|
11
9
|
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="profile__user">
|
2
|
+
<div class="profile__user-avatar-container">
|
3
|
+
<div class="<%= has_profile? ? "profile__user-avatar" : "profile__user-avatar !border-0" %>">
|
4
|
+
<%= image_tag(has_profile? ? model.avatar_url(:big) : model.non_user_avatar_path, alt: "member-avatar") %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
<div>
|
8
|
+
<div class="<%= has_profile? ? "profile__user-name" : "profile__user-name !no-underline" %>">
|
9
|
+
<%= name %>
|
10
|
+
</div>
|
11
|
+
<% if nickname.present? %>
|
12
|
+
<span class="profile__user-nick block">
|
13
|
+
<%= nickname %>
|
14
|
+
</span>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<div class="mt-3">
|
18
|
+
<span class="text-gray-2 capitalize font-semibold">
|
19
|
+
<%= role_translated %>
|
20
|
+
</span>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# This cell renders the card for an instance of an Assembly member
|
5
|
+
class ParticipatorySpacePrivateUserCell < Decidim::ViewModel
|
6
|
+
property :name
|
7
|
+
property :role
|
8
|
+
property :nickname
|
9
|
+
property :profile_url
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def has_profile?
|
14
|
+
model.profile_url.present?
|
15
|
+
end
|
16
|
+
|
17
|
+
def role_translated
|
18
|
+
decidim_html_escape(decidim_sanitize(translated_attribute(role)))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
<div class="card profile--sidebar">
|
2
|
+
<%= image_tag profile_user.avatar_url(:profile), class: "card__image card__image--larger", alt: "avatar #{profile_user.name}" %>
|
3
|
+
<div>
|
4
|
+
<h1>
|
5
|
+
<strong><%= profile_user.name %></strong>
|
6
|
+
<br>
|
7
|
+
<span>
|
8
|
+
<%= profile_user.nickname %> <br>
|
9
|
+
</span>
|
10
|
+
<% if user_flaggable? %>
|
11
|
+
<span class="user-report_link">
|
12
|
+
<%== cell("decidim/author", profile_user, from:profile_user).flag_user %>
|
13
|
+
</span>
|
14
|
+
|
15
|
+
<% end %>
|
16
|
+
<% if can_contact_user? %>
|
17
|
+
<span>
|
18
|
+
<%= link_to_current_or_new_conversation_with(profile_holder) %>
|
19
|
+
</span>
|
20
|
+
<% end %>
|
21
|
+
</h1>
|
22
|
+
<div>
|
23
|
+
<small><%= decidim_html_escape(profile_user.about.to_s) %></small>
|
24
|
+
</div>
|
25
|
+
<% if profile_user.personal_url.present? %>
|
26
|
+
<%= link_to html_truncate(profile_user.personal_url.gsub(%r{https?\:\/\/}, ""), length: 30), profile_user.personal_url, rel: "nofollow noopener noreferrer ugc" %>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
<% if profile_user.badge.present? %>
|
30
|
+
<div>
|
31
|
+
<span>
|
32
|
+
<%= icon profile_user.badge, class: "author__verified", aria_label: t("decidim.profiles.show.officialized"), role: "img" %>
|
33
|
+
</span>
|
34
|
+
<span>
|
35
|
+
<%= officialization_text %>
|
36
|
+
</span>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
<%= render_hook(:user_profile_bottom) %>
|
40
|
+
<div>
|
41
|
+
<div class="text-center">
|
42
|
+
<% if profile_user_can_follow? %>
|
43
|
+
<div>
|
44
|
+
<%= link_to profile_followers_path(nickname: profile_holder.nickname) do %>
|
45
|
+
<%= t("decidim.profiles.show.followers") %>
|
46
|
+
<div><strong><%= profile_user.followers_count %></strong></div>
|
47
|
+
<% end %>
|
48
|
+
</div>
|
49
|
+
<div>
|
50
|
+
<%= link_to profile_following_path(nickname: profile_holder.nickname) do %>
|
51
|
+
<%= t("decidim.profiles.show.following") %>
|
52
|
+
<div><strong><%= profile_user.following_count %></strong></div>
|
53
|
+
<% end %>
|
54
|
+
</div>
|
55
|
+
<% else %>
|
56
|
+
<div>
|
57
|
+
<%= link_to profile_followers_path(nickname: profile_holder.nickname) do %>
|
58
|
+
<%= t("decidim.profiles.show.followers") %>
|
59
|
+
<div><%= profile_user.followers_count %></div>
|
60
|
+
<% end %>
|
61
|
+
</div>
|
62
|
+
<div>
|
63
|
+
<%= link_to profile_members_path(nickname: profile_holder.nickname) do %>
|
64
|
+
<%= t("decidim.profiles.show.members") %>
|
65
|
+
<div><%= profile_user.members_count %></div>
|
66
|
+
<% end %>
|
67
|
+
</div>
|
68
|
+
<% end %>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<% if current_organization.badges_enabled? && badge_statuses.any? %>
|
73
|
+
<div>
|
74
|
+
<div>
|
75
|
+
<div class="row column">
|
76
|
+
<strong><%= t("decidim.profiles.sidebar.badges.title") %></strong>
|
77
|
+
<div>
|
78
|
+
<div data-tooltip data-position="top" title="<%= t("decidim.profiles.sidebar.badges.info") %>" data-yeti-box="badges-tooltip" data-toggle="badges-tooltip" data-resize="badges-tooltip" data-events="resize">
|
79
|
+
<%= icon "info", class: "icon--small", role: "img", "aria-hidden": true %>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
<div class="row collapse">
|
84
|
+
<% badge_statuses.each do |status| %>
|
85
|
+
<div class="column">
|
86
|
+
<div>
|
87
|
+
<%= cell("decidim/badge", profile_holder, badge: status.badge, status:).call(:small) %>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
<% end %>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
<% end %>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div class="row">
|
98
|
+
<div class="column">
|
99
|
+
<% if own_profile? %>
|
100
|
+
<div class="text-center">
|
101
|
+
<%= link_to decidim.account_path, class: "button" do %>
|
102
|
+
<span>
|
103
|
+
<%= t("decidim.profiles.user.edit_profile") %>
|
104
|
+
</span>
|
105
|
+
<% end %>
|
106
|
+
</div>
|
107
|
+
<% if user_groups_enabled? %>
|
108
|
+
<div class="text-center">
|
109
|
+
<%= link_to decidim.new_group_path, class: "button hollow" do %>
|
110
|
+
<span>
|
111
|
+
<%= t("decidim.profiles.user.create_user_group") %>
|
112
|
+
</span>
|
113
|
+
<% end %>
|
114
|
+
</div>
|
115
|
+
<% end %>
|
116
|
+
<% elsif logged_in? %>
|
117
|
+
<%= cell "decidim/follow_button", profile_holder %>
|
118
|
+
<% end %>
|
119
|
+
|
120
|
+
<% if user_groups_enabled? %>
|
121
|
+
<% if can_edit_user_group_profile? %>
|
122
|
+
<% if user_group_email_to_be_confirmed? %>
|
123
|
+
<div class="text-center">
|
124
|
+
<%= link_to decidim.group_email_confirmation_path(model.nickname), method: :post, class: "button hollow expanded" do %>
|
125
|
+
<span>
|
126
|
+
<%= t("decidim.profiles.user.resend_email_confirmation_instructions") %>
|
127
|
+
</span>
|
128
|
+
<% end %>
|
129
|
+
</div>
|
130
|
+
<% end %>
|
131
|
+
|
132
|
+
<div class="text-center">
|
133
|
+
<%= link_to t("decidim.profiles.user.edit_user_group"), edit_group_path(profile_holder.nickname) %>
|
134
|
+
</div>
|
135
|
+
<div class="text-center">
|
136
|
+
<%= link_to t("decidim.profiles.user.manage_user_group_users"), profile_group_members_path(profile_holder.nickname) %>
|
137
|
+
</div>
|
138
|
+
<div class="text-center">
|
139
|
+
<%= link_to t("decidim.profiles.user.manage_user_group_admins"), profile_group_admins_path(profile_holder.nickname) %>
|
140
|
+
</div>
|
141
|
+
<div class="text-center">
|
142
|
+
<%= link_to t("decidim.profiles.user.invite_user"), group_invites_path(profile_holder.nickname) %>
|
143
|
+
</div>
|
144
|
+
<% end %>
|
145
|
+
|
146
|
+
<% if can_join_user_group? %>
|
147
|
+
<div class="text-center">
|
148
|
+
<%= link_to decidim.group_join_requests_path(model.nickname), method: :post, class: "button hollow expanded" do %>
|
149
|
+
<span>
|
150
|
+
<%= t("decidim.profiles.user.join_user_group") %>
|
151
|
+
</span>
|
152
|
+
<% end %>
|
153
|
+
</div>
|
154
|
+
<% end %>
|
155
|
+
|
156
|
+
<% if can_leave_group? %>
|
157
|
+
<div class="text-center">
|
158
|
+
<%= link_to decidim.leave_group_path(model.nickname), method: :delete, data: { confirm: t("decidim.groups.actions.are_you_sure") }, class: "button hollow expanded" do %>
|
159
|
+
<span>
|
160
|
+
<%= t("decidim.profiles.user.leave_user_group") %>
|
161
|
+
</span>
|
162
|
+
<% end %>
|
163
|
+
</div>
|
164
|
+
<% end %>
|
165
|
+
<% end %>
|
166
|
+
</div>
|
167
|
+
</div>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
class ProfileSidebarCell < Decidim::ProfileCell
|
5
|
+
include Decidim::Messaging::ConversationHelper
|
6
|
+
include Decidim::ViewHooksHelper
|
7
|
+
include Decidim::CellsHelper
|
8
|
+
|
9
|
+
helper_method :profile_user
|
10
|
+
|
11
|
+
def show
|
12
|
+
render :show
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def profile_user
|
18
|
+
@profile_user ||= present(model)
|
19
|
+
end
|
20
|
+
|
21
|
+
def can_contact_user?
|
22
|
+
!current_user || (current_user && current_user != model && profile_user.can_be_contacted?)
|
23
|
+
end
|
24
|
+
|
25
|
+
def officialization_text
|
26
|
+
profile_user.officialization_text
|
27
|
+
end
|
28
|
+
|
29
|
+
def can_edit_user_group_profile?
|
30
|
+
return false unless current_user
|
31
|
+
return false if model.is_a?(Decidim::User)
|
32
|
+
|
33
|
+
Decidim::UserGroups::ManageableUserGroups.for(current_user).include?(model)
|
34
|
+
end
|
35
|
+
|
36
|
+
def profile_user_can_follow?
|
37
|
+
profile_user.can_follow?
|
38
|
+
end
|
39
|
+
|
40
|
+
def badge_statuses
|
41
|
+
Decidim::Gamification.badges.select { |badge| badge.valid_for?(profile_holder) }.map do |badge|
|
42
|
+
status = Decidim::Gamification.status_for(profile_holder, badge.name)
|
43
|
+
status.level.positive? ? status : nil
|
44
|
+
end.compact
|
45
|
+
end
|
46
|
+
|
47
|
+
def can_join_user_group?
|
48
|
+
return false unless current_user
|
49
|
+
return false if model.is_a?(Decidim::User)
|
50
|
+
|
51
|
+
Decidim::UserGroupMembership.where(user: current_user, user_group: model).empty?
|
52
|
+
end
|
53
|
+
|
54
|
+
def can_leave_group?
|
55
|
+
return false unless current_user
|
56
|
+
return false if model.is_a?(Decidim::User)
|
57
|
+
|
58
|
+
Decidim::UserGroupMembership.where(user: current_user, user_group: model).any?
|
59
|
+
end
|
60
|
+
|
61
|
+
def user_group_email_to_be_confirmed?
|
62
|
+
return false unless current_user
|
63
|
+
return false if model.is_a?(Decidim::User)
|
64
|
+
|
65
|
+
!model.confirmed?
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -5,12 +5,12 @@
|
|
5
5
|
</div>
|
6
6
|
|
7
7
|
<div class="proposals__aside-progress">
|
8
|
-
<%= content_tag :div, units_name_text, class: "progress-bar__units" if units_name %>
|
9
|
-
|
10
8
|
<% if total != 0 %>
|
11
9
|
<div class="progress-bar" role="progressbar" aria-label="<%= units_name.present? ? units_name_text : t("decidim.shared.progress") %>" aria-valuenow="<%= number_with_precision(percentage, separator: ".", precision: 2) %>" aria-valuemin="0" aria-valuemax="100" aria-valuetext="<%= number_to_percentage(percentage, precision: 2) %>">
|
12
10
|
<div style="width: <%= percentage %>%"></div>
|
13
11
|
</div>
|
14
12
|
<% end %>
|
15
13
|
</div>
|
14
|
+
<%= content_tag :div, units_name_text, class: "progress-bar__units" if units_name %>
|
15
|
+
|
16
16
|
</div>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<%= decidim_modal id: modal_id, class: "flag-modal" do %>
|
2
2
|
<div data-dialog-container>
|
3
3
|
<%= icon "flag-line" %>
|
4
|
-
<h2 tabindex="-1" data-dialog-title><%= t("decidim.shared.flag_modal.title") %></h2>
|
4
|
+
<h2 id="dialog-title-flagModal" tabindex="-1" data-dialog-title><%= t("decidim.shared.flag_modal.title") %></h2>
|
5
5
|
<div>
|
6
6
|
<div class="form__wrapper flag-modal__form">
|
7
|
-
<p class="flag-modal__form-description"><%= t("decidim.shared.flag_modal.already_reported") %></p>
|
7
|
+
<p id="dialog-desc-flagModal" class="flag-modal__form-description"><%= t("decidim.shared.flag_modal.already_reported") %></p>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
10
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= form_for report_form, builder:, url: report_path, method: :post, html: { id: nil } do |f| %>
|
3
3
|
<div data-dialog-container>
|
4
4
|
<%= icon "flag-line" %>
|
5
|
-
<h2 tabindex="-1" data-dialog-title><%= t("decidim.shared.flag_modal.title") %></h2>
|
5
|
+
<h2 id="dialog-title-<%= modal_id %>" tabindex="-1" data-dialog-title><%= t("decidim.shared.flag_modal.title") %></h2>
|
6
6
|
<div>
|
7
7
|
<div class="form__wrapper flag-modal__form">
|
8
8
|
<p id="dialog-desc-<%= modal_id %>" class="flag-modal__form-description"><%= t("decidim.shared.flag_modal.description") %></p>
|
@@ -18,18 +18,32 @@
|
|
18
18
|
<%= f.text_area :details, rows: 4, label_options: { class: "flag-modal__form-textarea-label", for: nil }, id: nil %>
|
19
19
|
|
20
20
|
<% if frontend_administrable? %>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
21
|
+
<% if user_reportable? %>
|
22
|
+
<% if current_user&.admin? %>
|
23
|
+
<%= f.check_box :block,
|
24
|
+
label: t("decidim.shared.flag_user_modal.block"),
|
25
|
+
include_hidden: false,
|
26
|
+
data: {
|
27
|
+
label_action: t("decidim.shared.flag_user_modal.block"),
|
28
|
+
label_report: t("decidim.shared.flag_user_modal.report"),
|
29
|
+
block: "true"
|
30
|
+
} %>
|
31
|
+
<%= f.check_box :hide, label: t("decidim.shared.flag_user_modal.hide"), label_options: { class: :invisible, id: "block_and_hide" } %>
|
32
|
+
<% end %>
|
33
|
+
<% else %>
|
34
|
+
<%= f.check_box :hide,
|
35
|
+
label: t("decidim.shared.flag_modal.hide_content"),
|
36
|
+
include_hidden: false,
|
37
|
+
id: hide_checkbox_id,
|
38
|
+
data: {
|
39
|
+
label_action: t("decidim.shared.flag_modal.hide"),
|
40
|
+
label_report: t("decidim.shared.flag_modal.report"),
|
41
|
+
hide: "true"
|
42
|
+
},
|
43
|
+
label_options: {
|
44
|
+
for: hide_checkbox_id
|
45
|
+
} %>
|
46
|
+
<% end %>
|
33
47
|
<% end %>
|
34
48
|
|
35
49
|
</div>
|
@@ -11,6 +11,8 @@ module Decidim
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def frontend_administrable?
|
14
|
+
return true if user_reportable? && current_user&.admin?
|
15
|
+
|
14
16
|
user_entity? &&
|
15
17
|
model.can_be_administered_by?(current_user) &&
|
16
18
|
(model.respond_to?(:official?) && !model.official?)
|
@@ -30,6 +32,7 @@ module Decidim
|
|
30
32
|
def cache_hash
|
31
33
|
hash = []
|
32
34
|
hash.push(I18n.locale)
|
35
|
+
hash.push(only_button? ? 1 : 0)
|
33
36
|
hash.push(current_user.try(:id))
|
34
37
|
hash.push(model.reported_by?(current_user) ? 1 : 0)
|
35
38
|
hash.push(model.class.name.gsub("::", ":"))
|
@@ -45,12 +48,16 @@ module Decidim
|
|
45
48
|
options[:modal_id] || "flagModal"
|
46
49
|
end
|
47
50
|
|
51
|
+
def user_reportable?
|
52
|
+
model.is_a?(Decidim::UserReportable)
|
53
|
+
end
|
54
|
+
|
48
55
|
def report_form
|
49
|
-
@report_form ||= Decidim::ReportForm.new(reason: "spam")
|
56
|
+
@report_form ||= user_reportable? ? Decidim::ReportForm.from_params(reason: "spam") : Decidim::ReportForm.new(reason: "spam")
|
50
57
|
end
|
51
58
|
|
52
59
|
def report_path
|
53
|
-
@report_path ||= decidim.report_path(sgid: model.to_sgid.to_s)
|
60
|
+
@report_path ||= user_reportable? ? decidim.report_user_path(sgid: model.to_sgid.to_s) : decidim.report_path(sgid: model.to_sgid.to_s)
|
54
61
|
end
|
55
62
|
|
56
63
|
def builder
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<ul class="resource_history">
|
2
|
+
<% history_items.each_with_index do |item, index| %>
|
3
|
+
<li class="resource_history__item">
|
4
|
+
<div class="resource_history__item_icon">
|
5
|
+
<div class="<%= item[:id] == "#{history_cell_id}_creation" ? "resource_history__item_icon-creation" : "" %>">
|
6
|
+
<%= icon item[:icon], class: item[:id] == "#{history_cell_id}_creation" ? "fill-current text-white" : "fill-current text-secondary" %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<div class="resource_history__item_content">
|
10
|
+
<span class="resource_history__item_date"><%= item[:date].strftime("%d/%m/%Y %H:%M") %></span>
|
11
|
+
<p class="resource_history_text">
|
12
|
+
<%= item[:text] %>
|
13
|
+
<% if index < history_items.size - 1 %>
|
14
|
+
<span class="resource_history__line"></span>
|
15
|
+
<% end %>
|
16
|
+
</p>
|
17
|
+
</div>
|
18
|
+
</li>
|
19
|
+
<% end %>
|
20
|
+
</ul>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
class ResourceHistoryCell < Decidim::ViewModel
|
5
|
+
def show
|
6
|
+
render
|
7
|
+
end
|
8
|
+
|
9
|
+
def history_items
|
10
|
+
return @history_items if @history_items.present?
|
11
|
+
|
12
|
+
@history_items = []
|
13
|
+
linked_resources_items.each do |item|
|
14
|
+
add_linked_resources_items(item[:resources], item)
|
15
|
+
end
|
16
|
+
|
17
|
+
@history_items << creation_item if @history_items.any?
|
18
|
+
|
19
|
+
@history_items.sort_by! { |item| item[:date] }
|
20
|
+
end
|
21
|
+
|
22
|
+
# return an unique id to identify the type of history cell
|
23
|
+
def history_cell_id
|
24
|
+
raise NotImplementedError
|
25
|
+
end
|
26
|
+
|
27
|
+
# return an array of linked resources to show in the history
|
28
|
+
def linked_resources_items
|
29
|
+
raise NotImplementedError
|
30
|
+
end
|
31
|
+
|
32
|
+
# return the creation item to show in the history, it will be added only if there are linked resources
|
33
|
+
def creation_item
|
34
|
+
raise NotImplementedError
|
35
|
+
end
|
36
|
+
|
37
|
+
def render?
|
38
|
+
linked_resources_items.any? { |item| item[:resources].present? }
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def add_linked_resources_items(resources, options)
|
44
|
+
return if resources.blank?
|
45
|
+
|
46
|
+
resources.each do |resource|
|
47
|
+
title = decidim_sanitize_translated(resource.title)
|
48
|
+
url = resource_locator(resource).path
|
49
|
+
link = link_to(title, url, class: "underline decoration-current text-secondary font-semibold")
|
50
|
+
|
51
|
+
@history_items << {
|
52
|
+
id: "#{options[:link_name]}_#{resource.id}",
|
53
|
+
date: resource.updated_at,
|
54
|
+
text: t(options[:text_key], scope: "activerecord.models", link:),
|
55
|
+
icon: resource_type_icon_key(options[:icon_key])
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def history_items_contains?(link_name)
|
61
|
+
return false if @history_items.blank?
|
62
|
+
|
63
|
+
@history_items.any? { |item| item[:id].include?(link_name.to_s) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<ul id="dropdown-menu-resource">
|
12
12
|
<% resource_types.each do |resource_type| %>
|
13
13
|
<li role="menuitem">
|
14
|
-
<%= link_to
|
14
|
+
<%= link_to decidim.last_activities_path(filter: { with_resource_type: resource_type[0] } ), class: "filter#{" is-active" if filter_param == resource_type[0]}" do %>
|
15
15
|
<span class="sr-only"><%= resource_type[1] %></span>
|
16
16
|
<%= text_with_resource_icon(*resource_type) %>
|
17
17
|
<% end %>
|
@@ -27,12 +27,8 @@ module Decidim
|
|
27
27
|
options[:id] || "filters"
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
31
|
-
|
32
|
-
last_activities_path(filter: { with_resource_type: resource_type })
|
33
|
-
else
|
34
|
-
profile_activity_path(nickname: params[:nickname], filter: { resource_type: })
|
35
|
-
end
|
30
|
+
def form_path
|
31
|
+
options[:form_path]
|
36
32
|
end
|
37
33
|
|
38
34
|
def filter_param_key
|
@@ -43,6 +39,10 @@ module Decidim
|
|
43
39
|
@filter_param ||= params.dig(:filter, filter_param_key) || all_types_key
|
44
40
|
end
|
45
41
|
|
42
|
+
def filter
|
43
|
+
options[:filter]
|
44
|
+
end
|
45
|
+
|
46
46
|
def all_resource_types_option
|
47
47
|
[all_types_key, I18n.t("all", scope: "decidim.last_activities")]
|
48
48
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= decidim_modal id: "socialShare", class: "share-modal" do %>
|
2
|
+
<div data-dialog-container>
|
3
|
+
<%= icon "share-line" %>
|
4
|
+
<h2 id="dialog-title-socialShare" tabindex="-1" data-dialog-title><%= t("share", scope: "decidim.shared.share_modal") %></h2>
|
5
|
+
<div>
|
6
|
+
<%= social_share_button_tag(decidim_page_title,
|
7
|
+
url: decidim_meta_url,
|
8
|
+
image: decidim_meta_image_url,
|
9
|
+
desc: decidim_html_escape(decidim_meta_description || ""),
|
10
|
+
via: decidim_meta_twitter_handler) %>
|
11
|
+
|
12
|
+
<div class="share-modal__input">
|
13
|
+
<input id="urlShareLink" type="text" title="<%= t("share_link" , scope: "decidim.shared.share_modal") %>" value="<%= resource_name ? short_url(route_name: resource_name, params:) : decidim_meta_url %>" readonly>
|
14
|
+
<button type="button"
|
15
|
+
class="button button__sm button__text-secondary"
|
16
|
+
data-clipboard-copy="#urlShareLink"
|
17
|
+
data-clipboard-copy-label="<%= t("copy_share_link_copied", scope: "decidim.shared.share_modal") %>"
|
18
|
+
data-clipboard-copy-message="<%= t("copy_share_link_message", scope: "decidim.shared.share_modal") %>"
|
19
|
+
title="<%= t("copy_share_link_clarification", scope: "decidim.shared.share_modal") %>">
|
20
|
+
<span><%= t("copy_share_link", scope: "decidim.shared.share_modal") %></span>
|
21
|
+
<%= icon "file-copy-line" %>
|
22
|
+
</button>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<% end %>
|