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
@@ -18,11 +18,10 @@ module Decidim
|
|
18
18
|
}
|
19
19
|
options.merge!(checkbox_options)
|
20
20
|
|
21
|
-
if options
|
21
|
+
if options.delete(:is_root_check_box) == true
|
22
22
|
options[:label_options].merge!("data-global-checkbox": "")
|
23
23
|
options[:label_options].delete(:"data-children-checkbox")
|
24
24
|
end
|
25
|
-
options[:label_options].delete(:is_root_check_box)
|
26
25
|
|
27
26
|
options
|
28
27
|
end
|
@@ -62,7 +61,7 @@ module Decidim
|
|
62
61
|
end
|
63
62
|
|
64
63
|
categories_values = sorted_main_categories.flat_map do |category|
|
65
|
-
sorted_descendant_categories = category.descendants.sort_by do |subcategory|
|
64
|
+
sorted_descendant_categories = category.descendants.includes(:subcategories).sort_by do |subcategory|
|
66
65
|
[subcategory.weight, translated_attribute(subcategory.name, organization)]
|
67
66
|
end
|
68
67
|
|
@@ -83,7 +82,7 @@ module Decidim
|
|
83
82
|
end
|
84
83
|
|
85
84
|
def filter_scopes_values
|
86
|
-
main_scopes = current_participatory_space.scope.present? ? [current_participatory_space.scope] : current_participatory_space.scopes.top_level
|
85
|
+
main_scopes = current_participatory_space.scope.present? ? [current_participatory_space.scope] : current_participatory_space.scopes.top_level.includes(:scope_type, :children)
|
87
86
|
|
88
87
|
scopes_values = main_scopes.flat_map do |scope|
|
89
88
|
TreeNode.new(
|
@@ -104,7 +103,7 @@ module Decidim
|
|
104
103
|
return if scope.scope_type && scope.scope_type == current_participatory_space.try(:scope_type_max_depth)
|
105
104
|
return unless scope.children.any?
|
106
105
|
|
107
|
-
scope.children.flat_map do |child|
|
106
|
+
scope.children.includes(:scope_type, :children).flat_map do |child|
|
108
107
|
TreeNode.new(
|
109
108
|
TreePoint.new(child.id.to_s, translated_attribute(child.name, current_participatory_space.organization)),
|
110
109
|
scope_children_to_tree(child)
|
@@ -8,7 +8,7 @@ module Decidim
|
|
8
8
|
def cta_button
|
9
9
|
button_text = translated_attribute(current_organization.cta_button_text).presence || t("decidim.pages.home.hero.participate")
|
10
10
|
|
11
|
-
link_to button_text, cta_button_path, class: "hero-cta button expanded large button--sc"
|
11
|
+
link_to button_text, cta_button_path, class: "hero-cta button expanded large button--sc", title: t("decidim.pages.home.hero.participate_title")
|
12
12
|
end
|
13
13
|
|
14
14
|
# Finds the CTA button path to reuse it in other places.
|
@@ -17,6 +17,18 @@ module Decidim
|
|
17
17
|
options[:html] ||= {}
|
18
18
|
options[:html].update(novalidate: true)
|
19
19
|
|
20
|
+
# Generally called by form_for but we need the :url option generated
|
21
|
+
# already before that.
|
22
|
+
#
|
23
|
+
# See:
|
24
|
+
# https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/form_helper.rb#L459
|
25
|
+
if record.is_a?(ActiveRecord::Base)
|
26
|
+
object = record.is_a?(Array) ? record.last : record
|
27
|
+
format = options[:format]
|
28
|
+
apply_form_for_options!(record, object, options) if object
|
29
|
+
options[:format] = format if format
|
30
|
+
end
|
31
|
+
|
20
32
|
output = ""
|
21
33
|
output += base_error_messages(record).to_s
|
22
34
|
output += form_for(record, options, &block).to_s
|
@@ -183,6 +195,17 @@ module Decidim
|
|
183
195
|
end
|
184
196
|
end
|
185
197
|
|
198
|
+
# Helper method to show an explanation for the form's required fields that
|
199
|
+
# are marked with an asterisk character. This improves the accessibility of
|
200
|
+
# the forms.
|
201
|
+
#
|
202
|
+
# Returns an HTML-safe String.
|
203
|
+
def form_required_explanation
|
204
|
+
content_tag(:div, class: "help-text help-text-form-required-fields") do
|
205
|
+
I18n.t("forms.required_explanation")
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
186
209
|
def base_error_messages(record)
|
187
210
|
return unless record.respond_to?(:errors)
|
188
211
|
return unless record.errors[:base].any?
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# A Helper for views with Endorsable resources.
|
5
|
+
module EndorsableHelper
|
6
|
+
# Invokes the decidim/endorsement_buttons cell.
|
7
|
+
def endorsement_buttons_cell(resource)
|
8
|
+
cell("decidim/endorsement_buttons", resource)
|
9
|
+
end
|
10
|
+
|
11
|
+
# Invokes the decidim/endorsers_list cell.
|
12
|
+
def endorsers_list_cell(resource)
|
13
|
+
cell("decidim/endorsers_list", resource)
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Public: Checks if the given resource has been endorsed by all identities of the user.
|
18
|
+
#
|
19
|
+
# @param resource: The resource from which endorsements will be checked against.
|
20
|
+
# @param user: The user whose identities and endorsements will be checked against.
|
21
|
+
#
|
22
|
+
def fully_endorsed?(resource, user)
|
23
|
+
return false unless user
|
24
|
+
|
25
|
+
user_group_endorsements = Decidim::UserGroups::ManageableUserGroups.for(user).verified.all? { |user_group| resource.endorsed_by?(user, user_group) }
|
26
|
+
|
27
|
+
user_group_endorsements && resource.endorsed_by?(user)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Public: Checks if endorsement are enabled in this step.
|
31
|
+
#
|
32
|
+
# Returns true if enabled, false otherwise.
|
33
|
+
def endorsements_enabled?
|
34
|
+
current_settings.endorsements_enabled
|
35
|
+
end
|
36
|
+
|
37
|
+
# Public: Checks if endorsements are blocked in this step.
|
38
|
+
#
|
39
|
+
# Returns true if blocked, false otherwise.
|
40
|
+
def endorsements_blocked?
|
41
|
+
current_settings.endorsements_blocked
|
42
|
+
end
|
43
|
+
|
44
|
+
# Public: Checks if the current user is allowed to endorse in this step.
|
45
|
+
#
|
46
|
+
# Returns true if the current user can endorse, false otherwise.
|
47
|
+
def current_user_can_endorse?
|
48
|
+
current_user && endorsements_enabled? && !endorsements_blocked?
|
49
|
+
end
|
50
|
+
|
51
|
+
# Public: Checks if the card for endorsements should be rendered.
|
52
|
+
#
|
53
|
+
# Returns true if the endorsements card should be rendered, false otherwise.
|
54
|
+
def show_endorsements_card?
|
55
|
+
endorsements_enabled?
|
56
|
+
end
|
57
|
+
|
58
|
+
# produces the path that should be POST to create an endorsement
|
59
|
+
def path_to_create_endorsement(resource, user_group = nil)
|
60
|
+
endorsements_path(resource_id: resource.to_gid.to_param,
|
61
|
+
user_group_id: user_group&.id,
|
62
|
+
authenticity_token: form_authenticity_token)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Produces the path that should be DELETE to destroy an endorsement.
|
66
|
+
def path_to_destroy_endorsement(resource, user_group = nil)
|
67
|
+
endorsement_path(resource.to_gid.to_param,
|
68
|
+
user_group_id: user_group&.id,
|
69
|
+
authenticity_token: form_authenticity_token)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Renders an identity for endorsement.
|
73
|
+
#
|
74
|
+
# Parameters:
|
75
|
+
# resources - The endorsable resource.
|
76
|
+
# user - The user that is endorsing at the end (mandatory).
|
77
|
+
# user_group - The user_group on behalf of which the endorsement is being done (optional).
|
78
|
+
def render_endorsement_identity(resource, user, user_group = nil)
|
79
|
+
presenter = if user_group
|
80
|
+
Decidim::UserGroupPresenter.new(user_group)
|
81
|
+
else
|
82
|
+
Decidim::UserPresenter.new(user)
|
83
|
+
end
|
84
|
+
selected = resource.endorsed_by?(user, user_group)
|
85
|
+
http_method = selected ? :delete : :post
|
86
|
+
render partial: "decidim/endorsements/identity", locals:
|
87
|
+
{ identity: presenter, selected: selected,
|
88
|
+
http_method: http_method,
|
89
|
+
create_url: path_to_create_endorsement(resource, user_group),
|
90
|
+
destroy_url: path_to_destroy_endorsement(resource, user_group) }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -6,14 +6,24 @@ module Decidim
|
|
6
6
|
# This method wraps everything in a div with class filters and calls
|
7
7
|
# the form_for helper with a custom builder
|
8
8
|
#
|
9
|
-
# filter
|
10
|
-
# url
|
11
|
-
#
|
9
|
+
# filter - A filter object
|
10
|
+
# url - A String with the URL to post the from. Self URL by default.
|
11
|
+
# html_options - Extra HTML options to be passed to form_for
|
12
|
+
# block - A block to be called with the form builder
|
12
13
|
#
|
13
14
|
# Returns the filter resource form wrapped in a div
|
14
|
-
def filter_form_for(filter, url = url_for)
|
15
|
+
def filter_form_for(filter, url = url_for, html_options = {})
|
15
16
|
content_tag :div, class: "filters" do
|
16
|
-
form_for
|
17
|
+
form_for(
|
18
|
+
filter,
|
19
|
+
namespace: filter_form_namespace,
|
20
|
+
builder: FilterFormBuilder,
|
21
|
+
url: url,
|
22
|
+
as: :filter,
|
23
|
+
method: :get,
|
24
|
+
remote: true,
|
25
|
+
html: { id: nil }.merge(html_options)
|
26
|
+
) do |form|
|
17
27
|
yield form
|
18
28
|
end
|
19
29
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# A Helper for views with Followable resources.
|
5
|
+
module FollowableHelper
|
6
|
+
# Invokes the decidim/shared/follow_button partial.
|
7
|
+
def follow_button_for(model, large = nil)
|
8
|
+
render partial: "decidim/shared/follow_button.html", locals: { followable: model, large: large }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -21,6 +21,7 @@ module Decidim
|
|
21
21
|
# options - The Hash options used to customize the icon (default {}):
|
22
22
|
# :width - The Number of width in pixels (optional).
|
23
23
|
# :height - The Number of height in pixels (optional).
|
24
|
+
# :title - The title for the SVG element (optional, similar to alt for img)
|
24
25
|
# :aria_label - The String to set as aria label (optional).
|
25
26
|
# :aria_hidden - The Truthy value to enable aria_hidden (optional).
|
26
27
|
# :role - The String to set as the role (optional).
|
@@ -32,14 +33,17 @@ module Decidim
|
|
32
33
|
|
33
34
|
html_properties["width"] = options[:width]
|
34
35
|
html_properties["height"] = options[:height]
|
35
|
-
html_properties["aria-label"] = options[:aria_label]
|
36
|
-
html_properties["role"] = options[:role]
|
37
|
-
html_properties["aria-hidden"] = options[:aria_hidden]
|
36
|
+
html_properties["aria-label"] = options[:aria_label] || options[:"aria-label"] || options["aria-label"]
|
37
|
+
html_properties["role"] = options[:role] || "img"
|
38
|
+
html_properties["aria-hidden"] = options[:aria_hidden] || options[:"aria-hidden"] || options["aria-hidden"]
|
38
39
|
|
39
40
|
html_properties["class"] = (["icon--#{name}"] + _icon_classes(options)).join(" ")
|
40
41
|
|
41
42
|
content_tag :svg, html_properties do
|
42
|
-
content_tag :
|
43
|
+
inner = content_tag :title, options["title"] || html_properties["aria-label"]
|
44
|
+
inner += content_tag :use, nil, role: options[:role], "href" => "#{asset_path("decidim/icons.svg")}#icon-#{name}"
|
45
|
+
|
46
|
+
inner
|
43
47
|
end
|
44
48
|
end
|
45
49
|
|
@@ -54,13 +58,21 @@ module Decidim
|
|
54
58
|
classes = _icon_classes(options) + ["external-icon"]
|
55
59
|
|
56
60
|
if path.split(".").last == "svg"
|
61
|
+
attributes = { class: classes.join(" ") }.merge(options)
|
57
62
|
asset = Rails.application.assets_manifest.find_sources(path).first
|
58
|
-
asset.gsub("<svg ", "<svg
|
63
|
+
asset.gsub("<svg ", "<svg#{tag_builder.tag_options(attributes)} ").html_safe
|
59
64
|
else
|
60
65
|
image_tag(path, class: classes.join(" "), style: "display: none")
|
61
66
|
end
|
62
67
|
end
|
63
68
|
|
69
|
+
# Allows to create role attribute according to accessibility rules
|
70
|
+
#
|
71
|
+
# Returns role attribute string if role option is specified
|
72
|
+
def role(options = {})
|
73
|
+
"role=\"#{options[:role]}\" " if options[:role]
|
74
|
+
end
|
75
|
+
|
64
76
|
def _icon_classes(options = {})
|
65
77
|
classes = options[:remove_icon_class] ? [] : ["icon"]
|
66
78
|
classes += [options[:class]]
|
@@ -102,5 +114,11 @@ module Decidim
|
|
102
114
|
css = current_organization.colors.each.map { |k, v| "--#{k}: #{v};--#{k}-rgb: #{v[1..2].hex},#{v[3..4].hex},#{v[5..6].hex};" }.join
|
103
115
|
render partial: "layouts/decidim/organization_colors", locals: { css: css }
|
104
116
|
end
|
117
|
+
|
118
|
+
private
|
119
|
+
|
120
|
+
def tag_builder
|
121
|
+
@tag_builder ||= ActionView::Helpers::TagHelper::TagBuilder.new(self)
|
122
|
+
end
|
105
123
|
end
|
106
124
|
end
|
@@ -16,10 +16,14 @@ module Decidim
|
|
16
16
|
latitude = resource.latitude
|
17
17
|
longitude = resource.longitude
|
18
18
|
|
19
|
+
address_text = resource.try(:address)
|
20
|
+
address_text ||= t("latlng_text", latitude: latitude, longitude: longitude, scope: "decidim.map.static")
|
21
|
+
map_service_brand = t("map_service_brand", scope: "decidim.map.static")
|
22
|
+
|
19
23
|
map_url = "https://www.openstreetmap.org/?mlat=#{latitude}&mlon=#{longitude}#map=#{zoom}/#{latitude}/#{longitude}"
|
20
24
|
|
21
25
|
link_to map_url, target: "_blank", rel: "noopener" do
|
22
|
-
image_tag decidim.static_map_path(sgid: resource.to_sgid.to_s)
|
26
|
+
image_tag decidim.static_map_path(sgid: resource.to_sgid.to_s), alt: "#{map_service_brand} - #{address_text}"
|
23
27
|
end
|
24
28
|
end
|
25
29
|
|
@@ -41,8 +45,17 @@ module Decidim
|
|
41
45
|
end
|
42
46
|
|
43
47
|
content = capture { yield }.html_safe
|
48
|
+
help = content_tag(:div, class: "map__help") do
|
49
|
+
sr_content = content_tag(:p, t("screen_reader_explanation", scope: "decidim.map.dynamic"), class: "show-for-sr")
|
50
|
+
link = link_to(t("skip_button", scope: "decidim.map.dynamic"), "#map_bottom", class: "skip")
|
51
|
+
|
52
|
+
sr_content + link
|
53
|
+
end
|
44
54
|
content_tag :div, class: "row column" do
|
45
|
-
content_tag(:div, "", map_html_options)
|
55
|
+
map = content_tag(:div, "", map_html_options)
|
56
|
+
link = link_to("", "#", id: "map_bottom")
|
57
|
+
|
58
|
+
help + map + content + link
|
46
59
|
end
|
47
60
|
end
|
48
61
|
end
|
@@ -3,25 +3,47 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Messaging
|
5
5
|
module ConversationHelper
|
6
|
+
#
|
7
|
+
# Generates a visualization of users for listing conversations threads
|
8
|
+
#
|
9
|
+
def username_list(users, shorten = false)
|
10
|
+
return users.pluck(:name).join(", ") unless shorten
|
11
|
+
return users.pluck(:name).join(", ") unless users.count > 3
|
12
|
+
|
13
|
+
"#{users.first(3).pluck(:name).join(", ")} + #{users.count - 3}"
|
14
|
+
end
|
15
|
+
|
6
16
|
#
|
7
17
|
# Links to the conversation between the current user and another user
|
8
18
|
#
|
9
19
|
def link_to_current_or_new_conversation_with(user, title = t("decidim.contact"))
|
10
|
-
|
11
|
-
|
20
|
+
conversation_path = current_or_new_conversation_path_with(user)
|
21
|
+
if conversation_path
|
22
|
+
link_to conversation_path, title: title do
|
23
|
+
icon "envelope-closed", aria_label: title, class: "icon--small"
|
24
|
+
end
|
25
|
+
else
|
26
|
+
content_tag :span, title: t("decidim.user_contact_disabled"), data: { tooltip: true } do
|
27
|
+
icon "envelope-closed", aria_label: title, class: "icon--small muted"
|
28
|
+
end
|
12
29
|
end
|
13
30
|
end
|
14
31
|
|
15
32
|
#
|
16
33
|
# Finds the right path to the conversation the current user and another
|
17
|
-
# user.
|
34
|
+
# user (the interlocutor).
|
18
35
|
#
|
19
36
|
# * If there's no current user, it returns to the login form path.
|
20
37
|
#
|
21
|
-
# * If there's
|
22
|
-
#
|
38
|
+
# * If there's a prior existing conversation between the users it returns
|
39
|
+
# the path to the existing conversation.
|
40
|
+
#
|
41
|
+
# * If there's no prior conversation between the users, it checks if the
|
42
|
+
# the interlocutor accepts the current user to new conversation.
|
43
|
+
# If affirmative, it returns the new conversation form path.
|
23
44
|
#
|
24
|
-
# * Otherwise,
|
45
|
+
# * Otherwise returns nil, meaning that no conversation can be established
|
46
|
+
# with the interlocutor
|
25
47
|
#
|
26
48
|
# @param user [Decidim::User] The user to link to a conversation with
|
27
49
|
#
|
@@ -35,7 +57,7 @@ module Decidim
|
|
35
57
|
|
36
58
|
if conversation
|
37
59
|
decidim_routes.conversation_path(conversation)
|
38
|
-
|
60
|
+
elsif user.accepts_conversation?(current_user)
|
39
61
|
decidim_routes.new_conversation_path(recipient_id: user.id)
|
40
62
|
end
|
41
63
|
end
|
@@ -54,6 +76,38 @@ module Decidim
|
|
54
76
|
conversation.participants.to_set == participants.to_set
|
55
77
|
end
|
56
78
|
end
|
79
|
+
|
80
|
+
#
|
81
|
+
# Links to the conversation between the current user and another users group
|
82
|
+
#
|
83
|
+
def current_or_new_conversation_path_with_multiple(users)
|
84
|
+
decidim_routes = Decidim::Core::Engine.routes.url_helpers
|
85
|
+
return decidim_routes.new_user_session_path unless user_signed_in?
|
86
|
+
|
87
|
+
participants = users.to_a.prepend(current_user)
|
88
|
+
conversation = conversation_between_multiple(participants)
|
89
|
+
|
90
|
+
if conversation
|
91
|
+
decidim_routes.conversation_path(conversation)
|
92
|
+
else
|
93
|
+
decidim_routes.new_conversation_path(recipient_id: users.pluck(:id))
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
#
|
98
|
+
# Finds the conversation between the given participants
|
99
|
+
#
|
100
|
+
# @param participants [Array<Decidim::User>] The participants to find a
|
101
|
+
# conversation between.
|
102
|
+
#
|
103
|
+
# @return [Decidim::Messaging::Conversation]
|
104
|
+
def conversation_between_multiple(participants)
|
105
|
+
return if participants.to_set.length <= 1
|
106
|
+
|
107
|
+
UserConversations.for(participants.first).find do |conversation|
|
108
|
+
conversation.participants.to_set == participants.to_set
|
109
|
+
end
|
110
|
+
end
|
57
111
|
end
|
58
112
|
end
|
59
113
|
end
|
@@ -23,7 +23,16 @@ module Decidim
|
|
23
23
|
# options - An optional hash of options
|
24
24
|
# * i18n_scope - The scope of the i18n translations
|
25
25
|
def order_link(order, options = {})
|
26
|
-
|
26
|
+
i18n_scope = options.delete(:i18n_scope)
|
27
|
+
|
28
|
+
link_to(
|
29
|
+
t("#{i18n_scope}.#{order}"),
|
30
|
+
url_for(params.to_unsafe_h.merge(page: nil, order: order)),
|
31
|
+
{
|
32
|
+
data: { order: order },
|
33
|
+
remote: true
|
34
|
+
}.merge(options)
|
35
|
+
)
|
27
36
|
end
|
28
37
|
end
|
29
38
|
end
|