decidim-core 0.21.0 → 0.22.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/app/assets/config/decidim_core_manifest.js +3 -0
- data/app/assets/fonts/decidim/Roboto-Regular.svg +1 -10520
- 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 -1
- 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 +23 -1
- data/app/assets/javascripts/decidim/ajax_modals.js.es6 +3 -0
- 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/configuration.js.es6 +23 -0
- data/app/assets/javascripts/decidim/confirm.js.es6 +178 -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/diff_mode_dropdown.js.es6 +5 -7
- data/app/assets/javascripts/decidim/dropdowns_menus.js.es6 +32 -0
- 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 +1 -1
- data/app/assets/javascripts/decidim/form_filter.component.test.js +4 -4
- 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/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 +40 -3
- 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/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 +13 -11
- data/app/assets/stylesheets/decidim/_properties.scss +25 -0
- data/app/assets/stylesheets/decidim/_variables.scss +6 -24
- 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 -0
- 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 +198 -26
- data/app/assets/stylesheets/decidim/modules/_cards.scss +174 -23
- data/app/assets/stylesheets/decidim/modules/_collapsible-list.scss +21 -0
- data/app/assets/stylesheets/decidim/modules/_comments.scss +25 -1
- 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 +25 -1
- 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 +63 -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/_map.scss +11 -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 -72
- data/app/assets/stylesheets/decidim/modules/_navbar.scss +176 -26
- 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 +2 -2
- data/app/assets/stylesheets/decidim/modules/_progress-bar.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_reveal.scss +6 -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/_sticky.scss +5 -0
- data/app/assets/stylesheets/decidim/modules/_tags.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_timeline.scss +1 -2
- data/app/assets/stylesheets/decidim/modules/_typography.scss +47 -8
- data/app/assets/stylesheets/decidim/modules/_versions.scss +0 -1
- 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/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 +5 -2
- data/app/cells/decidim/author/profile_inline.erb +0 -1
- 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 +9 -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_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 +2 -2
- data/app/cells/decidim/card_m_cell.rb +3 -2
- 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 +10 -10
- data/app/cells/decidim/diff_cell.rb +11 -1
- 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 +13 -5
- data/app/cells/decidim/follow_button_cell.rb +29 -5
- data/app/cells/decidim/navbar_admin_link/show.erb +1 -1
- data/app/cells/decidim/navbar_admin_link_cell.rb +6 -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/search_results_section/show.erb +1 -1
- data/app/cells/decidim/tags_cell.rb +32 -2
- 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/attachment_methods.rb +40 -0
- data/app/commands/decidim/create_registration.rb +2 -1
- data/app/commands/decidim/create_user_group.rb +12 -0
- data/app/commands/decidim/destroy_account.rb +12 -0
- data/app/commands/decidim/endorse_resource.rb +64 -0
- data/app/commands/decidim/gallery_methods.rb +64 -0
- data/app/commands/decidim/invite_user_again.rb +2 -4
- data/app/commands/decidim/messaging/reply_to_conversation.rb +34 -3
- data/app/commands/decidim/messaging/start_conversation.rb +36 -5
- 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/impersonate_users.rb +13 -0
- data/app/controllers/concerns/decidim/resource_versions_concern.rb +28 -0
- data/app/controllers/decidim/devise/registrations_controller.rb +2 -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 +52 -12
- 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 +1 -0
- 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/attachment_form.rb +1 -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 +1 -0
- data/app/functions/decidim/core/component_finder_base.rb +10 -3
- data/app/functions/decidim/core/component_list_base.rb +8 -2
- 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 +5 -3
- data/app/helpers/decidim/application_helper.rb +7 -1
- data/app/helpers/decidim/check_boxes_tree_helper.rb +4 -5
- data/app/helpers/decidim/cta_button_helper.rb +1 -1
- data/app/helpers/decidim/decidim_form_helper.rb +23 -0
- data/app/helpers/decidim/endorsable_helper.rb +93 -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 +15 -2
- data/app/helpers/decidim/markup_helper.rb +9 -0
- data/app/helpers/decidim/messaging/conversation_helper.rb +61 -7
- data/app/helpers/decidim/orders_helper.rb +10 -1
- data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
- data/app/helpers/decidim/resource_versions_helper.rb +24 -7
- data/app/helpers/decidim/rich_text_editor_helper.rb +1 -0
- data/app/helpers/decidim/sanitize_helper.rb +10 -2
- data/app/helpers/decidim/tooltip_helper.rb +1 -1
- data/app/helpers/decidim/traceability_helper.rb +2 -8
- data/app/helpers/decidim/user_profile_helper.rb +1 -1
- data/app/helpers/decidim/widget_urls_helper.rb +4 -2
- data/app/jobs/decidim/event_publisher_job.rb +1 -1
- data/app/mailers/concerns/decidim/multitenant_asset_host.rb +33 -0
- data/app/mailers/decidim/application_mailer.rb +1 -0
- data/app/mailers/decidim/messaging/conversation_mailer.rb +53 -4
- data/app/mailers/decidim/newsletter_mailer.rb +22 -4
- data/app/middleware/decidim/strip_x_forwarded_host.rb +14 -0
- data/app/models/decidim/action_log.rb +1 -1
- data/app/models/decidim/amendment.rb +0 -18
- data/app/models/decidim/authorization.rb +24 -0
- data/app/models/decidim/component.rb +7 -0
- data/app/models/decidim/content_block.rb +5 -3
- data/app/models/decidim/endorsement.rb +30 -0
- data/app/models/decidim/messaging/conversation.rb +39 -11
- data/app/models/decidim/messaging/message.rb +31 -5
- data/app/models/decidim/messaging/participation.rb +1 -1
- data/app/models/decidim/messaging/receipt.rb +8 -0
- data/app/models/decidim/newsletter.rb +7 -1
- data/app/models/decidim/organization.rb +16 -7
- data/app/models/decidim/user.rb +32 -0
- data/app/models/decidim/user_group.rb +23 -0
- data/app/permissions/decidim/permissions.rb +19 -6
- data/app/presenters/decidim/admin_log/user_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/resource_locator_presenter.rb +2 -1
- 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/user_groups/admin_memberships.rb +3 -3
- data/app/services/decidim/activity_search.rb +1 -0
- data/app/services/decidim/base_diff_renderer.rb +25 -3
- data/app/services/decidim/events_manager.rb +4 -1
- data/app/types/decidim/core/decidim_type.rb +0 -4
- data/app/types/decidim/core/has_endorsable_input_sort.rb +17 -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/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/attachment_uploader.rb +1 -1
- data/app/uploaders/decidim/avatar_uploader.rb +4 -0
- data/app/uploaders/decidim/image_uploader.rb +28 -4
- data/app/uploaders/decidim/newsletter_template_image_uploader.rb +36 -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 +2 -0
- 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 +2 -2
- 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/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 +7 -8
- data/app/views/decidim/devise/sessions/new.html.erb +4 -6
- data/app/views/decidim/devise/shared/_newsletter_modal.html.erb +3 -3
- data/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +3 -1
- data/app/views/decidim/devise/shared/_omniauth_buttons_mini.html.erb +4 -1
- 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/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/_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/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/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/scopes/_scopes_picker_input.html.erb +11 -4
- data/app/views/decidim/scopes/picker.html.erb +26 -16
- data/app/views/decidim/searches/_count.html.erb +14 -11
- data/app/views/decidim/searches/_filters.html.erb +2 -2
- data/app/views/decidim/searches/index.html.erb +5 -3
- data/app/views/decidim/shared/_check_boxes_tree.html.erb +5 -3
- 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 +2 -2
- 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 +4 -4
- 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 +1 -1
- 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/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/_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 -0
- data/app/views/layouts/decidim/_head.html.erb +2 -0
- data/app/views/layouts/decidim/_js_configuration.html.erb +28 -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 -16
- 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 +1 -0
- data/config/initializers/devise.rb +11 -3
- data/config/initializers/invisible_captcha.rb +1 -0
- data/config/initializers/omniauth.rb +7 -1
- data/config/initializers/rack_attack.rb +25 -16
- data/config/locales/ar.yml +7 -5
- data/config/locales/bg-BG.yml +1512 -0
- data/config/locales/ca.yml +258 -6
- data/config/locales/cs.yml +297 -37
- data/config/locales/da-DK.yml +9 -0
- data/config/locales/de.yml +279 -5
- data/config/locales/el.yml +1443 -5
- data/config/locales/en.yml +263 -11
- data/config/locales/es-MX.yml +257 -5
- data/config/locales/es-PY.yml +257 -5
- data/config/locales/es.yml +257 -5
- data/config/locales/et-EE.yml +9 -0
- data/config/locales/eu.yml +7 -2
- data/config/locales/fi-plain.yml +258 -6
- data/config/locales/fi.yml +319 -67
- data/config/locales/fr-CA.yml +1585 -0
- data/config/locales/fr.yml +263 -5
- data/config/locales/ga-IE.yml +9 -0
- data/config/locales/gl.yml +7 -2
- data/config/locales/hr-HR.yml +9 -0
- data/config/locales/hu.yml +87 -5
- data/config/locales/id-ID.yml +7 -2
- data/config/locales/is-IS.yml +1 -0
- data/config/locales/it.yml +279 -27
- data/config/locales/ja-JP.yml +1578 -0
- data/config/locales/lt-LT.yml +9 -0
- data/config/locales/lv-LV.yml +1485 -0
- data/config/locales/mt-MT.yml +9 -0
- data/config/locales/nl.yml +261 -6
- data/config/locales/no.yml +117 -41
- data/config/locales/pl.yml +755 -406
- data/config/locales/pt-BR.yml +8 -4
- data/config/locales/pt.yml +875 -536
- data/config/locales/ro-RO.yml +1603 -0
- data/config/locales/ru.yml +6 -1
- data/config/locales/sk-SK.yml +1426 -0
- data/config/locales/sk.yml +1441 -0
- data/config/locales/sl.yml +71 -0
- data/config/locales/sr-CS.yml +129 -0
- data/config/locales/sv.yml +323 -24
- data/config/locales/tr-TR.yml +7 -2
- data/config/locales/uk.yml +6 -1
- data/config/routes.rb +5 -0
- data/db/migrate/20180810092428_move_organization_fields_to_hero_content_block.rb +2 -2
- 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/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/seeds.rb +1 -1
- data/{app/controllers/concerns → lib}/decidim/action_authorization.rb +0 -0
- data/lib/decidim/api/author_interface.rb +4 -0
- data/lib/decidim/api/endorsable_interface.rb +22 -0
- data/lib/decidim/api/participatory_space_interface.rb +2 -0
- data/lib/decidim/api/timestamps_interface.rb +2 -2
- data/lib/decidim/coauthorable.rb +1 -1
- data/lib/decidim/component_manifest.rb +14 -0
- 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_renderers.rb +1 -0
- data/lib/decidim/content_renderers/user_group_renderer.rb +30 -0
- data/lib/decidim/core.rb +65 -21
- data/lib/decidim/core/api.rb +1 -0
- data/lib/decidim/core/engine.rb +88 -6
- data/lib/decidim/core/test.rb +8 -0
- data/lib/decidim/core/test/factories.rb +103 -3
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +79 -0
- data/lib/decidim/core/test/shared_examples/back_to_list_button_examples.rb +17 -0
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +17 -2
- data/lib/decidim/core/test/shared_examples/edit_link_shared_examples.rb +5 -1
- 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/follows_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/input_sort_examples.rb +21 -0
- data/lib/decidim/core/test/shared_examples/logo_email.rb +20 -0
- data/lib/decidim/core/test/shared_examples/metric_manage_shared_context.rb +9 -0
- data/lib/decidim/core/test/shared_examples/permissions.rb +143 -0
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +4 -4
- data/lib/decidim/core/test/shared_examples/rich_text_editor_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/simple_event.rb +1 -0
- data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +165 -0
- data/lib/decidim/core/test/shared_examples/traceable_interface_examples.rb +3 -3
- 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/endorsable.rb +25 -0
- data/lib/decidim/events.rb +1 -0
- data/lib/decidim/events/user_group_event.rb +45 -0
- data/lib/decidim/exporters/csv.rb +1 -1
- data/lib/decidim/filter_form_builder.rb +15 -6
- data/lib/decidim/form_builder.rb +209 -23
- data/lib/decidim/has_attachments.rb +1 -1
- data/lib/decidim/participable.rb +6 -0
- data/lib/decidim/participatory_space_manifest.rb +15 -0
- data/lib/decidim/query_extensions.rb +9 -15
- data/lib/decidim/settings_manifest.rb +15 -1
- data/lib/decidim/view_model.rb +4 -0
- data/lib/tasks/decidim_tasks.rake +1 -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/svg4everybody.min.js +1 -2
- data/vendor/assets/javascripts/tribute.js +11 -4
- metadata +187 -31
- 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/resolvers/decidim/core/user_resolver.rb +0 -61
- data/app/views/decidim/messaging/conversations/_message.html.erb +0 -14
@@ -1,5 +1,5 @@
|
|
1
1
|
$(() => {
|
2
|
-
const $allDiffViews = $(".row
|
2
|
+
const $allDiffViews = $(".row.diff_view");
|
3
3
|
|
4
4
|
$(document).on("click", ".diff-view-by a.diff-view-mode", (event) => {
|
5
5
|
event.preventDefault();
|
@@ -8,11 +8,11 @@ $(() => {
|
|
8
8
|
|
9
9
|
if ($target.attr("id") === "diff-view-unified") {
|
10
10
|
$allDiffViews.addClass("hide");
|
11
|
-
$(".row
|
11
|
+
$(".row.diff_view_unified_escaped").removeClass("hide");
|
12
12
|
}
|
13
13
|
if ($target.attr("id") === "diff-view-split") {
|
14
14
|
$allDiffViews.addClass("hide");
|
15
|
-
$(".row
|
15
|
+
$(".row.diff_view_split_escaped").removeClass("hide");
|
16
16
|
}
|
17
17
|
})
|
18
18
|
|
@@ -20,8 +20,8 @@ $(() => {
|
|
20
20
|
event.preventDefault();
|
21
21
|
const $target = $(event.target);
|
22
22
|
$target.parents(".is-dropdown-submenu-parent").find("#diff-view-selected").text($target.text());
|
23
|
-
const $visibleDiffViewsId = $allDiffViews.not(".hide").first().attr("id").split("_").slice(
|
24
|
-
const $visibleDiffViews = $allDiffViews.filter(`[id
|
23
|
+
const $visibleDiffViewsId = $allDiffViews.not(".hide").first().attr("id").split("_").slice(1, -1).join("_");
|
24
|
+
const $visibleDiffViews = $allDiffViews.filter(`[id*=${$visibleDiffViewsId}]`)
|
25
25
|
|
26
26
|
if ($target.attr("id") === "escaped-html") {
|
27
27
|
$visibleDiffViews.filter("[id$=_unescaped]").addClass("hide");
|
@@ -32,6 +32,4 @@ $(() => {
|
|
32
32
|
$visibleDiffViews.filter("[id$=_unescaped]").removeClass("hide");
|
33
33
|
}
|
34
34
|
})
|
35
|
-
|
36
|
-
|
37
35
|
});
|
@@ -0,0 +1,32 @@
|
|
1
|
+
((exports) => {
|
2
|
+
// This will apply some fixes for the Foundation dropdown menu element
|
3
|
+
// according to W3C instructions at:
|
4
|
+
// https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-links.html
|
5
|
+
//
|
6
|
+
// NOTE:
|
7
|
+
// This needs to run AFTER Foundation has been initialized because those
|
8
|
+
// initializers will affect the drop down menu elements.
|
9
|
+
const fixDropdownMenus = () => {
|
10
|
+
exports.$("[data-dropdown-menu]").each((_i, element) => {
|
11
|
+
// This will break navigation on macOS VoiceOver app since it will let the
|
12
|
+
// user to focus on the li element instead of the <a> element where we
|
13
|
+
// actually need the focus to be in.
|
14
|
+
$("li.is-dropdown-submenu-parent", element).removeAttr("aria-haspopup").removeAttr("aria-label");
|
15
|
+
// Foundation marks the wrong role for the submenu elements
|
16
|
+
$("ul.is-dropdown-submenu", element).attr("role", "menu");
|
17
|
+
})
|
18
|
+
}
|
19
|
+
|
20
|
+
// Ensure the first element is always focused when a dropdown is opened as
|
21
|
+
// this would not always happen when using a screen reader. If this is not
|
22
|
+
// done, the screen reader will stay quiet when the menu opens which can lead
|
23
|
+
// to the blind user not understanding the menu has opened.
|
24
|
+
exports.$(() => {
|
25
|
+
exports.$("[data-dropdown-menu]").on("show.zf.dropdownMenu", (_i, element) => {
|
26
|
+
exports.$("li:first > a", element).focus();
|
27
|
+
});
|
28
|
+
});
|
29
|
+
|
30
|
+
exports.Decidim = exports.Decidim || {};
|
31
|
+
exports.Decidim.fixDropdownMenus = fixDropdownMenus;
|
32
|
+
})(window);
|
@@ -0,0 +1,69 @@
|
|
1
|
+
((exports) => {
|
2
|
+
const { icon } = exports.Decidim;
|
3
|
+
|
4
|
+
const EXCLUDE_CLASSES = [
|
5
|
+
"card--list__data__icon",
|
6
|
+
"footer-social__icon",
|
7
|
+
"logo-cityhall"
|
8
|
+
];
|
9
|
+
const EXCLUDE_REL = ["license", "decidim"];
|
10
|
+
|
11
|
+
const DEFAULT_MESSAGES = {
|
12
|
+
externalLink: "External link"
|
13
|
+
};
|
14
|
+
let MESSAGES = DEFAULT_MESSAGES;
|
15
|
+
|
16
|
+
class ExternalLink {
|
17
|
+
static configureMessages(messages) {
|
18
|
+
MESSAGES = exports.$.extend(DEFAULT_MESSAGES, messages);
|
19
|
+
}
|
20
|
+
|
21
|
+
constructor(link) {
|
22
|
+
this.$link = link;
|
23
|
+
|
24
|
+
this.setup();
|
25
|
+
}
|
26
|
+
|
27
|
+
setup() {
|
28
|
+
if (EXCLUDE_CLASSES.some((cls) => this.$link.hasClass(cls))) {
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
if (
|
32
|
+
EXCLUDE_REL.some((rel) => {
|
33
|
+
const linkRels = `${this.$link.attr("rel")}`.split(" ");
|
34
|
+
return linkRels.indexOf(rel) > -1;
|
35
|
+
})
|
36
|
+
) {
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
|
40
|
+
this.$link.addClass("external-link-container");
|
41
|
+
this.$link.append(` ${this.generateElement()}`);
|
42
|
+
}
|
43
|
+
|
44
|
+
generateElement() {
|
45
|
+
let content = `${this.generateIcon()}${this.generateScreenReaderLabel()}`;
|
46
|
+
|
47
|
+
return `<span class="external-link-indicator">${content}</span>`;
|
48
|
+
}
|
49
|
+
|
50
|
+
generateIcon() {
|
51
|
+
return icon("external-link");
|
52
|
+
}
|
53
|
+
|
54
|
+
generateScreenReaderLabel() {
|
55
|
+
return `<span class="show-for-sr">(${MESSAGES.externalLink})</span>`;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
exports.Decidim = exports.Decidim || {};
|
60
|
+
exports.Decidim.ExternalLink = ExternalLink;
|
61
|
+
|
62
|
+
$(document).ready(function() {
|
63
|
+
$('a[target="_blank"]').each((_i, elem) => {
|
64
|
+
const $link = $(elem);
|
65
|
+
|
66
|
+
$link.data("external-link", new ExternalLink($link));
|
67
|
+
});
|
68
|
+
});
|
69
|
+
})(window);
|
@@ -28,6 +28,13 @@ $(function() {
|
|
28
28
|
$(".floating-helper-container").each((_index, elem) => {
|
29
29
|
let id = $(elem).data("help-id");
|
30
30
|
|
31
|
+
$(
|
32
|
+
".floating-helper__trigger, .floating-helper__content-close",
|
33
|
+
elem
|
34
|
+
).on("click", (ev) => {
|
35
|
+
ev.preventDefault();
|
36
|
+
});
|
37
|
+
|
31
38
|
if (!dismissedHelpers.includes(id)) {
|
32
39
|
$(".floating-helper", elem).foundation("toggle");
|
33
40
|
$(".floating-helper__wrapper", elem).foundation("toggle");
|
@@ -48,7 +48,7 @@
|
|
48
48
|
if (this.$form.length > 0 && !this.mounted) {
|
49
49
|
this.mounted = true;
|
50
50
|
|
51
|
-
this.$form.on("change", "input, select", this._onFormChange);
|
51
|
+
this.$form.on("change", "input:not([data-disable-dynamic-change]), select:not([data-disable-dynamic-change])", this._onFormChange);
|
52
52
|
|
53
53
|
this.currentFormRequest = null;
|
54
54
|
this.$form.on("ajax:beforeSend", (e) => {
|
@@ -22,10 +22,10 @@ describe("FormFilterComponent", () => {
|
|
22
22
|
<div id="filter_somerandomid_scope_id" class="data-picker picker-multiple" data-picker-name="filter[scope_id]">
|
23
23
|
<div class="picker-values">
|
24
24
|
<div>
|
25
|
-
<a href="picker_url_1" data-picker-value="
|
25
|
+
<a href="picker_url_1" data-picker-value="3">Scope 1</a>
|
26
26
|
</div>
|
27
27
|
<div>
|
28
|
-
<a href="picker_url_2" data-picker-value="
|
28
|
+
<a href="picker_url_2" data-picker-value="4">Scope 2</a>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
<div class="picker-prompt">
|
@@ -44,7 +44,7 @@ describe("FormFilterComponent", () => {
|
|
44
44
|
<fieldset>
|
45
45
|
<input type="hidden" name="filter[state][]" id="filter_state_" value="">
|
46
46
|
<label data-global-checkbox="" for="filter_state_all">
|
47
|
-
<input data-checkboxes-tree="state-options"
|
47
|
+
<input data-checkboxes-tree="state-options" value="" type="checkbox" name="filter[state][]" id="filter_state_all" class="ignore-filter">
|
48
48
|
All
|
49
49
|
</label>
|
50
50
|
<div id="state-options" class="filters__subfilters ">
|
@@ -102,7 +102,7 @@ describe("FormFilterComponent", () => {
|
|
102
102
|
});
|
103
103
|
|
104
104
|
it("binds the form change event", () => {
|
105
|
-
expect(subject.$form.on).toHaveBeenCalledWith("change", "input, select", subject._onFormChange);
|
105
|
+
expect(subject.$form.on).toHaveBeenCalledWith("change", "input:not([data-disable-dynamic-change]), select:not([data-disable-dynamic-change])", subject._onFormChange);
|
106
106
|
});
|
107
107
|
|
108
108
|
describe("onpopstate event", () => {
|
@@ -0,0 +1,61 @@
|
|
1
|
+
((exports) => {
|
2
|
+
const DEFAULT_MESSAGES = {
|
3
|
+
correctErrors: "There are errors on the form, please correct them."
|
4
|
+
};
|
5
|
+
let MESSAGES = DEFAULT_MESSAGES;
|
6
|
+
|
7
|
+
class FormValidator {
|
8
|
+
static configureMessages(messages) {
|
9
|
+
MESSAGES = exports.$.extend(DEFAULT_MESSAGES, messages);
|
10
|
+
}
|
11
|
+
|
12
|
+
constructor(form) {
|
13
|
+
this.$form = form;
|
14
|
+
|
15
|
+
this.$form.on("form-error.decidim", () => {
|
16
|
+
this.handleError();
|
17
|
+
});
|
18
|
+
}
|
19
|
+
|
20
|
+
handleError() {
|
21
|
+
this.announceFormError();
|
22
|
+
|
23
|
+
$(".is-invalid-input:first", this.$form).focus();
|
24
|
+
}
|
25
|
+
|
26
|
+
/**
|
27
|
+
* This announces immediately to the screen reader that there are errors on
|
28
|
+
* the form that need to be fixed. Does not work on all screen readers but
|
29
|
+
* works e.g. in Windows+Firefox+NVDA and macOS+Safari+VoiceOver
|
30
|
+
* combinations.
|
31
|
+
*
|
32
|
+
* @returns {undefined}
|
33
|
+
*/
|
34
|
+
announceFormError() {
|
35
|
+
let $announce = $(".sr-announce", this.$form);
|
36
|
+
if ($announce.length > 0) {
|
37
|
+
$announce.remove();
|
38
|
+
}
|
39
|
+
$announce = $("<div />");
|
40
|
+
$announce.attr("class", "sr-announce show-for-sr");
|
41
|
+
$announce.attr("aria-live", "assertive");
|
42
|
+
this.$form.prepend($announce);
|
43
|
+
|
44
|
+
exports.setTimeout(() => {
|
45
|
+
$announce.text(MESSAGES.correctErrors);
|
46
|
+
}, 100);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
exports.Decidim = exports.Decidim || {};
|
51
|
+
exports.Decidim.FormValidator = FormValidator;
|
52
|
+
|
53
|
+
exports.$(() => {
|
54
|
+
exports.$("form").each((_i, el) => {
|
55
|
+
exports.$(el).data("form-validator", new FormValidator(exports.$(el)));
|
56
|
+
});
|
57
|
+
exports.$(document).on("forminvalid.zf.abide", function(_ev, form) {
|
58
|
+
form.trigger("form-error.decidim");
|
59
|
+
})
|
60
|
+
});
|
61
|
+
})(window);
|
@@ -1,28 +1,28 @@
|
|
1
|
-
// = require foundation.core.js
|
2
|
-
// = require foundation.util.box.js
|
3
|
-
// = require foundation.util.imageLoader.js
|
4
|
-
// = require foundation.util.keyboard.js
|
5
|
-
// = require foundation.util.mediaQuery.js
|
6
|
-
// = require foundation.util.motion.js
|
7
|
-
// = require foundation.util.nest.js
|
8
|
-
// = require foundation.util.timer.js
|
9
|
-
// = require foundation.util.touch.js
|
10
|
-
// = require foundation.util.triggers.js
|
11
|
-
// = require foundation.abide.js
|
12
|
-
// = require foundation.accordion.js
|
13
|
-
// = require foundation.accordionMenu.js
|
14
|
-
// = require foundation.drilldown.js
|
15
|
-
// = require foundation.dropdown.js
|
16
|
-
// = require foundation.dropdownMenu.js
|
17
|
-
// = require foundation.equalizer.js
|
18
|
-
// = require foundation.interchange.js
|
19
|
-
// = require foundation.magellan.js
|
20
|
-
// = require foundation.offcanvas.js
|
21
|
-
// = require foundation.responsiveMenu.js
|
22
|
-
// = require foundation.responsiveToggle.js
|
23
|
-
// = require foundation.reveal.js
|
24
|
-
// = require foundation.sticky.js
|
25
|
-
// = require foundation.tabs.js
|
26
|
-
// = require foundation.toggler.js
|
27
|
-
// = require foundation.tooltip.js
|
28
|
-
// = require foundation.responsiveAccordionTabs.js
|
1
|
+
// = require plugins/foundation.core.js
|
2
|
+
// = require plugins/foundation.util.box.js
|
3
|
+
// = require plugins/foundation.util.imageLoader.js
|
4
|
+
// = require plugins/foundation.util.keyboard.js
|
5
|
+
// = require plugins/foundation.util.mediaQuery.js
|
6
|
+
// = require plugins/foundation.util.motion.js
|
7
|
+
// = require plugins/foundation.util.nest.js
|
8
|
+
// = require plugins/foundation.util.timer.js
|
9
|
+
// = require plugins/foundation.util.touch.js
|
10
|
+
// = require plugins/foundation.util.triggers.js
|
11
|
+
// = require plugins/foundation.abide.js
|
12
|
+
// = require plugins/foundation.accordion.js
|
13
|
+
// = require plugins/foundation.accordionMenu.js
|
14
|
+
// = require plugins/foundation.drilldown.js
|
15
|
+
// = require plugins/foundation.dropdown.js
|
16
|
+
// = require plugins/foundation.dropdownMenu.js
|
17
|
+
// = require plugins/foundation.equalizer.js
|
18
|
+
// = require plugins/foundation.interchange.js
|
19
|
+
// = require plugins/foundation.magellan.js
|
20
|
+
// = require plugins/foundation.offcanvas.js
|
21
|
+
// = require plugins/foundation.responsiveMenu.js
|
22
|
+
// = require plugins/foundation.responsiveToggle.js
|
23
|
+
// = require plugins/foundation.reveal.js
|
24
|
+
// = require plugins/foundation.sticky.js
|
25
|
+
// = require plugins/foundation.tabs.js
|
26
|
+
// = require plugins/foundation.toggler.js
|
27
|
+
// = require plugins/foundation.tooltip.js
|
28
|
+
// = require plugins/foundation.responsiveAccordionTabs.js
|
@@ -0,0 +1,42 @@
|
|
1
|
+
((exports) => {
|
2
|
+
const DEFAULT_ATTRIBUTES = {
|
3
|
+
role: "none presentation"
|
4
|
+
};
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Generates a Decidim icon element and returns it as a string.
|
8
|
+
* @param {String} iconKey - the key of the icon to be generated
|
9
|
+
* @param {Object} attributes - extra attributes to define for the icon SVG
|
10
|
+
* @param {int} wait - number of milliseconds to wait before executing the function.
|
11
|
+
* @private
|
12
|
+
* @returns {Void} - Returns nothing.
|
13
|
+
*/
|
14
|
+
exports.Decidim.icon = (iconKey, attributes = {}) => {
|
15
|
+
const iconAttributes = exports.$.extend(DEFAULT_ATTRIBUTES, attributes);
|
16
|
+
const title = iconAttributes.title || iconAttributes.ariaLabel;
|
17
|
+
Reflect.deleteProperty(iconAttributes, "title");
|
18
|
+
|
19
|
+
const htmlAttributes = {
|
20
|
+
"class": `icon icon--${iconKey}`
|
21
|
+
};
|
22
|
+
Object.keys(iconAttributes).forEach((key) => {
|
23
|
+
// Convert the key to dash-format.
|
24
|
+
const newKey = key.replace(/([A-Z])/g, (ucw) => `-${ucw[0].toLowerCase()}`);
|
25
|
+
if (typeof htmlAttributes[key] === "undefined") {
|
26
|
+
htmlAttributes[newKey] = iconAttributes[key];
|
27
|
+
} else {
|
28
|
+
htmlAttributes[newKey] = `${htmlAttributes[newKey]} ${iconAttributes[key]}`;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
|
32
|
+
const iconsPath = exports.Decidim.config.get("icons_path");
|
33
|
+
const elHtml = `<svg><use href="${iconsPath}#icon-${iconKey}"></use></svg>`;
|
34
|
+
const $el = $(elHtml);
|
35
|
+
if (title) {
|
36
|
+
$el.prepend(`<title>${title}</title>`);
|
37
|
+
}
|
38
|
+
$el.attr(htmlAttributes);
|
39
|
+
|
40
|
+
return $("<div />").append($el).html();
|
41
|
+
};
|
42
|
+
})(window);
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/**
|
2
|
+
* Makes the #select-identity-button to open a popup for the user to
|
3
|
+
* select with which identity he wants to perform an action.
|
4
|
+
*
|
5
|
+
*/
|
6
|
+
$(document).ready(function () {
|
7
|
+
|
8
|
+
let button = $("#select-identity-button"),
|
9
|
+
identitiesUrl = null,
|
10
|
+
userIdentitiesDialog = $("#user-identities");
|
11
|
+
|
12
|
+
if (userIdentitiesDialog.length) {
|
13
|
+
identitiesUrl = userIdentitiesDialog.data("reveal-identities-url");
|
14
|
+
|
15
|
+
button.click(function () {
|
16
|
+
$.ajax(identitiesUrl).done(function(response) {
|
17
|
+
userIdentitiesDialog.html(response).foundation("open");
|
18
|
+
button.trigger("ajax:success")
|
19
|
+
});
|
20
|
+
});
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Manage the identity selector for endorsements.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
$(document).ready(function () {
|
30
|
+
$("#select-identity-button").on("ajax:success", function() {
|
31
|
+
// once reveal popup has been rendered register event callbacks
|
32
|
+
$("#user-identities ul.reveal__list li").each(function(index, elem) {
|
33
|
+
let liTag = $(elem)
|
34
|
+
liTag.on("click", function() {
|
35
|
+
let method = liTag.data("method"),
|
36
|
+
urlDataAttr = null;
|
37
|
+
if (method === "POST") {
|
38
|
+
urlDataAttr = "create_url";
|
39
|
+
} else {
|
40
|
+
urlDataAttr = "destroy_url";
|
41
|
+
}
|
42
|
+
$.ajax({
|
43
|
+
url: liTag.data(urlDataAttr),
|
44
|
+
method: method,
|
45
|
+
dataType: "script",
|
46
|
+
success: function() {
|
47
|
+
if (liTag.hasClass("selected")) {
|
48
|
+
liTag.removeClass("selected")
|
49
|
+
liTag.find(".icon--circle-check").addClass("invisible")
|
50
|
+
liTag.data("method", "POST")
|
51
|
+
} else {
|
52
|
+
liTag.addClass("selected")
|
53
|
+
liTag.find(".icon--circle-check").removeClass("invisible")
|
54
|
+
liTag.data("method", "DELETE")
|
55
|
+
}
|
56
|
+
}
|
57
|
+
})
|
58
|
+
})
|
59
|
+
});
|
60
|
+
});
|
61
|
+
})
|
@@ -0,0 +1,115 @@
|
|
1
|
+
((exports) => {
|
2
|
+
const COUNT_KEY = "%count%";
|
3
|
+
const DEFAULT_MESSAGES = {
|
4
|
+
charactersAtLeast: {
|
5
|
+
one: `at least ${COUNT_KEY} character`,
|
6
|
+
other: `at least ${COUNT_KEY} characters`
|
7
|
+
},
|
8
|
+
charactersLeft: {
|
9
|
+
one: `${COUNT_KEY} character left`,
|
10
|
+
other: `${COUNT_KEY} characters left`
|
11
|
+
}
|
12
|
+
};
|
13
|
+
let MESSAGES = DEFAULT_MESSAGES;
|
14
|
+
|
15
|
+
class InputCharacterCounter {
|
16
|
+
static configureMessages(messages) {
|
17
|
+
MESSAGES = exports.$.extend(DEFAULT_MESSAGES, messages);
|
18
|
+
}
|
19
|
+
|
20
|
+
constructor(input) {
|
21
|
+
this.$input = input;
|
22
|
+
this.$target = exports.$(this.$input.data("remaining-characters"));
|
23
|
+
this.minCharacters = parseInt(this.$input.attr("minlength"), 10);
|
24
|
+
this.maxCharacters = parseInt(this.$input.attr("maxlength"), 10);
|
25
|
+
|
26
|
+
if (this.$target.length < 1) {
|
27
|
+
let targetId = null;
|
28
|
+
if (this.$input.attr("id") && this.$input.attr("id").length > 0) {
|
29
|
+
targetId = `${this.$input.attr("id")}_characters`;
|
30
|
+
} else {
|
31
|
+
targetId = `characters_${Math.random().toString(36).substr(2, 9)}`;
|
32
|
+
}
|
33
|
+
|
34
|
+
this.$target = $(`<span id="${targetId}" class="form-input-extra-before" />`)
|
35
|
+
|
36
|
+
// If input is a hidden for WYSIWYG editor add it at the end
|
37
|
+
if (this.$input.parent().is(".editor")) {
|
38
|
+
this.$input.parent().after(this.$target);
|
39
|
+
}
|
40
|
+
// Prefix and suffix columns are wrapped in columns, so put the
|
41
|
+
// character counter before that.
|
42
|
+
else if (
|
43
|
+
this.$input.parent().is(".columns") &&
|
44
|
+
this.$input.parent().parent().is(".row")
|
45
|
+
) {
|
46
|
+
this.$input.parent().parent().after(this.$target);
|
47
|
+
} else {
|
48
|
+
this.$input.after(this.$target);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
if (this.$target.length > 0 && (this.maxCharacters > 0 || this.minCharacters > 0)) {
|
53
|
+
this.bindEvents();
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
bindEvents() {
|
58
|
+
// In WYSIWYG editors (Quill) we need to find the active editor from the
|
59
|
+
// DOM node. Quill has the experimental "find" method that should work
|
60
|
+
// fine in this case
|
61
|
+
if (Quill && this.$input.parent().is(".editor")) {
|
62
|
+
// Wait until the next javascript loop so Quill editors are created
|
63
|
+
setTimeout(() => {
|
64
|
+
const editor = Quill.find(this.$input.siblings(".editor-container")[0]);
|
65
|
+
editor.on("text-change", () => {
|
66
|
+
this.updateStatus();
|
67
|
+
});
|
68
|
+
})
|
69
|
+
}
|
70
|
+
this.$input.on("keyup", () => {
|
71
|
+
this.updateStatus();
|
72
|
+
});
|
73
|
+
this.updateStatus();
|
74
|
+
}
|
75
|
+
|
76
|
+
updateStatus() {
|
77
|
+
const numCharacters = this.$input.val().length;
|
78
|
+
const showMessages = [];
|
79
|
+
|
80
|
+
if (this.minCharacters > 0) {
|
81
|
+
let message = MESSAGES.charactersAtLeast.other;
|
82
|
+
if (this.minCharacters === 1) {
|
83
|
+
message = MESSAGES.charactersAtLeast.one;
|
84
|
+
}
|
85
|
+
showMessages.push(message.replace(COUNT_KEY, this.minCharacters));
|
86
|
+
}
|
87
|
+
|
88
|
+
if (this.maxCharacters > 0) {
|
89
|
+
const remaining = this.maxCharacters - numCharacters;
|
90
|
+
let message = MESSAGES.charactersLeft.other;
|
91
|
+
if (remaining === 1) {
|
92
|
+
message = MESSAGES.charactersLeft.one;
|
93
|
+
}
|
94
|
+
showMessages.push(message.replace(COUNT_KEY, remaining));
|
95
|
+
}
|
96
|
+
|
97
|
+
this.$target.text(showMessages.join(", "));
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
exports.Decidim = exports.Decidim || {};
|
102
|
+
exports.Decidim.InputCharacterCounter = InputCharacterCounter;
|
103
|
+
|
104
|
+
exports.$(() => {
|
105
|
+
exports.$("input[type='text'], textarea, .editor>input[type='hidden']").each((_i, elem) => {
|
106
|
+
const $input = exports.$(elem);
|
107
|
+
|
108
|
+
if (!$input.is("[minlength]") && !$input.is("[maxlength]")) {
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
|
112
|
+
$input.data("remaining-characters-counter", new InputCharacterCounter($input));
|
113
|
+
});
|
114
|
+
});
|
115
|
+
})(window);
|