decidim-core 0.19.1 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +19 -0
- data/app/assets/config/decidim_core_manifest.js +8 -0
- data/app/assets/fonts/decidim/Roboto-Regular.eot +0 -0
- data/app/assets/fonts/decidim/Roboto-Regular.svg +1 -0
- data/app/assets/fonts/decidim/Roboto-Regular.ttf +0 -0
- data/app/assets/fonts/decidim/Roboto-Regular.woff +0 -0
- data/app/assets/fonts/decidim/Roboto-Regular.woff2 +0 -0
- data/app/assets/fonts/decidim/Source_Sans_Pro_400.svg +1 -345
- data/app/assets/fonts/decidim/Source_Sans_Pro_600.svg +1 -339
- data/app/assets/fonts/decidim/Source_Sans_Pro_900.svg +1 -342
- data/app/assets/images/decidim/avatar-multiuser.png +0 -0
- data/app/assets/images/decidim/brands/google.svg +1 -0
- data/app/assets/images/decidim/decidim-logo.svg +1 -71
- data/app/assets/images/decidim/default-avatar.svg +1 -14
- data/app/assets/images/decidim/gamification/badges/followers.svg +1 -115
- data/app/assets/images/decidim/gamification/badges/invitations.svg +1 -117
- data/app/assets/images/decidim/icons.svg +1 -259
- data/app/assets/images/decidim/placeholder.jpg +0 -0
- data/app/assets/javascripts/decidim.js.es6 +32 -2
- data/app/assets/javascripts/decidim/ajax_modals.js.es6 +6 -3
- data/app/assets/javascripts/decidim/assets.js.erb +5 -0
- data/app/assets/javascripts/decidim/callout.js.es6 +18 -0
- data/app/assets/javascripts/decidim/check_boxes_tree.js.es6 +190 -0
- data/app/assets/javascripts/decidim/configuration.js.es6 +23 -0
- data/app/assets/javascripts/decidim/confirm.js.es6 +179 -0
- data/app/assets/javascripts/decidim/conversations.js.es6 +17 -0
- data/app/assets/javascripts/decidim/core/bundle.js +1 -1
- data/app/assets/javascripts/decidim/core/bundle.js.map +1 -1
- data/app/assets/javascripts/decidim/core/extrapoly.js +6 -0
- data/app/assets/javascripts/decidim/data_picker.js.es6 +128 -50
- data/app/assets/javascripts/decidim/delayed.js.es6 +26 -0
- data/app/assets/javascripts/decidim/diff_mode_dropdown.js.es6 +39 -6
- data/app/assets/javascripts/decidim/dropdowns_menus.js.es6 +32 -0
- data/app/assets/javascripts/decidim/editor.js.es6 +3 -3
- data/app/assets/javascripts/decidim/external_link.js.es6 +69 -0
- data/app/assets/javascripts/decidim/floating_help.js.es6 +7 -0
- data/app/assets/javascripts/decidim/form_filter.component.js.es6 +87 -39
- data/app/assets/javascripts/decidim/form_filter.component.test.js +43 -9
- data/app/assets/javascripts/decidim/form_validator.es6 +61 -0
- data/app/assets/javascripts/decidim/foundation.js.es6 +28 -28
- data/app/assets/javascripts/decidim/geocoding.js.es6 +60 -0
- data/app/assets/javascripts/decidim/geocoding/attach_input.js.es6 +106 -0
- data/app/assets/javascripts/decidim/geocoding/format_address.js.es6 +29 -0
- data/app/assets/javascripts/decidim/geocoding/provider/here.js.es6 +107 -0
- data/app/assets/javascripts/decidim/geocoding/provider/photon.js.es6 +77 -0
- data/app/assets/javascripts/decidim/history.js.es6 +16 -1
- data/app/assets/javascripts/decidim/icon.js.es6 +42 -0
- data/app/assets/javascripts/decidim/identity_selector_dialog.js.es6 +61 -0
- data/app/assets/javascripts/decidim/input_character_counter.js.es6 +115 -0
- data/app/assets/javascripts/decidim/input_hashtags.js.es6 +1 -1
- data/app/assets/javascripts/decidim/input_mentions.js.es6 +138 -51
- data/app/assets/javascripts/decidim/input_multiple_mentions.js.es6 +195 -0
- data/app/assets/javascripts/decidim/map.js.es6 +35 -84
- data/app/assets/javascripts/decidim/map/controller.js.es6 +92 -0
- data/app/assets/javascripts/decidim/map/controller/markers.js.es6 +65 -0
- data/app/assets/javascripts/decidim/map/controller/static.es6 +48 -0
- data/app/assets/javascripts/decidim/map/factory.js.es6 +51 -0
- data/app/assets/javascripts/decidim/map/icon.js.es6 +31 -0
- data/app/assets/javascripts/decidim/map/legacy.js.es6 +87 -0
- data/app/assets/javascripts/decidim/map/provider/default.js.es6 +22 -0
- data/app/assets/javascripts/decidim/map/provider/here.js.es6 +22 -0
- data/app/assets/javascripts/decidim/orders.js.es6 +9 -28
- data/app/assets/javascripts/decidim/responsive_horizontal_tabs.js.es6 +12 -0
- data/app/assets/javascripts/decidim/results_listing.js.es6 +44 -0
- data/app/assets/javascripts/decidim/security/selfxss_warning.js.es6 +19 -0
- data/app/assets/javascripts/decidim/start_conversation_dialog.js +13 -0
- data/app/assets/javascripts/decidim/vizzs.js.es6 +1 -0
- data/app/assets/stylesheets/decidim/_decidim-settings.scss +5 -0
- data/app/assets/stylesheets/decidim/_decidim.scss +15 -11
- data/app/assets/stylesheets/decidim/_properties.scss +25 -0
- data/app/assets/stylesheets/decidim/_variables.scss +7 -25
- data/app/assets/stylesheets/decidim/application.scss.erb +2 -2
- data/app/assets/stylesheets/decidim/editor.scss +2 -2
- data/app/assets/stylesheets/decidim/email.scss +1771 -0
- data/app/assets/stylesheets/decidim/extras/_external-links.scss +29 -0
- data/app/assets/stylesheets/decidim/extras/_extras.scss +17 -0
- data/app/assets/stylesheets/decidim/extras/_label-required.scss +9 -0
- data/app/assets/stylesheets/decidim/extras/_process_stats.scss +1 -1
- data/app/assets/stylesheets/decidim/extras/_quill.scss +5 -0
- data/app/assets/stylesheets/decidim/extras/_results-per-page.scss +8 -1
- data/app/assets/stylesheets/decidim/layouts/_home.scss +31 -7
- data/app/assets/stylesheets/decidim/layouts/_layouts.scss +5 -0
- data/app/assets/stylesheets/decidim/layouts/_logo.scss +26 -0
- data/app/assets/stylesheets/decidim/layouts/_user.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_author-avatar.scss +9 -13
- data/app/assets/stylesheets/decidim/modules/_buttons.scss +273 -28
- data/app/assets/stylesheets/decidim/modules/_cards.scss +189 -23
- data/app/assets/stylesheets/decidim/modules/_collapsible-list.scss +21 -0
- data/app/assets/stylesheets/decidim/modules/_comments.scss +102 -2
- data/app/assets/stylesheets/decidim/modules/_conference-programme.scss +0 -1
- data/app/assets/stylesheets/decidim/modules/_confirm.scss +5 -0
- data/app/assets/stylesheets/decidim/modules/_conversation.scss +50 -0
- data/app/assets/stylesheets/decidim/modules/_data-picker.scss +9 -11
- data/app/assets/stylesheets/decidim/modules/_definition-data.scss +6 -1
- data/app/assets/stylesheets/decidim/modules/_docs-manager.scss +0 -1
- data/app/assets/stylesheets/decidim/modules/_extra.scss +0 -2
- data/app/assets/stylesheets/decidim/modules/_filters.scss +61 -3
- data/app/assets/stylesheets/decidim/modules/_floating-helper.scss +20 -8
- data/app/assets/stylesheets/decidim/modules/_footer.scss +8 -4
- data/app/assets/stylesheets/decidim/modules/_forms.scss +77 -4
- data/app/assets/stylesheets/decidim/modules/_horizontal-tabs.scss +64 -1
- data/app/assets/stylesheets/decidim/modules/_inline-filters.scss +6 -3
- data/app/assets/stylesheets/decidim/modules/_input-gallery.scss +10 -0
- data/app/assets/stylesheets/decidim/modules/_input-mentions.scss +25 -7
- data/app/assets/stylesheets/decidim/modules/_input-multiple-mentions.scss +5 -0
- data/app/assets/stylesheets/decidim/modules/_layout.scss +21 -0
- data/app/assets/stylesheets/decidim/modules/_map.scss +46 -0
- data/app/assets/stylesheets/decidim/modules/_margins.scss +8 -7
- data/app/assets/stylesheets/decidim/modules/_messages.scss +18 -18
- data/app/assets/stylesheets/decidim/modules/_modules.scss +75 -71
- data/app/assets/stylesheets/decidim/modules/_navbar.scss +187 -31
- data/app/assets/stylesheets/decidim/modules/_notification.scss +5 -0
- data/app/assets/stylesheets/decidim/modules/_order-by.scss +5 -0
- data/app/assets/stylesheets/decidim/modules/_process-nav.scss +5 -2
- data/app/assets/stylesheets/decidim/modules/_process-phase.scss +2 -4
- data/app/assets/stylesheets/decidim/modules/_process-stats.scss +53 -0
- data/app/assets/stylesheets/decidim/modules/_progress-bar.scss +5 -1
- data/app/assets/stylesheets/decidim/modules/_reveal.scss +11 -0
- data/app/assets/stylesheets/decidim/modules/_signup.scss +59 -1
- data/app/assets/stylesheets/decidim/modules/_static-pages.scss +0 -1
- data/app/assets/stylesheets/decidim/modules/_status-labels.scss +7 -1
- data/app/assets/stylesheets/decidim/modules/_sticky.scss +5 -0
- data/app/assets/stylesheets/decidim/modules/_tags.scss +11 -1
- data/app/assets/stylesheets/decidim/modules/_timeline.scss +1 -2
- data/app/assets/stylesheets/decidim/modules/_typography.scss +94 -10
- data/app/assets/stylesheets/decidim/modules/_versions.scss +0 -1
- data/app/assets/stylesheets/decidim/utils/_fontface.scss +10 -0
- data/app/assets/stylesheets/decidim/utils/_helpers.scss +8 -0
- data/app/assets/stylesheets/decidim/utils/_mixins.scss +86 -7
- data/app/assets/stylesheets/decidim/utils/_settings.scss +81 -69
- data/app/assets/stylesheets/decidim/utils/_toggle-expand.scss +14 -0
- data/app/assets/stylesheets/decidim/vizzs.scss +8 -0
- data/app/assets/stylesheets/decidim/vizzs/_areachart.scss +0 -1
- data/app/assets/stylesheets/decidim/vizzs/_linechart.scss +0 -1
- data/app/assets/stylesheets/decidim/vizzs/_rowchart.scss +0 -1
- data/app/assets/stylesheets/decidim/vizzs/_vizzs.scss +5 -0
- data/app/assets/stylesheets/foundation-overrides/components/_button-group.scss +319 -0
- data/app/cells/decidim/activity/show.erb +24 -21
- data/app/cells/decidim/activity_cell.rb +2 -0
- data/app/cells/decidim/address_cell.rb +1 -1
- data/app/cells/decidim/amendable/amend_button_card_cell.rb +1 -5
- data/app/cells/decidim/amendable/promote_button_card_cell.rb +1 -1
- data/app/cells/decidim/announcement/show.erb +1 -1
- data/app/cells/decidim/author/comments.erb +1 -1
- data/app/cells/decidim/author/endorsements.erb +6 -0
- data/app/cells/decidim/author/flag.erb +6 -3
- data/app/cells/decidim/author/profile_inline.erb +3 -4
- data/app/cells/decidim/author/show.erb +2 -0
- data/app/cells/decidim/author/withdraw.erb +2 -2
- data/app/cells/decidim/author_cell.rb +12 -13
- data/app/cells/decidim/badge/show.erb +6 -6
- data/app/cells/decidim/badge/small.erb +2 -1
- data/app/cells/decidim/card/show.erb +4 -4
- data/app/cells/decidim/card_cell.rb +21 -7
- data/app/cells/decidim/card_m/comments_counter.erb +1 -1
- data/app/cells/decidim/card_m/header.erb +4 -4
- data/app/cells/decidim/card_m/image.erb +1 -1
- data/app/cells/decidim/card_m/show.erb +3 -3
- data/app/cells/decidim/card_m_cell.rb +9 -6
- data/app/cells/decidim/coauthorships_cell.rb +2 -6
- data/app/cells/decidim/collapsible_authors_cell.rb +1 -1
- data/app/cells/decidim/collapsible_list/show.erb +3 -3
- data/app/cells/decidim/content_blocks/footer_sub_hero/show.erb +4 -4
- data/app/cells/decidim/content_blocks/hero_settings_form/show.erb +2 -2
- data/app/cells/decidim/content_blocks/how_to_participate/show.erb +8 -8
- data/app/cells/decidim/content_blocks/last_activity_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/stats/show.erb +1 -1
- data/app/cells/decidim/content_blocks/sub_hero/show.erb +3 -3
- data/app/cells/decidim/diff/attribute.erb +15 -5
- data/app/cells/decidim/diff/diff_mode_html.erb +31 -0
- data/app/cells/decidim/diff/diff_split.erb +1 -1
- data/app/cells/decidim/diff/diff_unified.erb +1 -1
- data/app/cells/decidim/diff/show.erb +1 -0
- data/app/cells/decidim/diff_cell.rb +35 -16
- data/app/cells/decidim/endorsement_buttons/select_identity_button.erb +10 -0
- data/app/cells/decidim/endorsement_buttons/show.erb +4 -0
- data/app/cells/decidim/endorsement_buttons_cell.rb +208 -0
- data/app/cells/decidim/endorsers_list/show.erb +16 -0
- data/app/cells/decidim/endorsers_list_cell.rb +29 -0
- data/app/cells/decidim/fingerprint_cell.rb +1 -0
- data/app/cells/decidim/follow_button/show.erb +29 -8
- data/app/cells/decidim/follow_button_cell.rb +37 -5
- data/app/cells/decidim/navbar_admin_link/show.erb +6 -0
- data/app/cells/decidim/navbar_admin_link_cell.rb +49 -0
- data/app/cells/decidim/newsletter_templates/base_cell.rb +30 -0
- data/app/cells/decidim/newsletter_templates/base_settings_form_cell.rb +13 -0
- data/app/cells/decidim/newsletter_templates/basic_only_text/show.erb +86 -0
- data/app/cells/decidim/newsletter_templates/basic_only_text_cell.rb +21 -0
- data/app/cells/decidim/newsletter_templates/basic_only_text_settings_form/show.erb +7 -0
- data/app/cells/decidim/newsletter_templates/basic_only_text_settings_form_cell.rb +8 -0
- data/app/cells/decidim/newsletter_templates/image_text_cta/show.erb +125 -0
- data/app/cells/decidim/newsletter_templates/image_text_cta_cell.rb +61 -0
- data/app/cells/decidim/newsletter_templates/image_text_cta_settings_form/show.erb +17 -0
- data/app/cells/decidim/newsletter_templates/image_text_cta_settings_form_cell.rb +8 -0
- data/app/cells/decidim/notifications/show.erb +1 -1
- data/app/cells/decidim/profile/show.erb +2 -2
- data/app/cells/decidim/profile/user_group_tabs.erb +10 -5
- data/app/cells/decidim/profile/user_tabs.erb +16 -14
- data/app/cells/decidim/profile_cell.rb +18 -0
- data/app/cells/decidim/profile_sidebar/show.erb +16 -16
- data/app/cells/decidim/profile_sidebar_cell.rb +1 -0
- data/app/cells/decidim/progress_bar/show.erb +11 -4
- data/app/cells/decidim/progress_bar_cell.rb +20 -1
- data/app/cells/decidim/search_results_section/show.erb +1 -1
- data/app/cells/decidim/tags_cell.rb +34 -4
- data/app/cells/decidim/translation_bar/show.erb +6 -0
- data/app/cells/decidim/translation_bar_cell.rb +52 -0
- data/app/cells/decidim/user_activity/show.erb +19 -1
- data/app/cells/decidim/user_activity_cell.rb +6 -0
- data/app/cells/decidim/user_conversation/conversation_header.erb +14 -0
- data/app/cells/decidim/user_conversation/messages.erb +15 -0
- data/app/cells/decidim/user_conversation/new.erb +15 -0
- data/app/cells/decidim/user_conversation/reply.erb +17 -0
- data/app/cells/decidim/user_conversation/show.erb +20 -0
- data/app/cells/decidim/user_conversation_cell.rb +75 -0
- data/app/cells/decidim/user_conversations/add_conversation_users.erb +25 -0
- data/app/cells/decidim/user_conversations/conversation_item.erb +38 -0
- data/app/cells/decidim/user_conversations/show.erb +58 -0
- data/app/cells/decidim/user_conversations_cell.rb +40 -0
- data/app/cells/decidim/user_group_admin_membership_profile/footer.erb +3 -3
- data/app/cells/decidim/user_profile/footer.erb +1 -1
- data/app/cells/decidim/user_profile/unlinked_user_data.erb +16 -0
- data/app/cells/decidim/user_profile/user_data.erb +1 -1
- data/app/cells/decidim/user_profile_cell.rb +7 -1
- data/app/cells/decidim/user_timeline_cell.rb +4 -0
- data/app/cells/decidim/version/show.erb +31 -0
- data/app/{views/decidim/shared/_version_author.html.erb → cells/decidim/version_author/show.erb} +1 -1
- data/app/cells/decidim/version_author_cell.rb +9 -0
- data/app/cells/decidim/version_cell.rb +83 -0
- data/app/cells/decidim/versions_list/show.erb +32 -0
- data/app/cells/decidim/versions_list_cell.rb +64 -0
- data/app/cells/decidim/versions_list_item/show.erb +20 -0
- data/app/cells/decidim/versions_list_item_cell.rb +51 -0
- data/app/cells/decidim/wizard_step_form/wizard_aside.erb +1 -1
- data/app/cells/decidim/wizard_step_form/wizard_header.erb +2 -2
- data/app/cells/decidim/wizard_step_form_cell.rb +4 -1
- data/app/commands/decidim/amendable/accept.rb +18 -7
- data/app/commands/decidim/amendable/create_draft.rb +2 -0
- data/app/commands/decidim/amendable/publish_draft.rb +5 -0
- data/app/commands/decidim/amendable/reject.rb +5 -0
- data/app/commands/decidim/amendable/update_draft.rb +2 -0
- data/app/commands/decidim/amendable/withdraw.rb +3 -12
- data/app/commands/decidim/attachment_methods.rb +47 -0
- data/app/commands/decidim/create_registration.rb +7 -7
- data/app/commands/decidim/create_user_group.rb +12 -0
- data/app/commands/decidim/destroy_account.rb +13 -0
- data/app/commands/decidim/endorse_resource.rb +64 -0
- data/app/commands/decidim/gallery_methods.rb +71 -0
- data/app/commands/decidim/invite_user_again.rb +2 -4
- data/app/commands/decidim/messaging/reply_to_conversation.rb +35 -4
- data/app/commands/decidim/messaging/start_conversation.rb +36 -5
- data/app/commands/decidim/multiple_attachments_methods.rb +56 -0
- data/app/commands/decidim/unendorse_resource.rb +38 -0
- data/app/commands/decidim/update_notifications_settings.rb +1 -0
- data/app/commands/decidim/update_user_group.rb +14 -1
- data/app/controllers/concerns/decidim/devise_controllers.rb +1 -0
- data/app/controllers/concerns/decidim/filter_resource.rb +24 -6
- data/app/controllers/concerns/decidim/flaggable.rb +20 -0
- data/app/controllers/concerns/decidim/force_authentication.rb +1 -0
- data/app/controllers/concerns/decidim/impersonate_users.rb +14 -1
- data/app/controllers/concerns/decidim/needs_snippets.rb +20 -0
- data/app/controllers/concerns/decidim/paginable.rb +5 -1
- data/app/controllers/concerns/decidim/resource_versions_concern.rb +28 -0
- data/app/controllers/concerns/decidim/use_organization_time_zone.rb +32 -0
- data/app/controllers/concerns/decidim/withdrawable.rb +20 -0
- data/app/controllers/decidim/application_controller.rb +19 -8
- data/app/controllers/decidim/components/base_controller.rb +7 -1
- data/app/controllers/decidim/cookie_policy_controller.rb +6 -3
- data/app/controllers/decidim/data_portability_controller.rb +12 -19
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/registrations_controller.rb +3 -4
- data/app/controllers/decidim/devise/sessions_controller.rb +5 -0
- data/app/controllers/decidim/devise/unlocks_controller.rb +25 -0
- data/app/controllers/decidim/endorsements_controller.rb +71 -0
- data/app/controllers/decidim/messaging/conversations_controller.rb +57 -14
- data/app/controllers/decidim/newsletters_controller.rb +2 -2
- data/app/controllers/decidim/profiles_controller.rb +6 -0
- data/app/controllers/decidim/scopes_controller.rb +42 -7
- data/app/controllers/decidim/searches_controller.rb +0 -1
- data/app/controllers/decidim/user_activities_controller.rb +19 -2
- data/app/controllers/decidim/user_conversations_controller.rb +142 -0
- data/app/controllers/decidim/user_timeline_controller.rb +19 -2
- data/app/events/decidim/resource_endorsed_event.rb +35 -0
- data/app/events/decidim/user_group_admin_event.rb +37 -0
- data/app/events/decidim/user_group_created_event.rb +6 -0
- data/app/events/decidim/user_group_updated_event.rb +6 -0
- data/app/forms/decidim/account_form.rb +5 -1
- data/app/forms/decidim/amendable/create_form.rb +1 -1
- data/app/forms/decidim/amendable/form.rb +44 -3
- data/app/forms/decidim/attachment_form.rb +5 -0
- data/app/forms/decidim/messaging/conversation_form.rb +10 -4
- data/app/forms/decidim/notifications_settings_form.rb +6 -0
- data/app/forms/decidim/registration_form.rb +6 -0
- data/app/forms/decidim/user_group_form.rb +5 -1
- data/app/functions/decidim/core/component_finder_base.rb +40 -0
- data/app/functions/decidim/core/component_list.rb +38 -0
- data/app/functions/decidim/core/component_list_base.rb +67 -0
- data/app/functions/decidim/core/needs_api_filter_and_order.rb +52 -0
- data/app/functions/decidim/core/participatory_space_finder.rb +11 -0
- data/app/functions/decidim/core/participatory_space_finder_base.rb +29 -0
- data/app/functions/decidim/core/participatory_space_list.rb +11 -0
- data/app/functions/decidim/core/participatory_space_list_base.rb +34 -0
- data/app/functions/decidim/core/user_entity_finder.rb +33 -0
- data/app/functions/decidim/core/user_entity_list.rb +31 -0
- data/app/helpers/concerns/decidim/flash_helper_extensions.rb +47 -0
- data/app/helpers/decidim/action_authorization_helper.rb +24 -2
- data/app/helpers/decidim/amendments_helper.rb +29 -1
- data/app/helpers/decidim/application_helper.rb +38 -4
- data/app/helpers/decidim/categories_helper.rb +26 -0
- data/app/helpers/decidim/cells_helper.rb +3 -15
- data/app/helpers/decidim/check_boxes_tree_helper.rb +123 -0
- data/app/helpers/decidim/cookies_helper.rb +1 -1
- data/app/helpers/decidim/cta_button_helper.rb +1 -1
- data/app/helpers/decidim/decidim_form_helper.rb +24 -1
- data/app/helpers/decidim/endorsable_helper.rb +93 -0
- data/app/helpers/decidim/filter_params_helper.rb +30 -0
- data/app/helpers/decidim/filters_helper.rb +15 -5
- data/app/helpers/decidim/followable_helper.rb +11 -0
- data/app/helpers/decidim/layout_helper.rb +23 -5
- data/app/helpers/decidim/map_helper.rb +100 -17
- data/app/helpers/decidim/markup_helper.rb +9 -0
- data/app/helpers/decidim/messaging/conversation_helper.rb +61 -7
- data/app/helpers/decidim/omniauth_helper.rb +6 -13
- data/app/helpers/decidim/orders_helper.rb +15 -1
- data/app/helpers/decidim/paginate_helper.rb +3 -1
- data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
- data/app/helpers/decidim/resource_versions_helper.rb +46 -0
- data/app/helpers/decidim/rich_text_editor_helper.rb +23 -0
- data/app/helpers/decidim/sanitize_helper.rb +13 -3
- data/app/helpers/decidim/scopes_helper.rb +7 -6
- data/app/helpers/decidim/tooltip_helper.rb +1 -1
- data/app/helpers/decidim/traceability_helper.rb +2 -8
- data/app/helpers/decidim/translations_helper.rb +7 -1
- data/app/helpers/decidim/user_profile_helper.rb +1 -1
- data/app/helpers/decidim/widget_urls_helper.rb +4 -2
- data/app/jobs/decidim/data_portability_export_job.rb +18 -10
- data/app/jobs/decidim/event_publisher_job.rb +1 -1
- data/app/jobs/decidim/export_job.rb +1 -1
- data/app/jobs/decidim/export_participatory_space_job.rb +20 -0
- data/app/jobs/decidim/machine_translation_fields_job.rb +30 -0
- data/app/jobs/decidim/machine_translation_resource_job.rb +113 -0
- data/app/jobs/decidim/machine_translation_save_job.rb +33 -0
- data/app/mailers/concerns/decidim/multitenant_asset_host.rb +33 -0
- data/app/mailers/decidim/application_mailer.rb +1 -0
- data/app/mailers/decidim/export_mailer.rb +9 -5
- data/app/mailers/decidim/messaging/conversation_mailer.rb +53 -4
- data/app/mailers/decidim/newsletter_mailer.rb +22 -4
- data/app/mailers/decidim/reported_mailer.rb +8 -1
- data/app/middleware/decidim/strip_x_forwarded_host.rb +14 -0
- data/app/models/decidim/action_log.rb +2 -2
- data/app/models/decidim/amendment.rb +0 -18
- data/app/models/decidim/area.rb +3 -0
- data/app/models/decidim/area_type.rb +4 -0
- data/app/models/decidim/attachment.rb +30 -2
- data/app/models/decidim/attachment_collection.rb +3 -0
- data/app/models/decidim/authorization.rb +27 -0
- data/app/models/decidim/category.rb +6 -0
- data/app/models/decidim/component.rb +16 -0
- data/app/models/decidim/content_block.rb +16 -4
- data/app/models/decidim/contextual_help_section.rb +4 -0
- data/app/models/decidim/endorsement.rb +30 -0
- data/app/models/decidim/follow.rb +3 -1
- data/app/models/decidim/messaging/conversation.rb +39 -11
- data/app/models/decidim/messaging/message.rb +32 -6
- data/app/models/decidim/messaging/participation.rb +1 -1
- data/app/models/decidim/messaging/receipt.rb +8 -0
- data/app/models/decidim/moderation.rb +1 -1
- data/app/models/decidim/newsletter.rb +10 -1
- data/app/models/decidim/oauth_application.rb +2 -0
- data/app/models/decidim/omniauth_provider.rb +28 -0
- data/app/models/decidim/organization.rb +94 -0
- data/app/models/decidim/participatory_space_role_config/admin.rb +8 -0
- data/app/models/decidim/participatory_space_role_config/base.rb +31 -0
- data/app/models/decidim/participatory_space_role_config/collaborator.rb +8 -0
- data/app/models/decidim/participatory_space_role_config/moderator.rb +11 -0
- data/app/models/decidim/participatory_space_role_config/null_object.rb +11 -0
- data/app/models/decidim/participatory_space_role_config/participatory_space_admin.rb +8 -0
- data/app/models/decidim/participatory_space_role_config/valuator.rb +11 -0
- data/app/models/decidim/scope.rb +8 -3
- data/app/models/decidim/scope_type.rb +3 -0
- data/app/models/decidim/share_token.rb +49 -0
- data/app/models/decidim/static_page.rb +4 -1
- data/app/models/decidim/static_page_topic.rb +3 -0
- data/app/models/decidim/user.rb +60 -5
- data/app/models/decidim/user_base_entity.rb +6 -2
- data/app/models/decidim/user_group.rb +30 -0
- data/app/permissions/decidim/permissions.rb +28 -6
- data/app/presenters/decidim/admin_log/user_presenter.rb +1 -1
- data/app/presenters/decidim/attachment_presenter.rb +21 -0
- data/app/presenters/decidim/home_stats_presenter.rb +5 -2
- data/app/presenters/decidim/log/base_presenter.rb +1 -1
- data/app/presenters/decidim/log/value_types/default_presenter.rb +1 -1
- data/app/presenters/decidim/metric_charts_presenter.rb +33 -13
- data/app/presenters/decidim/nil_presenter.rb +29 -0
- data/app/presenters/decidim/official_author_presenter.rb +36 -0
- data/app/presenters/decidim/resource_locator_presenter.rb +71 -10
- data/app/presenters/decidim/user_group_presenter.rb +1 -1
- data/app/presenters/decidim/user_presenter.rb +6 -0
- data/app/queries/decidim/metric_manage.rb +5 -0
- data/app/queries/decidim/metrics/followers_metric_manage.rb +1 -6
- data/app/queries/decidim/similar_emendations.rb +4 -4
- data/app/queries/decidim/user_groups/admin_memberships.rb +3 -3
- data/app/scrubbers/decidim/user_input_scrubber.rb +2 -2
- data/app/serializers/decidim/exporters/participatory_space_components_serializer.rb +46 -0
- data/{lib → app/serializers}/decidim/exporters/serializer.rb +0 -0
- data/app/serializers/decidim/importers/importer.rb +25 -0
- data/app/serializers/decidim/importers/participatory_space_components_importer.rb +76 -0
- data/app/services/decidim/activity_search.rb +1 -0
- data/app/services/decidim/base_diff_renderer.rb +42 -3
- data/app/services/decidim/data_portability_exporter.rb +72 -0
- data/app/services/decidim/events_manager.rb +4 -1
- data/app/services/decidim/open_data_exporter.rb +3 -1
- data/app/services/decidim/resource_search.rb +122 -17
- data/app/services/decidim/static_map_generator.rb +10 -21
- data/app/services/decidim/zip_stream/zip_stream_writer.rb +56 -0
- data/app/types/decidim/core/amendment_type.rb +26 -0
- data/app/types/decidim/core/area_api_type.rb +16 -0
- data/app/types/decidim/core/area_type_type.rb +14 -0
- data/app/types/decidim/core/base_input_filter.rb +8 -0
- data/app/types/decidim/core/base_input_sort.rb +22 -0
- data/app/types/decidim/core/component_input_filter.rb +50 -0
- data/app/types/decidim/core/component_input_sort.rb +32 -0
- data/app/types/decidim/core/decidim_type.rb +0 -4
- data/app/types/decidim/core/fingerprint_type.rb +15 -0
- data/app/types/decidim/core/has_endorsable_input_sort.rb +17 -0
- data/app/types/decidim/core/has_hastaggable_input_filter.rb +15 -0
- data/app/types/decidim/core/has_localized_input_filter.rb +21 -0
- data/app/types/decidim/core/has_localized_input_sort.rb +21 -0
- data/app/types/decidim/core/has_publishable_input_filter.rb +34 -0
- data/app/types/decidim/core/has_publishable_input_sort.rb +13 -0
- data/app/types/decidim/core/has_timestamp_input_filter.rb +52 -0
- data/app/types/decidim/core/has_timestamp_input_sort.rb +12 -0
- data/app/types/decidim/core/participatory_space_input_filter.rb +26 -0
- data/app/types/decidim/core/participatory_space_input_sort.rb +14 -0
- data/app/types/decidim/core/participatory_space_link_type.rb +24 -0
- data/app/types/decidim/core/trace_version_type.rb +29 -0
- data/app/types/decidim/core/user_entity_input_filter.rb +81 -0
- data/app/types/decidim/core/user_entity_input_sort.rb +24 -0
- data/app/types/decidim/core/user_group_type.rb +17 -5
- data/app/types/decidim/core/user_type.rb +17 -6
- data/app/uploaders/decidim/application_uploader.rb +15 -1
- data/app/uploaders/decidim/attachment_uploader.rb +23 -17
- data/app/uploaders/decidim/avatar_uploader.rb +4 -0
- data/app/uploaders/decidim/banner_image_uploader.rb +1 -2
- data/app/uploaders/decidim/data_portability_uploader.rb +2 -7
- data/app/uploaders/decidim/hero_image_uploader.rb +1 -1
- data/app/uploaders/decidim/homepage_image_uploader.rb +1 -1
- data/app/uploaders/decidim/image_uploader.rb +34 -6
- data/app/uploaders/decidim/newsletter_template_image_uploader.rb +36 -0
- data/app/uploaders/decidim/oauth_application_logo_uploader.rb +1 -1
- data/app/uploaders/decidim/official_image_footer_uploader.rb +1 -1
- data/app/uploaders/decidim/official_image_header_uploader.rb +1 -1
- data/app/uploaders/decidim/organization_logo_uploader.rb +1 -1
- data/app/uploaders/decidim/record_image_uploader.rb +15 -0
- data/app/validators/etiquette_validator.rb +0 -7
- data/app/validators/geocoding_validator.rb +9 -4
- data/app/validators/passthru_validator.rb +111 -0
- data/app/validators/scope_belongs_to_component_validator.rb +16 -0
- data/app/validators/time_zone_validator.rb +10 -0
- data/app/validators/uploader_content_type_validator.rb +44 -0
- data/app/views/decidim/account/delete.html.erb +6 -3
- data/app/views/decidim/account/show.html.erb +17 -10
- data/app/views/decidim/amendments/_edit_form_fields.html.erb +7 -13
- data/app/views/decidim/amendments/_similar_emendation.html.erb +4 -4
- data/app/views/decidim/amendments/compare_draft.html.erb +2 -2
- data/app/views/decidim/amendments/edit_draft.html.erb +2 -2
- data/app/views/decidim/amendments/new.html.erb +2 -2
- data/app/views/decidim/amendments/preview_draft.html.erb +3 -3
- data/app/views/decidim/amendments/review.html.erb +3 -3
- data/app/views/decidim/application/_collection.html.erb +2 -2
- data/app/views/decidim/application/_document.html.erb +4 -4
- data/app/views/decidim/application/_documents.html.erb +1 -1
- data/app/views/decidim/application/_photos.html.erb +1 -1
- data/app/views/decidim/authorization_modals/_content.html.erb +2 -2
- data/app/views/decidim/authorization_modals/show.html.erb +1 -1
- data/app/views/decidim/data_portability/show.html.erb +3 -0
- data/app/views/decidim/devise/confirmations/new.html.erb +3 -3
- data/app/views/decidim/devise/invitations/edit.html.erb +17 -15
- data/app/views/decidim/devise/omniauth_registrations/new.html.erb +5 -3
- data/app/views/decidim/devise/passwords/edit.html.erb +5 -3
- data/app/views/decidim/devise/passwords/new.html.erb +3 -3
- data/app/views/decidim/devise/registrations/edit.html.erb +2 -1
- data/app/views/decidim/devise/registrations/new.html.erb +12 -11
- data/app/views/decidim/devise/sessions/new.html.erb +7 -7
- data/app/views/decidim/devise/shared/_newsletter_modal.html.erb +3 -3
- data/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +11 -11
- data/app/views/decidim/devise/shared/_omniauth_buttons_mini.html.erb +9 -8
- data/app/views/decidim/devise/unlocks/new.html.erb +33 -0
- data/app/views/decidim/doorkeeper/authorizations/new.html.erb +2 -2
- data/app/views/decidim/endorsements/_identity.html.erb +9 -0
- data/app/views/decidim/endorsements/identities.html.erb +12 -0
- data/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +20 -0
- data/app/views/decidim/errors/internal_server_error.html.erb +2 -2
- data/app/views/decidim/errors/not_found.html.erb +2 -2
- data/app/views/decidim/export_mailer/data_portability_export.html.erb +2 -2
- data/app/views/decidim/gamification/badges/index.html.erb +4 -4
- data/app/views/decidim/group_admins/index.html.erb +6 -4
- data/app/views/decidim/group_invites/index.html.erb +5 -2
- data/app/views/decidim/group_members/index.html.erb +6 -4
- data/app/views/decidim/groups/_form.html.erb +2 -0
- data/app/views/decidim/groups/edit.html.erb +4 -2
- data/app/views/decidim/groups/new.html.erb +2 -2
- data/app/views/decidim/last_activities/index.html.erb +2 -0
- data/app/views/decidim/messaging/conversation_mailer/comanagers_new_conversation.html.erb +17 -0
- data/app/views/decidim/messaging/conversation_mailer/comanagers_new_message.html.erb +17 -0
- data/app/views/decidim/messaging/conversation_mailer/new_conversation.html.erb +2 -2
- data/app/views/decidim/messaging/conversation_mailer/new_group_conversation.html.erb +17 -0
- data/app/views/decidim/messaging/conversation_mailer/new_group_message.html.erb +17 -0
- data/app/views/decidim/messaging/conversation_mailer/new_message.html.erb +2 -2
- data/app/views/decidim/messaging/conversations/_add_conversation_users.html.erb +24 -0
- data/app/views/decidim/messaging/conversations/_conversation.html.erb +54 -0
- data/app/views/decidim/messaging/conversations/_error_modal.html.erb +21 -0
- data/app/views/decidim/messaging/conversations/_messages.html.erb +15 -0
- data/app/views/decidim/messaging/conversations/_new_conversation_button.html.erb +33 -0
- data/app/views/decidim/messaging/conversations/_reply.html.erb +3 -3
- data/app/views/decidim/messaging/conversations/_show.html.erb +34 -15
- data/app/views/decidim/messaging/conversations/_start.html.erb +7 -1
- data/app/views/decidim/messaging/conversations/create.js.erb +1 -1
- data/app/views/decidim/messaging/conversations/error.js.erb +10 -0
- data/app/views/decidim/messaging/conversations/index.html.erb +34 -29
- data/app/views/decidim/messaging/conversations/new.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/show.html.erb +8 -4
- data/app/views/decidim/messaging/conversations/update.js.erb +1 -1
- data/app/views/decidim/newsletter_mailer/newsletter.html.erb +2 -2
- data/app/views/decidim/newsletters/show.html.erb +8 -1
- data/app/views/decidim/notification_mailer/event_received.html.erb +2 -2
- data/app/views/decidim/notifications/index.html.erb +4 -2
- data/app/views/decidim/notifications_settings/show.html.erb +14 -1
- data/app/views/decidim/own_user_groups/index.html.erb +4 -0
- data/app/views/decidim/pages/_standalone.html.erb +1 -1
- data/app/views/decidim/pages/_tabbed.html.erb +5 -5
- data/app/views/decidim/pages/index.html.erb +22 -13
- data/app/views/decidim/profiles/_user_follow.erb +3 -3
- data/app/views/decidim/profiles/show.html.erb +2 -0
- data/app/views/decidim/reported_mailer/report.html.erb +49 -3
- data/app/views/decidim/scopes/_scopes_picker_input.html.erb +15 -7
- data/app/views/decidim/scopes/picker.html.erb +31 -17
- data/app/views/decidim/searches/_count.html.erb +14 -11
- data/app/views/decidim/searches/_filters.html.erb +6 -21
- data/app/views/decidim/searches/_resources_filter_block.html.erb +20 -0
- data/app/views/decidim/searches/index.html.erb +5 -3
- data/app/views/decidim/shared/_check_boxes_tree.html.erb +56 -0
- data/app/views/decidim/shared/_confirm_modal.html.erb +18 -0
- data/app/views/decidim/shared/_embed_modal.html.erb +4 -1
- data/app/views/decidim/shared/_extended_navigation_bar.html.erb +3 -3
- data/app/views/decidim/shared/_filter_form_help.erb +8 -0
- data/app/views/decidim/shared/_floating_help.html.erb +7 -7
- data/app/views/decidim/shared/_login_modal.html.erb +17 -6
- data/app/views/decidim/shared/_orders.html.erb +16 -5
- data/app/views/decidim/shared/_results_per_page.html.erb +16 -6
- data/app/views/decidim/shared/_share_modal.html.erb +8 -4
- data/app/views/decidim/shared/_static_map.html.erb +2 -2
- data/app/views/decidim/shared/participatory_space_filters/_filters.html.erb +1 -1
- data/app/views/decidim/user_activities/index.html.erb +4 -0
- data/app/views/decidim/user_activities/index.js.erb +14 -0
- data/app/views/decidim/user_conversations/index.html.erb +4 -0
- data/app/views/decidim/user_conversations/show.html.erb +4 -0
- data/app/views/decidim/user_conversations/update.js.erb +8 -0
- data/app/views/decidim/user_interests/_scopes.html.erb +12 -10
- data/app/views/decidim/user_interests/show.html.erb +4 -1
- data/app/views/decidim/user_timeline/index.html.erb +5 -1
- data/app/views/decidim/user_timeline/index.js.erb +14 -0
- data/app/views/decidim/widgets/show.html.erb +4 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/kaminari/decidim/_first_page.html.erb +5 -1
- data/app/views/kaminari/decidim/_last_page.html.erb +5 -1
- data/app/views/kaminari/decidim/_next_page.html.erb +6 -1
- data/app/views/kaminari/decidim/_page.html.erb +2 -2
- data/app/views/kaminari/decidim/_paginator.html.erb +16 -14
- data/app/views/kaminari/decidim/_prev_page.html.erb +6 -1
- data/app/views/layouts/decidim/_admin_links.html.erb +2 -0
- data/app/views/layouts/decidim/_application.html.erb +4 -2
- data/app/views/layouts/decidim/_cookie_warning.html.erb +1 -1
- data/app/views/layouts/decidim/_edit_link.html.erb +0 -8
- data/app/views/layouts/decidim/_head.html.erb +4 -0
- data/app/views/layouts/decidim/_js_configuration.html.erb +34 -0
- data/app/views/layouts/decidim/_language_chooser.html.erb +10 -5
- data/app/views/layouts/decidim/_logo.html.erb +2 -22
- data/app/views/layouts/decidim/_mailer_logo.html.erb +2 -22
- data/app/views/layouts/decidim/_main_footer.html.erb +28 -0
- data/app/views/layouts/decidim/_mini_footer.html.erb +21 -0
- data/app/views/layouts/decidim/_omnipresent_banner.html.erb +1 -1
- data/app/views/layouts/decidim/_organization_colors.html.erb +4 -3
- data/app/views/layouts/decidim/_social_media_links.html.erb +15 -10
- data/app/views/layouts/decidim/_topbar_search.html.erb +12 -2
- data/app/views/layouts/decidim/_user_menu.html.erb +6 -6
- data/app/views/layouts/decidim/_wrapper.html.erb +28 -65
- data/app/views/layouts/decidim/newsletter_base.html.erb +46 -0
- data/app/views/layouts/decidim/user_profile.html.erb +8 -3
- data/app/views/layouts/decidim/widget.html.erb +2 -43
- data/config/initializers/browser.rb +5 -0
- data/config/initializers/devise.rb +17 -31
- data/config/initializers/invisible_captcha.rb +1 -0
- data/config/initializers/omniauth.rb +56 -0
- data/config/initializers/rack_attack.rb +25 -16
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +44 -22
- data/config/locales/bg-BG.yml +1512 -0
- data/config/locales/bg.yml +1508 -0
- data/config/locales/ca.yml +302 -24
- data/config/locales/cs.yml +346 -55
- data/config/locales/da-DK.yml +9 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +311 -26
- data/config/locales/el-GR.yml +151 -0
- data/config/locales/el.yml +1587 -0
- data/config/locales/en.yml +308 -30
- data/config/locales/eo-UY.yml +2 -6
- data/config/locales/eo.yml +92 -0
- data/config/locales/es-MX.yml +297 -19
- data/config/locales/es-PY.yml +297 -19
- data/config/locales/es.yml +301 -23
- data/config/locales/et-EE.yml +9 -0
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +14 -19
- data/config/locales/fi-plain.yml +297 -19
- data/config/locales/fi.yml +361 -83
- data/config/locales/fr-CA.yml +1613 -0
- data/config/locales/fr.yml +304 -26
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +14 -19
- data/config/locales/hr-HR.yml +9 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +123 -39
- data/config/locales/id-ID.yml +14 -19
- data/config/locales/is-IS.yml +457 -0
- data/config/locales/is.yml +463 -0
- data/config/locales/it.yml +332 -54
- data/config/locales/ja-JP.yml +1587 -0
- data/config/locales/ja.yml +1605 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt-LT.yml +9 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +1481 -0
- data/config/locales/mt-MT.yml +9 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +292 -20
- data/config/locales/no.yml +951 -41
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +801 -444
- data/config/locales/pt-BR.yml +15 -21
- data/config/locales/pt.yml +887 -551
- data/config/locales/ro-RO.yml +1609 -0
- data/config/locales/ru.yml +14 -14
- data/config/locales/sk-SK.yml +1426 -0
- data/config/locales/sk.yml +1440 -0
- data/config/locales/sl.yml +72 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +122 -0
- data/config/locales/sv.yml +342 -40
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +14 -19
- data/config/locales/uk.yml +10 -15
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +1584 -0
- data/config/locales/zh-TW.yml +1 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20180810092428_move_organization_fields_to_hero_content_block.rb +2 -2
- data/db/migrate/20191028135718_add_lockable_to_users.rb +10 -0
- data/db/migrate/20191113092826_add_omniauth_settings_to_decidim_organization.rb +7 -0
- data/db/migrate/20191113144432_add_rich_text_editor_in_public_views_to_organizations.rb +10 -0
- data/db/migrate/20191118120529_add_weight_to_categories.rb +7 -0
- data/db/migrate/20191118123154_add_admin_terms_of_use_body_field_to_organization.rb +9 -0
- data/db/migrate/20191130151925_create_decidim_endorsements.rb +13 -0
- data/db/migrate/20191204075509_add_session_token_to_users.rb +7 -0
- data/db/migrate/20191212102051_remove_continuity_badges.rb +13 -0
- data/db/migrate/20200107142226_add_organization_timezone.rb +7 -0
- data/db/migrate/20200211173227_add_direct_message_types_to_users.rb +12 -0
- data/db/migrate/20200320105904_index_foreign_keys_in_decidim_action_logs.rb +9 -0
- data/db/migrate/20200320105905_index_foreign_keys_in_decidim_amendments.rb +7 -0
- data/db/migrate/20200320105909_index_foreign_keys_in_decidim_authorizations.rb +7 -0
- data/db/migrate/20200320105917_index_foreign_keys_in_decidim_contextual_help_sections.rb +7 -0
- data/db/migrate/20200320105919_index_foreign_keys_in_decidim_endorsements.rb +7 -0
- data/db/migrate/20200320105923_index_foreign_keys_in_decidim_notifications.rb +7 -0
- data/db/migrate/20200320105927_index_foreign_keys_in_oauth_access_grants.rb +7 -0
- data/db/migrate/20200323094443_add_id_to_content_blocks_scope.rb +7 -0
- data/db/migrate/20200326102407_rename_scope_column.rb +7 -0
- data/db/migrate/20200327082257_migrate_newsletters_to_templates.rb +33 -0
- data/db/migrate/20200327082954_remove_newsletter_body.rb +7 -0
- data/db/migrate/20200401073419_add_index_on_content_block_scope_id.rb +11 -0
- data/db/migrate/20200525184143_add_enable_machine_translation_to_decidim_organizations.rb +7 -0
- data/db/migrate/20200702073419_create_decidim_share_tokens.rb +16 -0
- data/db/migrate/20200707132401_add_comments_max_length_to_decidim_organization.rb +7 -0
- data/db/migrate/20200730142511_add_file_upload_settings_to_decidim_organizations.rb +36 -0
- data/db/migrate/20200806092109_add_machine_translation_display_priority_to_organizations.rb +17 -0
- data/db/migrate/20201004160335_remove_notifications_with_continuity_badge.rb +9 -0
- data/db/seeds.rb +26 -6
- data/{app/controllers/concerns → lib}/decidim/action_authorization.rb +0 -0
- data/lib/decidim/acts_as_author.rb +21 -0
- data/lib/decidim/amendable.rb +7 -4
- data/lib/decidim/api/amendable_entity_interface.rb +18 -0
- data/lib/decidim/api/amendable_interface.rb +18 -0
- data/lib/decidim/api/attachable_interface.rb +1 -1
- data/lib/decidim/api/author_interface.rb +4 -0
- data/lib/decidim/api/categorizable_interface.rb +1 -1
- data/lib/decidim/api/coauthorable_interface.rb +29 -0
- data/lib/decidim/api/endorsable_interface.rb +22 -0
- data/lib/decidim/api/fingerprint_interface.rb +13 -0
- data/lib/decidim/api/participatory_space_interface.rb +11 -9
- data/lib/decidim/api/participatory_space_resourceable_interface.rb +21 -0
- data/lib/decidim/api/scopable_interface.rb +1 -1
- data/lib/decidim/api/timestamps_interface.rb +21 -0
- data/lib/decidim/api/traceable_interface.rb +14 -0
- data/lib/decidim/authorable.rb +22 -1
- data/lib/decidim/authorization_form_builder.rb +7 -0
- data/lib/decidim/coauthorable.rb +32 -3
- data/lib/decidim/component_manifest.rb +61 -6
- data/lib/decidim/content_parsers.rb +1 -0
- data/lib/decidim/content_parsers/user_group_parser.rb +61 -0
- data/lib/decidim/content_parsers/user_parser.rb +3 -5
- data/lib/decidim/content_processor.rb +54 -29
- data/lib/decidim/content_renderers.rb +1 -0
- data/lib/decidim/content_renderers/base_renderer.rb +1 -1
- data/lib/decidim/content_renderers/hashtag_renderer.rb +2 -0
- data/lib/decidim/content_renderers/link_renderer.rb +4 -1
- data/lib/decidim/content_renderers/user_group_renderer.rb +32 -0
- data/lib/decidim/content_renderers/user_renderer.rb +3 -1
- data/lib/decidim/core.rb +134 -34
- data/lib/decidim/core/api.rb +8 -0
- data/lib/decidim/core/engine.rb +149 -27
- data/lib/decidim/core/test.rb +18 -0
- data/lib/decidim/core/test/factories.rb +157 -10
- data/lib/decidim/core/test/shared_examples/acts_as_author_examples.rb +12 -0
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +79 -0
- data/lib/decidim/core/test/shared_examples/amendable/accept_amendment_examples.rb +4 -4
- data/lib/decidim/core/test/shared_examples/amendable_interface_examples.rb +14 -0
- data/lib/decidim/core/test/shared_examples/amendable_proposals_interface_examples.rb +50 -0
- data/lib/decidim/core/test/shared_examples/authorable_interface_examples.rb +3 -0
- data/lib/decidim/core/test/shared_examples/back_to_list_button_examples.rb +17 -0
- data/lib/decidim/core/test/shared_examples/coauthorable_interface_examples.rb +60 -0
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +118 -13
- data/lib/decidim/core/test/shared_examples/edit_link_shared_examples.rb +5 -1
- data/lib/decidim/core/test/shared_examples/embed_resource_examples.rb +49 -0
- data/lib/decidim/core/test/shared_examples/endorsable_interface_examples.rb +22 -0
- data/lib/decidim/core/test/shared_examples/endorsements_controller_shared_context.rb +22 -0
- data/lib/decidim/core/test/shared_examples/fingerprintable_interface_examples.rb +17 -0
- data/lib/decidim/core/test/shared_examples/follows_examples.rb +18 -2
- data/lib/decidim/core/test/shared_examples/input_filter_examples.rb +118 -0
- data/lib/decidim/core/test/shared_examples/input_sort_examples.rb +126 -0
- data/lib/decidim/core/test/shared_examples/logo_email.rb +20 -0
- data/lib/decidim/core/test/shared_examples/manage_component_share_tokens.rb +83 -0
- data/lib/decidim/core/test/shared_examples/map_examples.rb +186 -0
- data/lib/decidim/core/test/shared_examples/metric_manage_shared_context.rb +9 -0
- data/lib/decidim/core/test/shared_examples/participatory_space_resourcable_interface_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/permissions.rb +143 -0
- data/lib/decidim/core/test/shared_examples/preview_component_with_share_token_examples.rb +55 -0
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +4 -4
- data/lib/decidim/core/test/shared_examples/resource_search_examples.rb +200 -0
- data/lib/decidim/core/test/shared_examples/rich_text_editor_examples.rb +59 -0
- data/lib/decidim/core/test/shared_examples/scopable_resource_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/scope_helper_examples.rb +12 -1
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +144 -0
- data/lib/decidim/core/test/shared_examples/searchable_resources_shared_context.rb +12 -0
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +15 -2
- data/lib/decidim/core/test/shared_examples/simple_event.rb +8 -0
- data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +166 -0
- data/lib/decidim/core/test/shared_examples/timestamps_interface_examples.rb +21 -0
- data/lib/decidim/core/test/shared_examples/traceable_interface_examples.rb +47 -0
- data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb +89 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/deprecations.rb +19 -0
- data/lib/decidim/diffy_extension.rb +47 -0
- data/lib/decidim/endorsable.rb +25 -0
- data/lib/decidim/events.rb +1 -0
- data/lib/decidim/events/base_event.rb +11 -9
- data/lib/decidim/events/user_group_event.rb +45 -0
- data/lib/decidim/exporters.rb +7 -1
- data/lib/decidim/exporters/csv.rb +16 -2
- data/lib/decidim/exporters/excel.rb +1 -1
- data/lib/decidim/exporters/export_manifest.rb +105 -0
- data/lib/decidim/exporters/pdf.rb +56 -0
- data/lib/decidim/faker/localized.rb +10 -0
- data/lib/decidim/file_validator_humanizer.rb +98 -0
- data/lib/decidim/filter_form_builder.rb +38 -11
- data/lib/decidim/form_builder.rb +240 -44
- data/lib/decidim/geocodable.rb +79 -0
- data/lib/decidim/has_attachments.rb +11 -1
- data/lib/decidim/has_settings.rb +10 -4
- data/lib/decidim/has_upload_validations.rb +36 -0
- data/lib/decidim/map.rb +214 -0
- data/lib/decidim/map/autocomplete.rb +67 -0
- data/lib/decidim/map/dynamic_map.rb +89 -0
- data/lib/decidim/map/frontend.rb +97 -0
- data/lib/decidim/map/geocoding.rb +115 -0
- data/lib/decidim/map/provider.rb +12 -0
- data/lib/decidim/map/provider/autocomplete/here.rb +20 -0
- data/lib/decidim/map/provider/autocomplete/osm.rb +20 -0
- data/lib/decidim/map/provider/dynamic_map/here.rb +51 -0
- data/lib/decidim/map/provider/dynamic_map/osm.rb +13 -0
- data/lib/decidim/map/provider/geocoding/here.rb +58 -0
- data/lib/decidim/map/provider/geocoding/osm.rb +30 -0
- data/lib/decidim/map/provider/here.rb +21 -0
- data/lib/decidim/map/provider/osm.rb +22 -0
- data/lib/decidim/map/provider/static_map/here.rb +35 -0
- data/lib/decidim/map/provider/static_map/osm.rb +29 -0
- data/lib/decidim/map/static_map.rb +133 -0
- data/lib/decidim/map/utility.rb +38 -0
- data/lib/decidim/organization_settings.rb +267 -0
- data/lib/decidim/participable.rb +6 -0
- data/lib/decidim/participatory_space_manifest.rb +68 -0
- data/lib/decidim/participatory_space_resourceable.rb +43 -1
- data/lib/decidim/query_extensions.rb +19 -23
- data/lib/decidim/resource_manifest.rb +1 -1
- data/lib/decidim/resourceable.rb +1 -1
- data/lib/decidim/scopable.rb +19 -6
- data/lib/decidim/scopable_component.rb +29 -1
- data/lib/decidim/scopable_participatory_space.rb +19 -0
- data/lib/decidim/scopable_resource.rb +21 -0
- data/lib/decidim/search_resource_fields_mapper.rb +15 -2
- data/lib/decidim/searchable.rb +23 -1
- data/lib/decidim/settings_manifest.rb +16 -1
- data/lib/decidim/shareable_with_token.rb +27 -0
- data/lib/decidim/snippets.rb +30 -0
- data/lib/decidim/translatable_attributes.rb +42 -4
- data/lib/decidim/translatable_resource.rb +78 -0
- data/lib/decidim/view_model.rb +5 -0
- data/lib/tasks/decidim_data_portability_tasks.rake +66 -5
- data/lib/tasks/decidim_locales_tasks.rake +35 -0
- data/lib/tasks/decidim_metrics_tasks.rake +18 -7
- data/lib/tasks/decidim_tasks.rake +2 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.bg.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.da.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.el.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.eo.js +17 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.et.js +18 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.fr-CA.js +16 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ga.js +15 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.hr.js +13 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.is.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ja.js +16 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.lt.js +16 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.lv.js +17 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.mt.js +15 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ro.js +15 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.sk.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.sl.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.sr.js +16 -0
- data/vendor/assets/javascripts/leaflet-tilelayer-here.js +200 -155
- data/vendor/assets/javascripts/svg4everybody.min.js +1 -2
- data/vendor/assets/javascripts/tribute.js +1690 -1621
- metadata +458 -46
- data/app/assets/images/decidim/gamification/badges/continuity.svg +0 -73
- data/app/assets/javascripts/decidim/vizzs/orgchart.js.es6 +0 -699
- data/app/assets/stylesheets/decidim/email.css +0 -1403
- data/app/assets/stylesheets/decidim/modules/_input-hashtags.scss +0 -124
- data/app/helpers/decidim/multi_translation_helper.rb +0 -0
- data/app/models/decidim/continuity_badge_status.rb +0 -9
- data/app/models/decidim/participatory_process_user_role.rb +0 -32
- data/app/services/decidim/continuity_badge_tracker.rb +0 -64
- data/app/views/decidim/messaging/conversations/_message.html.erb +0 -14
- data/lib/decidim/components/export_manifest.rb +0 -63
- data/lib/decidim/data_portability_file_reader.rb +0 -56
- data/lib/decidim/data_portability_file_zipper.rb +0 -67
- data/lib/decidim/hashtaggable.rb +0 -24
@@ -3,18 +3,6 @@
|
|
3
3
|
module Decidim
|
4
4
|
# Helper that provides methods to enable or disable omniauth buttons
|
5
5
|
module OmniauthHelper
|
6
|
-
# Public: returns true if the social provider is enabled
|
7
|
-
def social_provider_enabled?(provider)
|
8
|
-
Rails.application.secrets.dig(:omniauth, provider.to_sym, :enabled)
|
9
|
-
end
|
10
|
-
|
11
|
-
# Public: returns true if any provider is enabled
|
12
|
-
def any_social_provider_enabled?
|
13
|
-
User.omniauth_providers.any? do |provider|
|
14
|
-
social_provider_enabled? provider
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
6
|
# Public: normalize providers names to they can be used for buttons
|
19
7
|
# and icons.
|
20
8
|
def normalize_provider_name(provider)
|
@@ -23,7 +11,7 @@ module Decidim
|
|
23
11
|
|
24
12
|
# Public: icon for omniauth buttons
|
25
13
|
def oauth_icon(provider)
|
26
|
-
info =
|
14
|
+
info = current_organization.enabled_omniauth_providers[provider.to_sym]
|
27
15
|
|
28
16
|
if info
|
29
17
|
icon_path = info[:icon_path]
|
@@ -35,5 +23,10 @@ module Decidim
|
|
35
23
|
name ||= normalize_provider_name(provider)
|
36
24
|
icon(name)
|
37
25
|
end
|
26
|
+
|
27
|
+
# Public: pretty print provider name
|
28
|
+
def provider_name(provider)
|
29
|
+
provider.to_s.gsub(/_|-/, " ").camelize
|
30
|
+
end
|
38
31
|
end
|
39
32
|
end
|
@@ -23,7 +23,21 @@ module Decidim
|
|
23
23
|
# options - An optional hash of options
|
24
24
|
# * i18n_scope - The scope of the i18n translations
|
25
25
|
def order_link(order, options = {})
|
26
|
-
|
26
|
+
i18n_scope = options.delete(:i18n_scope)
|
27
|
+
|
28
|
+
link_to(
|
29
|
+
t("#{i18n_scope}.#{order}"),
|
30
|
+
url_for(params.to_unsafe_h.except(
|
31
|
+
"component_id",
|
32
|
+
"participatory_process_slug",
|
33
|
+
"assembly_slug",
|
34
|
+
"initiative_slug"
|
35
|
+
).merge(page: nil, order: order)),
|
36
|
+
{
|
37
|
+
data: { order: order },
|
38
|
+
remote: true
|
39
|
+
}.merge(options)
|
40
|
+
)
|
27
41
|
end
|
28
42
|
end
|
29
43
|
end
|
@@ -12,7 +12,9 @@ module Decidim
|
|
12
12
|
# Kaminari uses url_for to generate the url, but this doesn't play nice with our engine system
|
13
13
|
# and unless we remove these params they are added again as query string :(
|
14
14
|
default_params = {
|
15
|
-
|
15
|
+
participatory_process_slug: nil,
|
16
|
+
assembly_slug: nil,
|
17
|
+
initiative_slug: nil,
|
16
18
|
component_id: nil
|
17
19
|
}
|
18
20
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# Helper to print resource versions.
|
5
|
+
module ResourceVersionsHelper
|
6
|
+
include ResourceHelper
|
7
|
+
|
8
|
+
# Displays the localized version for the given resource.
|
9
|
+
#
|
10
|
+
# resource - the Resource that has the version to display.
|
11
|
+
# options - An optional hash of options
|
12
|
+
# * class: A string of extra css classes
|
13
|
+
#
|
14
|
+
# Returns a String.
|
15
|
+
def resource_version(resource, options = {})
|
16
|
+
return unless resource.respond_to?(:versions) && resource.versions.present?
|
17
|
+
|
18
|
+
html = []
|
19
|
+
html << resource_version_number(resource.versions_count)
|
20
|
+
html << " "
|
21
|
+
html << resource_version_of(resource.versions_count)
|
22
|
+
html << " "
|
23
|
+
html << link_to_other_resource_versions(options[:versions_path]) if options[:versions_path]
|
24
|
+
|
25
|
+
content_tag(:div, safe_join(html), class: "tech-info #{options[:class]}")
|
26
|
+
end
|
27
|
+
|
28
|
+
def resource_version_number(count, css_class = "")
|
29
|
+
content_tag(:strong, t("version", scope: "decidim.versions.resource_version", number: count), class: css_class)
|
30
|
+
end
|
31
|
+
|
32
|
+
def resource_version_of(count)
|
33
|
+
t("of_versions", scope: "decidim.versions.resource_version", number: count)
|
34
|
+
end
|
35
|
+
|
36
|
+
def link_to_other_resource_versions(versions_path)
|
37
|
+
link_to(
|
38
|
+
t(
|
39
|
+
"see_other_versions",
|
40
|
+
scope: "decidim.versions.resource_version"
|
41
|
+
),
|
42
|
+
versions_path
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# Helper related to organization' setting :rich_text_editor_in_public_views.
|
5
|
+
module RichTextEditorHelper
|
6
|
+
def self.included(base)
|
7
|
+
base.include Decidim::SanitizeHelper
|
8
|
+
end
|
9
|
+
|
10
|
+
delegate :rich_text_editor_in_public_views?, to: :current_organization
|
11
|
+
|
12
|
+
def text_editor_for(form, attribute, options = {})
|
13
|
+
if rich_text_editor_in_public_views?
|
14
|
+
options[:lines] ||= 25
|
15
|
+
form.editor attribute, options
|
16
|
+
else
|
17
|
+
options.delete(:hashtaggable)
|
18
|
+
options[:rows] ||= 10
|
19
|
+
form.text_area attribute, options
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -3,7 +3,9 @@
|
|
3
3
|
module Decidim
|
4
4
|
# Helper that provides methods to render order selector and links
|
5
5
|
module SanitizeHelper
|
6
|
-
|
6
|
+
def self.included(base)
|
7
|
+
base.include ActionView::Helpers::SanitizeHelper
|
8
|
+
end
|
7
9
|
|
8
10
|
# Public: It sanitizes a user-inputted string with the
|
9
11
|
# `Decidim::UserInputScrubber` scrubber, so that video embeds work
|
@@ -12,12 +14,20 @@ module Decidim
|
|
12
14
|
# html - A string representing user-inputted HTML.
|
13
15
|
#
|
14
16
|
# Returns an HTML-safe String.
|
15
|
-
def decidim_sanitize(html)
|
16
|
-
|
17
|
+
def decidim_sanitize(html, options = {})
|
18
|
+
if options[:strip_tags]
|
19
|
+
strip_tags sanitize(html, scrubber: Decidim::UserInputScrubber.new)
|
20
|
+
else
|
21
|
+
sanitize(html, scrubber: Decidim::UserInputScrubber.new)
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
19
25
|
def decidim_html_escape(text)
|
20
26
|
ERB::Util.unwrapped_html_escape(text.to_str)
|
21
27
|
end
|
28
|
+
|
29
|
+
def decidim_url_escape(text)
|
30
|
+
decidim_html_escape(text).sub(/^javascript:/, "")
|
31
|
+
end
|
22
32
|
end
|
23
33
|
end
|
@@ -13,9 +13,9 @@ module Decidim
|
|
13
13
|
#
|
14
14
|
# Returns boolean.
|
15
15
|
def has_visible_scopes?(resource)
|
16
|
-
resource.
|
16
|
+
resource.component.scopes_enabled? &&
|
17
17
|
resource.scope.present? &&
|
18
|
-
resource.
|
18
|
+
resource.component.scope != resource.scope
|
19
19
|
end
|
20
20
|
|
21
21
|
# Retrieves the translated name and type for an scope.
|
@@ -35,7 +35,7 @@ module Decidim
|
|
35
35
|
# form - FormBuilder object
|
36
36
|
# name - attribute name
|
37
37
|
# options - An optional Hash with options:
|
38
|
-
# - checkboxes_on_top - Show checked picker values on top (default) or below the picker prompt
|
38
|
+
# - checkboxes_on_top - Show checked picker values on top (default) or below the picker prompt (only for multiple pickers)
|
39
39
|
#
|
40
40
|
# Returns nothing.
|
41
41
|
def scopes_picker_field(form, name, root: false, options: { checkboxes_on_top: true })
|
@@ -64,7 +64,7 @@ module Decidim
|
|
64
64
|
# Renders a scopes picker field in a filter form.
|
65
65
|
# form - FilterFormBuilder object
|
66
66
|
# name - attribute name
|
67
|
-
# checkboxes_on_top - Show picker values on top (default) or below the picker prompt
|
67
|
+
# checkboxes_on_top - Show picker values on top (default) or below the picker prompt (only for multiple pickers)
|
68
68
|
#
|
69
69
|
# Returns nothing.
|
70
70
|
def scopes_picker_filter(form, name, checkboxes_on_top = true)
|
@@ -78,10 +78,11 @@ module Decidim
|
|
78
78
|
form.scopes_picker name, options do |scope|
|
79
79
|
{
|
80
80
|
url: decidim.scopes_picker_path(
|
81
|
-
root: try(:current_participatory_space)
|
81
|
+
root: try(:current_participatory_space).try(:scope),
|
82
82
|
current: scope&.id,
|
83
83
|
title: I18n.t("decidim.scopes.prompt"),
|
84
|
-
global_value: "global"
|
84
|
+
global_value: "global",
|
85
|
+
max_depth: try(:current_participatory_space).try(:scope_type_max_depth)
|
85
86
|
),
|
86
87
|
text: scope_name_for_picker(scope, I18n.t("decidim.scopes.prompt"))
|
87
88
|
}
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
# on the layout.
|
6
6
|
module TooltipHelper
|
7
7
|
def with_tooltip(title, &block)
|
8
|
-
content_tag(:span, data: { tooltip: true, disable_hover: false, click_open: false },
|
8
|
+
content_tag(:span, data: { tooltip: true, disable_hover: false, keep_on_hover: true, click_open: false },
|
9
9
|
title: title, &block)
|
10
10
|
end
|
11
11
|
end
|
@@ -11,10 +11,7 @@ module Decidim
|
|
11
11
|
#
|
12
12
|
# Returns an HTML-safe String representing the HTML to render the author.
|
13
13
|
def render_resource_last_editor(resource)
|
14
|
-
|
15
|
-
locals: {
|
16
|
-
author: Decidim.traceability.last_editor(resource)
|
17
|
-
}
|
14
|
+
cell "decidim/version_author", Decidim.traceability.last_editor(resource)
|
18
15
|
end
|
19
16
|
|
20
17
|
# Renders the avatar and author name of the author of the given version.
|
@@ -23,10 +20,7 @@ module Decidim
|
|
23
20
|
#
|
24
21
|
# Returns an HTML-safe String representing the HTML to render the author.
|
25
22
|
def render_resource_editor(version)
|
26
|
-
|
27
|
-
locals: {
|
28
|
-
author: Decidim.traceability.version_editor(version)
|
29
|
-
}
|
23
|
+
cell "decidim/version_author", Decidim.traceability.version_editor(version)
|
30
24
|
end
|
31
25
|
end
|
32
26
|
end
|
@@ -54,6 +54,12 @@ module Decidim
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
|
57
|
+
def translated_in_current_locale?(attribute)
|
58
|
+
return false if attribute.nil?
|
59
|
+
|
60
|
+
attribute[I18n.locale.to_s].present?
|
61
|
+
end
|
62
|
+
|
63
|
+
module_function :multi_translation, :empty_translatable, :ensure_translatable, :translated_in_current_locale?
|
58
64
|
end
|
59
65
|
end
|
@@ -17,7 +17,7 @@ module Decidim
|
|
17
17
|
active = is_active_link?(link, (options[:aria_link_type] || :inclusive))
|
18
18
|
|
19
19
|
content_tag(:li, class: "tabs-title#{active ? " is-active" : nil}") do
|
20
|
-
|
20
|
+
link_to(text, link, options)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -2,10 +2,12 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module WidgetUrlsHelper
|
5
|
-
def embed_modal_for(url)
|
5
|
+
def embed_modal_for(url, options = {})
|
6
|
+
extra_locals = options[:locals] || {}
|
7
|
+
|
6
8
|
js_embed_code = String.new(content_tag(:script, "", src: url))
|
7
9
|
embed_code = String.new(content_tag(:noscript, content_tag(:iframe, "", src: url.gsub(".js", ".html"), frameborder: 0, scrolling: "vertical")))
|
8
|
-
render partial: "decidim/shared/embed_modal", locals: { js_embed_code: js_embed_code, embed_code: embed_code }
|
10
|
+
render partial: "decidim/shared/embed_modal", locals: { js_embed_code: js_embed_code, embed_code: embed_code }.merge(extra_locals)
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
@@ -4,18 +4,26 @@ module Decidim
|
|
4
4
|
class DataPortabilityExportJob < ApplicationJob
|
5
5
|
queue_as :default
|
6
6
|
|
7
|
-
def perform(user,
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
def perform(user, export_format = ::Decidim::DataPortabilityExporter::DEFAULT_EXPORT_FORMAT)
|
8
|
+
filename = "#{SecureRandom.urlsafe_base64}.zip"
|
9
|
+
path = Rails.root.join("tmp/#{filename}")
|
10
|
+
password = SecureRandom.urlsafe_base64
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
export_data << [klass.model_name.name.parameterize.pluralize, Decidim::Exporters.find_exporter(format).new(klass.user_collection(user), klass.export_serializer).export]
|
15
|
-
export_images << [klass.model_name.name.parameterize.pluralize, klass.data_portability_images(user).flatten] unless klass.data_portability_images(user).nil?
|
16
|
-
end
|
12
|
+
generate_zip_file(user, path, password, export_format)
|
13
|
+
save_or_upload_file(path)
|
17
14
|
|
18
|
-
ExportMailer.data_portability_export(user,
|
15
|
+
ExportMailer.data_portability_export(user, filename, password).deliver_later
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def generate_zip_file(user, path, password, export_format)
|
21
|
+
DataPortabilityExporter.new(user, path, password, export_format).export
|
22
|
+
end
|
23
|
+
|
24
|
+
# Saves to file system or uploads to storage service depending on the configuration.
|
25
|
+
def save_or_upload_file(path)
|
26
|
+
DataPortabilityUploader.new.store!(File.open(path, "rb"))
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
manifest.name == name.to_sym
|
10
10
|
end
|
11
11
|
|
12
|
-
collection = export_manifest.collection.call(component)
|
12
|
+
collection = export_manifest.collection.call(component, user)
|
13
13
|
serializer = export_manifest.serializer
|
14
14
|
|
15
15
|
export_data = Decidim::Exporters.find_exporter(format).new(collection, serializer).export
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
class ExportParticipatorySpaceJob < ApplicationJob
|
5
|
+
queue_as :default
|
6
|
+
|
7
|
+
def perform(user, participatory_space, name, format)
|
8
|
+
export_manifest = participatory_space.manifest.export_manifests.find do |manifest|
|
9
|
+
manifest.name == name.to_sym
|
10
|
+
end
|
11
|
+
|
12
|
+
collection = export_manifest.collection.call(participatory_space)
|
13
|
+
serializer = export_manifest.serializer
|
14
|
+
|
15
|
+
export_data = Decidim::Exporters.find_exporter(format).new(collection, serializer).export
|
16
|
+
|
17
|
+
Decidim::ExportMailer.export(user, name, export_data).deliver_now
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# This job is part of the machine translation flow. This one specifically
|
5
|
+
# delegates the arguments to the translation service, if any.
|
6
|
+
class MachineTranslationFieldsJob < ApplicationJob
|
7
|
+
queue_as :default
|
8
|
+
|
9
|
+
# Performs the job. It won't perform anything if the
|
10
|
+
# `Decidim.machine_translation_service` config is not set.
|
11
|
+
#
|
12
|
+
# resource - Any kind of `Decidim::TranslatableResource` model instance
|
13
|
+
# field_name - A Symbol representing the name of the field being translated
|
14
|
+
# field_value - A String with the value of the field to translate
|
15
|
+
# target_locale - A Symbol representing the target locale for the translation
|
16
|
+
# source_locale - A Symbol representing the source locale for the translation
|
17
|
+
def perform(resource, field_name, field_value, target_locale, source_locale)
|
18
|
+
klass = Decidim.machine_translation_service_klass
|
19
|
+
return unless klass
|
20
|
+
|
21
|
+
klass.new(
|
22
|
+
resource,
|
23
|
+
field_name,
|
24
|
+
field_value,
|
25
|
+
target_locale,
|
26
|
+
source_locale
|
27
|
+
).translate
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# This job is part of the machine translation flow. This one is fired every
|
5
|
+
# time a `Decidim::TranslatableResource` is created or updated. If any of the
|
6
|
+
# attributes defines as translatable is modified, then for each of those
|
7
|
+
# attributes this job will schedule a `Decidim::MachineTranslationFieldsJob`.
|
8
|
+
class MachineTranslationResourceJob < ApplicationJob
|
9
|
+
queue_as :default
|
10
|
+
|
11
|
+
# Performs the job.
|
12
|
+
#
|
13
|
+
# resource - Any kind of `Decidim::TranslatableResource` model instance
|
14
|
+
# previous_changes - A Hash with the set fo changes. This is intended to be
|
15
|
+
# taken from `resource.previous_changes`, but we need to manually pass
|
16
|
+
# them to the job because the value gets lost when serializing the
|
17
|
+
# resource.
|
18
|
+
# source_locale - A Symbol representing the source locale for the translation
|
19
|
+
def perform(resource, previous_changes, source_locale)
|
20
|
+
return unless Decidim.machine_translation_service_klass
|
21
|
+
|
22
|
+
@resource = resource
|
23
|
+
@locales_to_be_translated = []
|
24
|
+
translatable_fields = @resource.class.translatable_fields_list.map(&:to_s)
|
25
|
+
translatable_fields.each do |field|
|
26
|
+
next unless @resource[field].is_a?(Hash) && previous_changes.keys.include?(field)
|
27
|
+
|
28
|
+
translated_locales = translated_locales_list(field)
|
29
|
+
remove_duplicate_translations(field, translated_locales) if @resource[field]["machine_translations"].present?
|
30
|
+
|
31
|
+
next unless default_locale_changed_or_translation_removed(previous_changes, field)
|
32
|
+
|
33
|
+
@locales_to_be_translated += pending_locales(translated_locales) if @locales_to_be_translated.blank?
|
34
|
+
|
35
|
+
@locales_to_be_translated.each do |target_locale|
|
36
|
+
MachineTranslationFieldsJob.perform_later(
|
37
|
+
resource,
|
38
|
+
field,
|
39
|
+
resource_field_value(
|
40
|
+
previous_changes,
|
41
|
+
field
|
42
|
+
),
|
43
|
+
target_locale,
|
44
|
+
source_locale
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def default_locale_changed_or_translation_removed(previous_changes, field)
|
51
|
+
default_locale = default_locale(@resource)
|
52
|
+
values = previous_changes[field]
|
53
|
+
old_value = values.first
|
54
|
+
new_value = values.last
|
55
|
+
return true unless old_value.is_a?(Hash)
|
56
|
+
|
57
|
+
return true if old_value[default_locale] != new_value[default_locale]
|
58
|
+
|
59
|
+
# In a case where the default locale isn't changed
|
60
|
+
# but a translation of a different locale is deleted
|
61
|
+
# We trigger a job to translate only for that locale
|
62
|
+
if old_value[default_locale] == new_value[default_locale]
|
63
|
+
locales_present = old_value.keys
|
64
|
+
locales_present.each do |locale|
|
65
|
+
@locales_to_be_translated << locale if old_value[locale] != new_value[locale] && new_value[locale] == ""
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
@locales_to_be_translated.present?
|
70
|
+
end
|
71
|
+
|
72
|
+
def resource_field_value(previous_changes, field)
|
73
|
+
values = previous_changes[field]
|
74
|
+
new_value = values.last
|
75
|
+
return new_value[default_locale(@resource)] if new_value.is_a?(Hash)
|
76
|
+
|
77
|
+
new_value
|
78
|
+
end
|
79
|
+
|
80
|
+
def default_locale(resource)
|
81
|
+
if resource.respond_to? :organization
|
82
|
+
resource.organization.default_locale.to_s
|
83
|
+
else
|
84
|
+
Decidim.available_locales.first.to_s
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def translated_locales_list(field)
|
89
|
+
return nil unless @resource[field].is_a? Hash
|
90
|
+
|
91
|
+
translated_locales = []
|
92
|
+
existing_locales = @resource[field].keys - ["machine_translations"]
|
93
|
+
existing_locales.each do |locale|
|
94
|
+
translated_locales << locale if @resource[field][locale].present?
|
95
|
+
end
|
96
|
+
|
97
|
+
translated_locales
|
98
|
+
end
|
99
|
+
|
100
|
+
def remove_duplicate_translations(field, translated_locales)
|
101
|
+
machine_translated_locale = @resource[field]["machine_translations"].keys
|
102
|
+
unless (translated_locales & machine_translated_locale).nil?
|
103
|
+
(translated_locales & machine_translated_locale).each { |key| @resource[field]["machine_translations"].delete key }
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def pending_locales(translated_locales)
|
108
|
+
available_locales = @resource.organization.available_locales.map(&:to_s) if @resource.respond_to? :organization
|
109
|
+
available_locales ||= Decidim.available_locales.map(&:to_s)
|
110
|
+
available_locales - translated_locales
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|