decidim-core 0.20.0 → 0.23.1.rc1
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/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 +30 -1
- 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_mentions.js.es6 +34 -9
- 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 +6 -5
- 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/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 +32 -9
- 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 -0
- 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/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/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/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 +4 -0
- data/app/models/decidim/component.rb +14 -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 +51 -3
- data/app/models/decidim/user_base_entity.rb +6 -2
- data/app/models/decidim/user_group.rb +23 -0
- data/app/permissions/decidim/permissions.rb +28 -6
- data/app/presenters/decidim/admin_log/user_presenter.rb +1 -1
- 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 +1 -1
- data/app/serializers/decidim/exporters/participatory_space_components_serializer.rb +1 -1
- data/app/serializers/decidim/importers/participatory_space_components_importer.rb +14 -5
- 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 +2 -0
- 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 -1
- 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 +13 -13
- 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 +10 -9
- 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 +3 -3
- 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 +3 -2
- 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/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 +3 -1
- data/app/views/layouts/decidim/_mini_footer.html.erb +7 -7
- 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 +21 -15
- 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 +11 -25
- 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 -20
- 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 +5 -0
- data/db/migrate/20180810092428_move_organization_fields_to_hero_content_block.rb +2 -2
- 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/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/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 +8 -6
- data/{app/controllers/concerns → lib}/decidim/action_authorization.rb +0 -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 +16 -2
- 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 +133 -34
- data/lib/decidim/core/api.rb +8 -0
- data/lib/decidim/core/engine.rb +149 -23
- data/lib/decidim/core/test.rb +15 -0
- data/lib/decidim/core/test/factories.rb +152 -10
- 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 +77 -11
- 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 +2 -3
- 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 -0
- data/lib/decidim/exporters/csv.rb +16 -2
- data/lib/decidim/exporters/excel.rb +1 -1
- data/lib/decidim/exporters/export_manifest.rb +35 -2
- data/lib/decidim/exporters/pdf.rb +56 -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 +239 -42
- 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 +35 -0
- data/lib/decidim/participatory_space_resourceable.rb +35 -1
- data/lib/decidim/query_extensions.rb +17 -37
- data/lib/decidim/resource_manifest.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 +4 -0
- 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 +11 -4
- metadata +438 -42
- 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/participatory_process_user_role.rb +0 -32
- data/app/resolvers/decidim/core/user_resolver.rb +0 -61
- data/app/views/decidim/messaging/conversations/_message.html.erb +0 -14
- 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
data/lib/decidim/core/api.rb
CHANGED
@@ -6,9 +6,17 @@ module Decidim
|
|
6
6
|
autoload :ComponentInterface, "decidim/api/component_interface"
|
7
7
|
autoload :AuthorInterface, "decidim/api/author_interface"
|
8
8
|
autoload :AuthorableInterface, "decidim/api/authorable_interface"
|
9
|
+
autoload :CoauthorableInterface, "decidim/api/coauthorable_interface"
|
9
10
|
autoload :CategorizableInterface, "decidim/api/categorizable_interface"
|
10
11
|
autoload :ScopableInterface, "decidim/api/scopable_interface"
|
11
12
|
autoload :AttachableInterface, "decidim/api/attachable_interface"
|
12
13
|
autoload :HashtagInterface, "decidim/api/hashtag_interface"
|
14
|
+
autoload :ParticipatorySpaceResourceableInterface, "decidim/api/participatory_space_resourceable_interface"
|
15
|
+
autoload :FingerprintInterface, "decidim/api/fingerprint_interface"
|
16
|
+
autoload :AmendableInterface, "decidim/api/amendable_interface"
|
17
|
+
autoload :AmendableEntityInterface, "decidim/api/amendable_entity_interface"
|
18
|
+
autoload :TraceableInterface, "decidim/api/traceable_interface"
|
19
|
+
autoload :TimestampsInterface, "decidim/api/timestamps_interface"
|
20
|
+
autoload :EndorsableInterface, "decidim/api/endorsable_interface"
|
13
21
|
end
|
14
22
|
end
|
data/lib/decidim/core/engine.rb
CHANGED
@@ -59,12 +59,14 @@ module Decidim
|
|
59
59
|
|
60
60
|
initializer "decidim.middleware" do |app|
|
61
61
|
app.config.middleware.insert_before Warden::Manager, Decidim::CurrentOrganization
|
62
|
+
app.config.middleware.insert_before Warden::Manager, Decidim::StripXForwardedHost
|
62
63
|
app.config.middleware.use BatchLoader::Middleware
|
63
64
|
end
|
64
65
|
|
65
66
|
initializer "decidim.assets" do |app|
|
66
67
|
app.config.assets.paths << File.expand_path("../../../app/assets/stylesheets", __dir__)
|
67
|
-
app.config.assets.precompile += %w(decidim_core_manifest.js
|
68
|
+
app.config.assets.precompile += %w(decidim_core_manifest.js
|
69
|
+
decidim/identity_selector_dialog)
|
68
70
|
|
69
71
|
Decidim.component_manifests.each do |component|
|
70
72
|
app.config.assets.precompile += [component.icon]
|
@@ -98,23 +100,67 @@ module Decidim
|
|
98
100
|
ActionView::Base.raise_on_missing_translations = true unless Rails.env.production?
|
99
101
|
end
|
100
102
|
|
101
|
-
initializer "decidim.geocoding" do
|
102
|
-
if Decidim.geocoder.present?
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
103
|
+
initializer "decidim.geocoding", after: :load_config_initializers do
|
104
|
+
Geocoder.configure(Decidim.geocoder) if Decidim.geocoder.present?
|
105
|
+
end
|
106
|
+
|
107
|
+
initializer "decidim.geocoding_extensions", after: "geocoder.insert_into_active_record" do
|
108
|
+
# Include it in ActiveRecord base in order to apply it to all models
|
109
|
+
# that may be using the `geocoded_by` or `reverse_geocoded_by` class
|
110
|
+
# methods injected by the Geocoder gem.
|
111
|
+
ActiveSupport.on_load :active_record do
|
112
|
+
ActiveRecord::Base.send(:include, Decidim::Geocodable)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
initializer "decidim.maps" do
|
117
|
+
Decidim::Map.register_category(:dynamic, Decidim::Map::Provider::DynamicMap)
|
118
|
+
Decidim::Map.register_category(:static, Decidim::Map::Provider::StaticMap)
|
119
|
+
Decidim::Map.register_category(:geocoding, Decidim::Map::Provider::Geocoding)
|
120
|
+
Decidim::Map.register_category(:autocomplete, Decidim::Map::Provider::Autocomplete)
|
121
|
+
end
|
122
|
+
|
123
|
+
# This keeps backwards compatibility with the old style of map
|
124
|
+
# configuration through Decidim.geocoder.
|
125
|
+
initializer "decidim.maps_legacysupport", after: :load_config_initializers do
|
126
|
+
next if Decidim.maps.present?
|
127
|
+
next if Decidim.geocoder.blank?
|
128
|
+
|
129
|
+
legacy_api_key ||= begin
|
130
|
+
if Decidim.geocoder[:here_api_key].present?
|
131
|
+
Decidim.geocoder.fetch(:here_api_key)
|
132
|
+
elsif Decidim.geocoder[:here_app_id].present?
|
133
|
+
[
|
134
|
+
Decidim.geocoder.fetch(:here_app_id),
|
135
|
+
Decidim.geocoder.fetch(:here_app_code)
|
136
|
+
]
|
137
|
+
end
|
138
|
+
end
|
139
|
+
next unless legacy_api_key
|
140
|
+
|
141
|
+
ActiveSupport::Deprecation.warn(
|
142
|
+
<<~DEPRECATION.strip
|
143
|
+
Configuring maps functionality has changed.
|
144
|
+
|
145
|
+
Please update your current Decidim.geocoder configurations to the following format:
|
146
|
+
|
147
|
+
Decidim.configure do |config|
|
148
|
+
config.maps = {
|
149
|
+
provider: :here,
|
150
|
+
api_key: Rails.application.secrets.maps[:api_key],
|
151
|
+
static: { url: "#{Decidim.geocoder.fetch(:static_map_url)}" }
|
152
|
+
}
|
153
|
+
end
|
154
|
+
DEPRECATION
|
155
|
+
)
|
156
|
+
Decidim.configure do |config|
|
157
|
+
config.maps = {
|
158
|
+
provider: :here,
|
159
|
+
api_key: legacy_api_key,
|
160
|
+
static: {
|
161
|
+
url: Decidim.geocoder.fetch(:static_map_url)
|
162
|
+
}
|
163
|
+
}
|
118
164
|
end
|
119
165
|
end
|
120
166
|
|
@@ -191,7 +237,7 @@ module Decidim
|
|
191
237
|
|
192
238
|
initializer "decidim.content_processors" do |_app|
|
193
239
|
Decidim.configure do |config|
|
194
|
-
config.content_processors += [:user, :hashtag, :link]
|
240
|
+
config.content_processors += [:user, :user_group, :hashtag, :link]
|
195
241
|
end
|
196
242
|
end
|
197
243
|
|
@@ -235,9 +281,7 @@ module Decidim
|
|
235
281
|
# #call can be used in order to allow conditional checks (to allow non-SSL
|
236
282
|
# redirects to localhost for example).
|
237
283
|
#
|
238
|
-
|
239
|
-
#
|
240
|
-
force_ssl_in_redirect_uri false
|
284
|
+
force_ssl_in_redirect_uri !Rails.env.development?
|
241
285
|
|
242
286
|
# WWW-Authenticate Realm (default "Doorkeeper").
|
243
287
|
realm "Decidim"
|
@@ -250,6 +294,22 @@ module Decidim
|
|
250
294
|
end
|
251
295
|
end
|
252
296
|
|
297
|
+
initializer "SSL and HSTS" do
|
298
|
+
Rails.application.configure do
|
299
|
+
config.force_ssl = Rails.env.production? && Decidim.config.force_ssl
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
initializer "Disable Rack::Runtime" do
|
304
|
+
Rails.application.configure do
|
305
|
+
config.middleware.delete Rack::Runtime
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
initializer "Expire sessions" do
|
310
|
+
Rails.application.config.session_store :cookie_store, expire_after: Decidim.config.expire_session_after
|
311
|
+
end
|
312
|
+
|
253
313
|
initializer "decidim.core.register_resources" do
|
254
314
|
Decidim.register_resource(:user) do |resource|
|
255
315
|
resource.model_class_name = "Decidim::User"
|
@@ -297,7 +357,7 @@ module Decidim
|
|
297
357
|
end
|
298
358
|
end
|
299
359
|
|
300
|
-
initializer "decidim.core.
|
360
|
+
initializer "decidim.core.homepage_content_blocks" do
|
301
361
|
Decidim.content_blocks.register(:homepage, :hero) do |content_block|
|
302
362
|
content_block.cell = "decidim/content_blocks/hero"
|
303
363
|
content_block.settings_form_cell = "decidim/content_blocks/hero_settings_form"
|
@@ -369,6 +429,68 @@ module Decidim
|
|
369
429
|
end
|
370
430
|
end
|
371
431
|
|
432
|
+
initializer "decidim.core.newsletter_templates" do
|
433
|
+
Decidim.content_blocks.register(:newsletter_template, :basic_only_text) do |content_block|
|
434
|
+
content_block.cell = "decidim/newsletter_templates/basic_only_text"
|
435
|
+
content_block.settings_form_cell = "decidim/newsletter_templates/basic_only_text_settings_form"
|
436
|
+
content_block.public_name_key = "decidim.newsletter_templates.basic_only_text.name"
|
437
|
+
|
438
|
+
content_block.settings do |settings|
|
439
|
+
settings.attribute(
|
440
|
+
:body,
|
441
|
+
type: :text,
|
442
|
+
translated: true,
|
443
|
+
preview: -> { I18n.t("decidim.newsletter_templates.basic_only_text.body_preview") }
|
444
|
+
)
|
445
|
+
end
|
446
|
+
|
447
|
+
content_block.default!
|
448
|
+
end
|
449
|
+
|
450
|
+
Decidim.content_blocks.register(:newsletter_template, :image_text_cta) do |content_block|
|
451
|
+
content_block.cell = "decidim/newsletter_templates/image_text_cta"
|
452
|
+
content_block.settings_form_cell = "decidim/newsletter_templates/image_text_cta_settings_form"
|
453
|
+
content_block.public_name_key = "decidim.newsletter_templates.image_text_cta.name"
|
454
|
+
|
455
|
+
content_block.images = [
|
456
|
+
{
|
457
|
+
name: :main_image,
|
458
|
+
uploader: "Decidim::NewsletterTemplateImageUploader",
|
459
|
+
preview: -> { ActionController::Base.helpers.asset_path("decidim/placeholder.jpg") }
|
460
|
+
}
|
461
|
+
]
|
462
|
+
|
463
|
+
content_block.settings do |settings|
|
464
|
+
settings.attribute(
|
465
|
+
:introduction,
|
466
|
+
type: :text,
|
467
|
+
translated: true,
|
468
|
+
preview: -> { I18n.t("decidim.newsletter_templates.image_text_cta.introduction_preview") }
|
469
|
+
)
|
470
|
+
settings.attribute(
|
471
|
+
:body,
|
472
|
+
type: :text,
|
473
|
+
translated: true,
|
474
|
+
preview: -> { I18n.t("decidim.newsletter_templates.image_text_cta.body_preview") }
|
475
|
+
)
|
476
|
+
settings.attribute(
|
477
|
+
:cta_text,
|
478
|
+
type: :text,
|
479
|
+
translated: true,
|
480
|
+
preview: -> { I18n.t("decidim.newsletter_templates.image_text_cta.cta_text_preview") }
|
481
|
+
)
|
482
|
+
settings.attribute(
|
483
|
+
:cta_url,
|
484
|
+
type: :text,
|
485
|
+
translated: true,
|
486
|
+
preview: -> { "http://decidim.org" }
|
487
|
+
)
|
488
|
+
end
|
489
|
+
|
490
|
+
content_block.default!
|
491
|
+
end
|
492
|
+
end
|
493
|
+
|
372
494
|
initializer "decidim.core.add_badges" do
|
373
495
|
Decidim::Gamification.register_badge(:invitations) do |badge|
|
374
496
|
badge.levels = [1, 5, 10, 30, 50]
|
@@ -384,6 +506,10 @@ module Decidim
|
|
384
506
|
initializer "nbspw" do
|
385
507
|
NOBSPW.configuration.use_ruby_grep = true
|
386
508
|
end
|
509
|
+
|
510
|
+
config.to_prepare do
|
511
|
+
FoundationRailsHelper::FlashHelper.send(:include, Decidim::FlashHelperExtensions)
|
512
|
+
end
|
387
513
|
end
|
388
514
|
end
|
389
515
|
end
|
data/lib/decidim/core/test.rb
CHANGED
@@ -5,6 +5,7 @@ require "decidim/core/test/shared_examples/authorable"
|
|
5
5
|
require "decidim/core/test/shared_examples/coauthorable"
|
6
6
|
require "decidim/core/test/shared_examples/publicable"
|
7
7
|
require "decidim/core/test/shared_examples/localised_email"
|
8
|
+
require "decidim/core/test/shared_examples/logo_email"
|
8
9
|
require "decidim/core/test/shared_examples/has_attachments"
|
9
10
|
require "decidim/core/test/shared_examples/has_attachment_collections"
|
10
11
|
require "decidim/core/test/shared_examples/has_component"
|
@@ -23,11 +24,13 @@ require "decidim/core/test/shared_examples/user_localised_email_examples"
|
|
23
24
|
require "decidim/core/test/shared_examples/follows_examples"
|
24
25
|
require "decidim/core/test/shared_examples/simple_event"
|
25
26
|
require "decidim/core/test/shared_examples/component_type"
|
27
|
+
require "decidim/core/test/shared_examples/scopable_resource_examples"
|
26
28
|
require "decidim/core/test/shared_examples/fingerprint_examples"
|
27
29
|
require "decidim/core/test/shared_examples/searchable_results_examples"
|
28
30
|
require "decidim/core/test/shared_examples/has_space_in_mcell_examples"
|
29
31
|
require "decidim/core/test/shared_examples/railtie_examples"
|
30
32
|
require "decidim/core/test/shared_examples/edit_link_shared_examples"
|
33
|
+
require "decidim/core/test/shared_examples/endorsements_controller_shared_context"
|
31
34
|
require "decidim/core/test/shared_examples/amendable/create_amendment_draft_examples"
|
32
35
|
require "decidim/core/test/shared_examples/amendable/update_amendment_draft_examples"
|
33
36
|
require "decidim/core/test/shared_examples/amendable/destroy_amendment_draft_examples"
|
@@ -46,3 +49,15 @@ require "decidim/core/test/shared_examples/uncommentable_component_examples"
|
|
46
49
|
require "decidim/core/test/shared_examples/searchable_resources_shared_context"
|
47
50
|
require "decidim/core/test/shared_examples/searchable_participatory_space_examples"
|
48
51
|
require "decidim/core/test/shared_examples/has_private_users"
|
52
|
+
require "decidim/core/test/shared_examples/with_endorsable_permissions_examples"
|
53
|
+
require "decidim/core/test/shared_examples/system_endorse_resource_examples"
|
54
|
+
require "decidim/core/test/shared_examples/rich_text_editor_examples"
|
55
|
+
require "decidim/core/test/shared_examples/back_to_list_button_examples"
|
56
|
+
require "decidim/core/test/shared_examples/permissions"
|
57
|
+
require "decidim/core/test/shared_examples/admin_resource_gallery_examples"
|
58
|
+
require "decidim/core/test/shared_examples/map_examples"
|
59
|
+
require "decidim/core/test/shared_examples/preview_component_with_share_token_examples"
|
60
|
+
require "decidim/core/test/shared_examples/manage_component_share_tokens"
|
61
|
+
require "decidim/core/test/shared_examples/metric_manage_shared_context"
|
62
|
+
require "decidim/core/test/shared_examples/embed_resource_examples"
|
63
|
+
require "decidim/core/test/shared_examples/resource_search_examples"
|
@@ -13,7 +13,7 @@ end
|
|
13
13
|
|
14
14
|
FactoryBot.define do
|
15
15
|
sequence(:title) do |n|
|
16
|
-
"#{Faker::Lorem.sentence(3)} #{n}"
|
16
|
+
"#{Faker::Lorem.sentence(3)} #{n}".delete("'")
|
17
17
|
end
|
18
18
|
|
19
19
|
sequence(:name) do |n|
|
@@ -21,11 +21,11 @@ FactoryBot.define do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
sequence(:nickname) do |n|
|
24
|
-
"#{Faker::Lorem.characters(rand(1..10))}_#{n}"
|
24
|
+
"#{Faker::Lorem.characters(rand(1..10))}_#{n}".gsub("'", "_")
|
25
25
|
end
|
26
26
|
|
27
27
|
sequence(:hashtag_name) do |n|
|
28
|
-
"#{Faker::Lorem.characters(rand(1..10))}_#{n}"
|
28
|
+
"#{Faker::Lorem.characters(rand(1..10))}_#{n}".gsub("'", "_")
|
29
29
|
end
|
30
30
|
|
31
31
|
sequence(:email) do |n|
|
@@ -37,7 +37,7 @@ FactoryBot.define do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
sequence(:slug) do |n|
|
40
|
-
"#{Faker::Internet.slug(nil, "-")}-#{n}"
|
40
|
+
"#{Faker::Internet.slug(nil, "-")}-#{n}".gsub("'", "_")
|
41
41
|
end
|
42
42
|
|
43
43
|
sequence(:scope_name) do |n|
|
@@ -69,6 +69,7 @@ FactoryBot.define do
|
|
69
69
|
factory :organization, class: "Decidim::Organization" do
|
70
70
|
name { Faker::Company.unique.name }
|
71
71
|
reference_prefix { Faker::Name.suffix }
|
72
|
+
time_zone { "UTC" }
|
72
73
|
twitter_handler { Faker::Hipster.word }
|
73
74
|
facebook_handler { Faker::Hipster.word }
|
74
75
|
instagram_handler { Faker::Hipster.word }
|
@@ -88,7 +89,10 @@ FactoryBot.define do
|
|
88
89
|
badges_enabled { true }
|
89
90
|
user_groups_enabled { true }
|
90
91
|
send_welcome_notification { true }
|
92
|
+
comments_max_length { 1000 }
|
93
|
+
admin_terms_of_use_body { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
91
94
|
force_users_to_authenticate_before_access_organization { false }
|
95
|
+
machine_translation_display_priority { "original" }
|
92
96
|
smtp_settings do
|
93
97
|
{
|
94
98
|
"from" => "test@example.org",
|
@@ -98,6 +102,7 @@ FactoryBot.define do
|
|
98
102
|
"address" => "smtp.example.org"
|
99
103
|
}
|
100
104
|
end
|
105
|
+
file_upload_settings { Decidim::OrganizationSettings.default(:upload) }
|
101
106
|
|
102
107
|
after(:create) do |organization|
|
103
108
|
tos_page = Decidim::StaticPage.find_by(slug: "terms-and-conditions", organization: organization)
|
@@ -130,12 +135,18 @@ FactoryBot.define do
|
|
130
135
|
deleted_at { Time.current }
|
131
136
|
end
|
132
137
|
|
138
|
+
trait :admin_terms_accepted do
|
139
|
+
admin_terms_accepted_at { Time.current }
|
140
|
+
end
|
141
|
+
|
133
142
|
trait :admin do
|
134
143
|
admin { true }
|
144
|
+
admin_terms_accepted
|
135
145
|
end
|
136
146
|
|
137
147
|
trait :user_manager do
|
138
148
|
roles { ["user_manager"] }
|
149
|
+
admin_terms_accepted
|
139
150
|
end
|
140
151
|
|
141
152
|
trait :managed do
|
@@ -173,9 +184,9 @@ FactoryBot.define do
|
|
173
184
|
sequence(:name) { |n| "#{Faker::Company.name} #{n}" }
|
174
185
|
email { generate(:user_group_email) }
|
175
186
|
nickname { generate(:nickname) }
|
176
|
-
avatar { Decidim::Dev.test_file("avatar.jpg", "image/jpeg") }
|
177
187
|
about { "<script>alert(\"ABOUT\");</script>" + Faker::Lorem.paragraph(2) }
|
178
188
|
organization
|
189
|
+
avatar { Decidim::Dev.test_file("avatar.jpg", "image/jpeg") } # Keep after organization
|
179
190
|
|
180
191
|
transient do
|
181
192
|
users { [] }
|
@@ -250,7 +261,7 @@ FactoryBot.define do
|
|
250
261
|
organization { build(:organization) }
|
251
262
|
|
252
263
|
trait :default do
|
253
|
-
slug {
|
264
|
+
slug { Decidim::StaticPage::DEFAULT_PAGES.sample }
|
254
265
|
end
|
255
266
|
|
256
267
|
trait :tos do
|
@@ -287,10 +298,10 @@ FactoryBot.define do
|
|
287
298
|
factory :attachment, class: "Decidim::Attachment" do
|
288
299
|
title { generate_localized_title }
|
289
300
|
description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
290
|
-
file { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
|
291
301
|
weight { Faker::Number.number(1) }
|
292
302
|
attached_to { build(:participatory_process) }
|
293
303
|
content_type { "image/jpeg" }
|
304
|
+
file { Decidim::Dev.test_file("city.jpeg", "image/jpeg") } # Keep after attached_to
|
294
305
|
file_size { 108_908 }
|
295
306
|
|
296
307
|
trait :with_image do
|
@@ -325,6 +336,15 @@ FactoryBot.define do
|
|
325
336
|
}
|
326
337
|
end
|
327
338
|
|
339
|
+
trait :with_one_step do
|
340
|
+
step_settings do
|
341
|
+
participatory_space_with_steps if participatory_space.active_step.nil?
|
342
|
+
{
|
343
|
+
participatory_space.active_step.id => { dummy_step_setting: true }
|
344
|
+
}
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
328
348
|
trait :unpublished do
|
329
349
|
published_at { nil }
|
330
350
|
end
|
@@ -344,6 +364,44 @@ FactoryBot.define do
|
|
344
364
|
trait :with_permissions do
|
345
365
|
settings { { Random.rand => Random.new.bytes(5) } }
|
346
366
|
end
|
367
|
+
|
368
|
+
transient do
|
369
|
+
participatory_space_with_steps do
|
370
|
+
create(:participatory_process_step,
|
371
|
+
active: true,
|
372
|
+
end_date: 1.month.from_now,
|
373
|
+
participatory_process: participatory_space)
|
374
|
+
participatory_space.reload
|
375
|
+
participatory_space.steps.reload
|
376
|
+
end
|
377
|
+
end
|
378
|
+
|
379
|
+
trait :with_endorsements_enabled do
|
380
|
+
step_settings do
|
381
|
+
participatory_space_with_steps if participatory_space.active_step.nil?
|
382
|
+
{
|
383
|
+
participatory_space.active_step.id => { endorsements_enabled: true }
|
384
|
+
}
|
385
|
+
end
|
386
|
+
end
|
387
|
+
|
388
|
+
trait :with_endorsements_disabled do
|
389
|
+
step_settings do
|
390
|
+
participatory_space_with_steps if participatory_space.active_step.nil?
|
391
|
+
{
|
392
|
+
participatory_space.active_step.id => { endorsements_enabled: false }
|
393
|
+
}
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
trait :with_endorsements_blocked do
|
398
|
+
step_settings do
|
399
|
+
participatory_space_with_steps if participatory_space.active_step.nil?
|
400
|
+
{
|
401
|
+
participatory_space.active_step.id => { endorsements_blocked: true }
|
402
|
+
}
|
403
|
+
end
|
404
|
+
end
|
347
405
|
end
|
348
406
|
|
349
407
|
factory :scope_type, class: "Decidim::ScopeType" do
|
@@ -387,7 +445,12 @@ FactoryBot.define do
|
|
387
445
|
end
|
388
446
|
|
389
447
|
factory :dummy_resource, class: "Decidim::DummyResources::DummyResource" do
|
390
|
-
|
448
|
+
transient do
|
449
|
+
users { nil }
|
450
|
+
# user_groups correspondence to users is by sorting order
|
451
|
+
user_groups { [] }
|
452
|
+
end
|
453
|
+
title { Decidim::Faker::Localized.localized { generate(:name) } }
|
391
454
|
component { create(:component, manifest_name: "dummy") }
|
392
455
|
author { create(:user, :confirmed, organization: component.organization) }
|
393
456
|
scope { create(:scope, organization: component.organization) }
|
@@ -395,6 +458,38 @@ FactoryBot.define do
|
|
395
458
|
trait :published do
|
396
459
|
published_at { Time.current }
|
397
460
|
end
|
461
|
+
|
462
|
+
trait :with_endorsements do
|
463
|
+
after :create do |resource|
|
464
|
+
5.times.collect do
|
465
|
+
create(:endorsement, resource: resource, author: build(:user, organization: resource.component.organization))
|
466
|
+
end
|
467
|
+
end
|
468
|
+
end
|
469
|
+
end
|
470
|
+
|
471
|
+
factory :nested_dummy_resource, class: "Decidim::DummyResources::NestedDummyResource" do
|
472
|
+
title { generate(:name) }
|
473
|
+
dummy_resource { create(:dummy_resource) }
|
474
|
+
end
|
475
|
+
|
476
|
+
factory :coauthorable_dummy_resource, class: "Decidim::DummyResources::CoauthorableDummyResource" do
|
477
|
+
title { generate(:name) }
|
478
|
+
component { create(:component, manifest_name: "dummy") }
|
479
|
+
|
480
|
+
transient do
|
481
|
+
authors_list { [create(:user, organization: component.organization)] }
|
482
|
+
end
|
483
|
+
|
484
|
+
after :build do |resource, evaluator|
|
485
|
+
evaluator.authors_list.each do |coauthor|
|
486
|
+
resource.coauthorships << if coauthor.is_a?(::Decidim::UserGroup)
|
487
|
+
build(:coauthorship, author: coauthor.users.first, user_group: coauthor, coauthorable: resource, organization: evaluator.component.organization)
|
488
|
+
else
|
489
|
+
build(:coauthorship, author: coauthor, coauthorable: resource, organization: evaluator.component.organization)
|
490
|
+
end
|
491
|
+
end
|
492
|
+
end
|
398
493
|
end
|
399
494
|
|
400
495
|
factory :resource_link, class: "Decidim::ResourceLink" do
|
@@ -404,12 +499,25 @@ FactoryBot.define do
|
|
404
499
|
end
|
405
500
|
|
406
501
|
factory :newsletter, class: "Decidim::Newsletter" do
|
502
|
+
transient do
|
503
|
+
body { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
504
|
+
end
|
505
|
+
|
407
506
|
author { build(:user, :confirmed, organization: organization) }
|
408
507
|
organization
|
409
508
|
|
410
509
|
subject { generate_localized_title }
|
411
510
|
|
412
|
-
|
511
|
+
after(:create) do |newsletter, evaluator|
|
512
|
+
create(
|
513
|
+
:content_block,
|
514
|
+
:newsletter_template,
|
515
|
+
organization: evaluator.organization,
|
516
|
+
scoped_resource_id: newsletter.id,
|
517
|
+
manifest_name: "basic_only_text",
|
518
|
+
settings: evaluator.body.transform_keys { |key| "body_#{key}" }
|
519
|
+
)
|
520
|
+
end
|
413
521
|
|
414
522
|
trait :sent do
|
415
523
|
sent_at { Time.current }
|
@@ -531,10 +639,15 @@ FactoryBot.define do
|
|
531
639
|
|
532
640
|
factory :content_block, class: "Decidim::ContentBlock" do
|
533
641
|
organization
|
534
|
-
|
642
|
+
scope_name { :homepage }
|
535
643
|
manifest_name { :hero }
|
536
644
|
weight { 1 }
|
537
645
|
published_at { Time.current }
|
646
|
+
|
647
|
+
trait :newsletter_template do
|
648
|
+
scope_name { :newsletter_template }
|
649
|
+
manifest_name { :basic_only_text }
|
650
|
+
end
|
538
651
|
end
|
539
652
|
|
540
653
|
factory :hashtag, class: "Decidim::Hashtag" do
|
@@ -567,4 +680,33 @@ FactoryBot.define do
|
|
567
680
|
state { "rejected" }
|
568
681
|
end
|
569
682
|
end
|
683
|
+
|
684
|
+
factory :endorsement, class: "Decidim::Endorsement" do
|
685
|
+
resource { build(:dummy_resource) }
|
686
|
+
author { resource.try(:creator_author) || resource.try(:author) || build(:user, organization: resource.organization) }
|
687
|
+
end
|
688
|
+
|
689
|
+
factory :user_group_endorsement, class: "Decidim::Endorsement" do
|
690
|
+
resource { build(:dummy_resource) }
|
691
|
+
author { build(:user, organization: resource.organization) }
|
692
|
+
user_group { create(:user_group, verified_at: Time.current, organization: resource.organization, users: [author]) }
|
693
|
+
end
|
694
|
+
|
695
|
+
factory :share_token, class: "Decidim::ShareToken" do
|
696
|
+
token_for { build(:component) }
|
697
|
+
user { build(:user, organization: token_for.organization) }
|
698
|
+
|
699
|
+
before(:create) do |object|
|
700
|
+
object.organization ||= object.token_for.organization
|
701
|
+
end
|
702
|
+
|
703
|
+
trait :expired do
|
704
|
+
expires_at { 1.day.ago }
|
705
|
+
end
|
706
|
+
|
707
|
+
trait :used do
|
708
|
+
times_used { 3 }
|
709
|
+
last_used_at { 1.hour.ago }
|
710
|
+
end
|
711
|
+
end
|
570
712
|
end
|