decidim-core 0.15.2 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +14 -1
- data/app/assets/config/decidim_core_manifest.js +14 -12
- data/app/assets/images/decidim/pattern.png +0 -0
- data/app/assets/javascripts/decidim.js.es6 +4 -0
- data/app/assets/javascripts/decidim/floating_help.js.es6 +40 -0
- data/app/assets/javascripts/decidim/input_hashtags.js.es6 +6 -4
- data/app/assets/javascripts/decidim/notifications.js.es6 +1 -1
- data/app/assets/javascripts/decidim/tooltip_keep_on_hover.js.es6 +18 -0
- data/app/assets/javascripts/decidim/vizzs/areachart.js.es6 +52 -10
- data/app/assets/javascripts/decidim/vizzs/metrics.js.es6 +68 -22
- data/app/assets/javascripts/decidim/vizzs/orgchart.js.es6 +10 -13
- data/app/assets/stylesheets/decidim/conference-diploma.css.scss +61 -0
- data/app/assets/stylesheets/decidim/layouts/_home.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_buttons.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_cards.scss +17 -1
- data/app/assets/stylesheets/decidim/modules/_conference-programme.scss +0 -4
- data/app/assets/stylesheets/decidim/modules/_filters.scss +37 -2
- data/app/assets/stylesheets/decidim/modules/_floating-helper.scss +106 -0
- data/app/assets/stylesheets/decidim/modules/_forms.scss +22 -0
- data/app/assets/stylesheets/decidim/modules/_help.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_layout.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/_margins.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/_modules.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_navbar.scss +5 -1
- data/app/assets/stylesheets/decidim/modules/_order-by.scss +11 -1
- data/app/assets/stylesheets/decidim/modules/_process-header.scss +36 -38
- data/app/assets/stylesheets/decidim/modules/_process-nav.scss +61 -10
- data/app/assets/stylesheets/decidim/modules/_process-phase.scss +63 -30
- data/app/assets/stylesheets/decidim/modules/_share.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_typography.scss +17 -0
- data/app/assets/stylesheets/decidim/{modules → vizzs}/_orgchart.scss +2 -10
- data/app/cells/decidim/activities_cell.rb +6 -2
- data/app/cells/decidim/activity/show.erb +22 -19
- data/app/cells/decidim/activity_cell.rb +35 -5
- data/app/cells/decidim/amendable/amend_button_card/show.erb +9 -0
- data/app/cells/decidim/amendable/amend_button_card_cell.rb +43 -0
- data/app/cells/decidim/amendable/amenders_list/show.erb +18 -0
- data/app/cells/decidim/amendable/amenders_list_cell.rb +7 -0
- data/app/cells/decidim/amendable/announcement_cell.rb +58 -0
- data/app/cells/decidim/amendable/emendation_actions/show.erb +13 -0
- data/app/cells/decidim/amendable/emendation_actions_cell.rb +52 -0
- data/app/cells/decidim/amendable/promote_button_card/show.erb +9 -0
- data/app/cells/decidim/amendable/promote_button_card_cell.rb +47 -0
- data/app/cells/decidim/author/profile_inline.erb +23 -4
- data/app/cells/decidim/author/profile_minicard.erb +25 -0
- data/app/cells/decidim/author/show.erb +0 -1
- data/app/cells/decidim/author_cell.rb +6 -0
- data/app/cells/decidim/card_cell.rb +2 -4
- data/app/cells/decidim/card_m/top.erb +1 -1
- data/app/cells/decidim/card_m_cell.rb +3 -0
- data/app/cells/decidim/content_blocks/last_activity_cell.rb +1 -1
- data/app/cells/decidim/follow_button/show.erb +0 -1
- data/app/cells/decidim/follow_button_cell.rb +10 -0
- data/app/cells/decidim/following/show.erb +1 -1
- data/app/cells/decidim/following_cell.rb +1 -1
- data/app/cells/decidim/notifications/show.erb +1 -0
- data/app/cells/decidim/pad_iframe/show.erb +14 -0
- data/app/cells/decidim/pad_iframe_cell.rb +57 -0
- data/app/cells/decidim/profile/user_tabs.erb +8 -6
- data/app/cells/decidim/profile_cell.rb +1 -1
- data/app/cells/decidim/profile_sidebar/show.erb +58 -42
- data/app/cells/decidim/profile_sidebar_cell.rb +6 -0
- data/app/cells/decidim/search_results/show.erb +8 -0
- data/app/cells/decidim/search_results_cell.rb +38 -0
- data/app/cells/decidim/search_results_section/show.erb +24 -0
- data/app/cells/decidim/search_results_section_cell.rb +35 -0
- data/app/cells/decidim/user_activity/show.erb +15 -0
- data/app/cells/decidim/user_activity_cell.rb +17 -0
- data/app/cells/decidim/user_profile/header.erb +1 -16
- data/app/cells/decidim/user_profile/user_data.erb +16 -0
- data/app/cells/decidim/user_profile_cell.rb +4 -0
- data/app/cells/decidim/user_timeline/show.erb +15 -0
- data/app/cells/decidim/user_timeline_cell.rb +17 -0
- data/app/commands/decidim/accept_user_group_join_request.rb +1 -1
- data/app/commands/decidim/amendable/accept.rb +84 -0
- data/app/commands/decidim/amendable/create.rb +103 -0
- data/app/commands/decidim/amendable/promote.rb +79 -0
- data/app/commands/decidim/amendable/reject.rb +60 -0
- data/app/commands/decidim/amendable/withdraw.rb +46 -0
- data/app/commands/decidim/create_omniauth_registration.rb +17 -1
- data/app/commands/decidim/create_registration.rb +2 -0
- data/app/commands/decidim/demote_membership.rb +1 -1
- data/app/commands/decidim/invite_user.rb +1 -1
- data/app/commands/decidim/invite_user_to_group.rb +1 -1
- data/app/commands/decidim/join_user_group.rb +1 -7
- data/app/commands/decidim/messaging/reply_to_conversation.rb +1 -1
- data/app/commands/decidim/promote_membership.rb +1 -1
- data/app/commands/decidim/reject_user_group_join_request.rb +1 -1
- data/app/commands/decidim/remove_user_from_group.rb +1 -1
- data/app/commands/decidim/search.rb +65 -16
- data/app/commands/decidim/update_account.rb +1 -1
- data/app/commands/decidim/update_notifications_settings.rb +2 -1
- data/app/commands/decidim/update_user_interests.rb +35 -0
- data/app/controllers/concerns/decidim/amendments_controller.rb +104 -0
- data/app/controllers/concerns/decidim/participatory_space_context.rb +28 -6
- data/app/controllers/concerns/decidim/user_groups.rb +23 -0
- data/app/controllers/concerns/decidim/user_profile.rb +2 -4
- data/app/controllers/decidim/components/base_controller.rb +1 -0
- data/app/controllers/decidim/devise/confirmations_controller.rb +9 -0
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +2 -1
- data/app/controllers/decidim/devise/passwords_controller.rb +6 -0
- data/app/controllers/decidim/devise/registrations_controller.rb +5 -0
- data/app/controllers/decidim/devise/sessions_controller.rb +12 -0
- data/app/controllers/decidim/group_admins_controller.rb +3 -0
- data/app/controllers/decidim/group_email_confirmations_controller.rb +32 -0
- data/app/controllers/decidim/group_invites_controller.rb +3 -0
- data/app/controllers/decidim/group_members_controller.rb +3 -0
- data/app/controllers/decidim/groups_controller.rb +3 -0
- data/app/controllers/decidim/homepage_controller.rb +10 -0
- data/app/controllers/decidim/last_activities_controller.rb +1 -1
- data/app/controllers/decidim/messaging/conversations_controller.rb +11 -2
- data/app/controllers/decidim/open_data_controller.rb +31 -0
- data/app/controllers/decidim/own_user_groups_controller.rb +3 -1
- data/app/controllers/decidim/pages_controller.rb +7 -15
- data/app/controllers/decidim/profiles_controller.rb +13 -2
- data/app/controllers/decidim/searches_controller.rb +11 -2
- data/app/controllers/decidim/user_activities_controller.rb +28 -0
- data/app/controllers/decidim/user_group_join_requests_controller.rb +3 -0
- data/app/controllers/decidim/user_interests_controller.rb +32 -0
- data/app/controllers/decidim/user_timeline_controller.rb +40 -0
- data/app/events/decidim/amendable/amendment_accepted_event.rb +23 -0
- data/app/events/decidim/amendable/amendment_base_event.rb +39 -0
- data/app/events/decidim/amendable/amendment_created_event.rb +23 -0
- data/app/events/decidim/amendable/amendment_rejected_event.rb +23 -0
- data/app/events/decidim/amendable/emendation_promoted_event.rb +23 -0
- data/app/events/decidim/welcome_notification_event.rb +58 -0
- data/app/forms/decidim/amendable/create_form.rb +54 -0
- data/app/forms/decidim/amendable/form.rb +22 -0
- data/app/forms/decidim/amendable/promote_form.rb +26 -0
- data/app/forms/decidim/amendable/reject_form.rb +14 -0
- data/app/forms/decidim/amendable/review_form.rb +35 -0
- data/app/forms/decidim/notifications_settings_form.rb +19 -6
- data/app/forms/decidim/omniauth_registration_form.rb +2 -1
- data/app/forms/decidim/user_group_form.rb +1 -2
- data/app/forms/decidim/user_interest_scope_form.rb +25 -0
- data/app/forms/decidim/user_interests_form.rb +22 -0
- data/app/helpers/decidim/amendments_helper.rb +130 -0
- data/app/helpers/decidim/application_helper.rb +19 -2
- data/app/helpers/decidim/card_helper.rb +0 -2
- data/app/helpers/decidim/cells_paginate_helper.rb +4 -0
- data/app/helpers/decidim/contextual_help_helper.rb +10 -0
- data/app/helpers/decidim/cta_button_helper.rb +3 -1
- data/app/helpers/decidim/decidim_form_helper.rb +1 -1
- data/app/helpers/decidim/layout_helper.rb +13 -0
- data/app/helpers/decidim/multi_translation_helper.rb +0 -0
- data/app/helpers/decidim/omniauth_helper.rb +9 -1
- data/app/helpers/decidim/pad_helper.rb +16 -0
- data/app/helpers/decidim/participatory_space_helpers.rb +15 -0
- data/app/helpers/decidim/searches_helper.rb +50 -6
- data/app/helpers/decidim/translations_helper.rb +3 -2
- data/app/jobs/decidim/email_notification_generator_job.rb +4 -2
- data/app/jobs/decidim/metric_job.rb +1 -1
- data/app/jobs/decidim/notification_generator_for_recipient_job.rb +2 -2
- data/app/jobs/decidim/notification_generator_job.rb +4 -2
- data/app/jobs/decidim/open_data_job.rb +16 -0
- data/app/mailers/decidim/messaging/conversation_mailer.rb +5 -2
- data/app/mailers/decidim/newsletter_mailer.rb +6 -2
- data/app/mailers/decidim/notification_mailer.rb +2 -2
- data/app/models/decidim/action_log.rb +7 -0
- data/app/models/decidim/amendment.rb +17 -0
- data/app/models/decidim/component.rb +8 -0
- data/app/models/decidim/contextual_help_section.rb +41 -0
- data/app/models/decidim/follow.rb +30 -0
- data/app/models/decidim/notification.rb +11 -1
- data/app/models/decidim/organization.rb +41 -0
- data/app/models/decidim/searchable_resource.rb +3 -0
- data/app/models/decidim/static_page.rb +11 -0
- data/app/models/decidim/static_page_topic.rb +12 -0
- data/app/models/decidim/user.rb +25 -2
- data/app/models/decidim/user_base_entity.rb +0 -6
- data/app/models/decidim/user_group.rb +29 -3
- data/app/permissions/decidim/permissions.rb +12 -0
- data/app/presenters/decidim/admin_log/organization_presenter.rb +13 -0
- data/app/presenters/decidim/admin_log/user_group_presenter.rb +1 -1
- data/app/presenters/decidim/admin_log/user_presenter.rb +1 -1
- data/app/presenters/decidim/hashtag_presenter.rb +7 -2
- data/app/presenters/decidim/metric_charts_presenter.rb +54 -21
- data/app/presenters/decidim/user_presenter.rb +4 -8
- data/app/queries/decidim/messaging/user_conversations.rb +1 -1
- data/app/queries/decidim/metric_manage.rb +16 -2
- data/app/queries/decidim/metric_measure.rb +35 -0
- data/app/queries/decidim/metrics/followers_metric_manage.rb +64 -0
- data/app/queries/decidim/metrics/participants_metric_manage.rb +72 -0
- data/app/queries/decidim/metrics/users_metric_manage.rb +1 -1
- data/app/queries/decidim/public_components.rb +32 -0
- data/app/resolvers/decidim/core/metric_resolver.rb +43 -11
- data/app/services/decidim/action_logger.rb +10 -0
- data/app/services/decidim/activity_search.rb +88 -13
- data/app/services/decidim/email_notification_generator.rb +23 -8
- data/app/services/decidim/events_manager.rb +9 -3
- data/app/services/decidim/home_activity_search.rb +80 -0
- data/app/services/decidim/log/diff_changeset_calculator.rb +3 -1
- data/app/services/decidim/notification_generator.rb +19 -7
- data/app/services/decidim/notification_generator_for_recipient.rb +6 -9
- data/app/services/decidim/open_data_exporter.rb +55 -0
- data/app/uploaders/decidim/open_data_uploader.rb +17 -0
- data/app/views/decidim/amendments/_form.html.erb +30 -0
- data/app/views/decidim/amendments/_review_form.html.erb +19 -0
- data/app/views/decidim/amendments/new.html.erb +29 -0
- data/app/views/decidim/amendments/review.html.erb +33 -0
- data/app/views/decidim/devise/registrations/new.html.erb +2 -2
- data/app/views/decidim/devise/sessions/new.html.erb +42 -29
- data/app/views/decidim/devise/shared/_links.html.erb +3 -3
- data/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +7 -5
- data/app/views/decidim/follows/update_button.js.erb +1 -1
- data/app/views/decidim/group_members/index.html.erb +1 -1
- data/app/views/decidim/groups/_form.html.erb +9 -8
- data/app/views/decidim/groups/new.html.erb +3 -0
- data/app/views/decidim/{pages/home.html.erb → homepage/show.html.erb} +0 -0
- data/app/views/decidim/messaging/conversation_mailer/new_conversation.html.erb +6 -0
- data/app/views/decidim/messaging/conversation_mailer/new_message.html.erb +6 -0
- data/app/views/decidim/messaging/conversations/_message.html.erb +14 -0
- data/app/views/decidim/messaging/conversations/_reply.html.erb +11 -0
- data/app/views/decidim/messaging/conversations/_show.html.erb +21 -0
- data/app/views/decidim/messaging/conversations/_start.html.erb +12 -0
- data/app/views/decidim/messaging/conversations/create.js.erb +1 -1
- data/app/views/decidim/messaging/conversations/index.html.erb +51 -1
- data/app/views/decidim/messaging/conversations/new.html.erb +5 -1
- data/app/views/decidim/messaging/conversations/show.html.erb +9 -1
- data/app/views/decidim/messaging/conversations/update.js.erb +1 -1
- data/app/views/decidim/notification_mailer/event_received.html.erb +13 -3
- data/app/views/decidim/notifications/index.html.erb +5 -1
- data/app/views/decidim/notifications_settings/show.html.erb +19 -0
- data/app/views/decidim/pages/_standalone.html.erb +21 -0
- data/app/views/decidim/pages/_tabbed.html.erb +45 -0
- data/app/views/decidim/pages/index.html.erb +68 -29
- data/app/views/decidim/pages/show.html.erb +28 -0
- data/app/views/decidim/profiles/show.html.erb +1 -1
- data/app/views/decidim/searches/_count.html.erb +26 -1
- data/app/views/decidim/searches/_filters.html.erb +40 -17
- data/app/views/decidim/searches/index.html.erb +5 -16
- data/app/views/decidim/searches/index.js.erb +5 -3
- data/app/views/decidim/shared/_extended_navigation_bar.html.erb +50 -0
- data/app/views/decidim/shared/_floating_help.html.erb +30 -0
- data/app/views/decidim/shared/_follow_button.html.erb +1 -1
- data/app/views/decidim/shared/_login_modal.html.erb +35 -22
- data/app/views/decidim/shared/_results_per_page.html.erb +1 -1
- data/app/views/decidim/shared/_share_modal.html.erb +1 -1
- data/app/views/decidim/user_activities/index.html.erb +5 -0
- data/app/views/decidim/user_interests/_areas.html.erb +14 -0
- data/app/views/decidim/user_interests/_scopes.html.erb +15 -0
- data/app/views/decidim/user_interests/show.html.erb +12 -0
- data/app/views/decidim/user_timeline/index.html.erb +4 -0
- data/app/views/layouts/decidim/_user_menu.html.erb +1 -1
- data/app/views/layouts/decidim/_wrapper.html.erb +12 -5
- data/config/locales/ca.yml +199 -13
- data/config/locales/de.yml +200 -13
- data/config/locales/en.yml +200 -13
- data/config/locales/es-PY.yml +200 -13
- data/config/locales/es.yml +200 -13
- data/config/locales/eu.yml +200 -13
- data/config/locales/fi-pl.yml +200 -13
- data/config/locales/fi.yml +200 -13
- data/config/locales/fr.yml +200 -13
- data/config/locales/gl.yml +200 -13
- data/config/locales/hu.yml +200 -13
- data/config/locales/id-ID.yml +198 -13
- data/config/locales/it.yml +200 -13
- data/config/locales/nl.yml +200 -13
- data/config/locales/pl.yml +204 -13
- data/config/locales/pt-BR.yml +200 -13
- data/config/locales/pt.yml +200 -13
- data/config/locales/ru.yml +2 -16
- data/config/locales/sv.yml +200 -13
- data/config/locales/tr-TR.yml +200 -13
- data/config/locales/uk.yml +2 -16
- data/config/routes.rb +27 -1
- data/db/migrate/20171212103803_create_unique_nicknames.rb +1 -1
- data/db/migrate/20180221101934_fix_nickname_index.rb +1 -1
- data/db/migrate/20180706104107_add_nickname_to_managed_users.rb +1 -1
- data/db/migrate/20180720114847_create_decidim_amendments.rb +21 -0
- data/db/migrate/20181001124950_move_users_groups_to_users_table.rb +1 -1
- data/db/migrate/20181022090732_add_columns_to_pages.rb +20 -0
- data/db/migrate/20181023104416_add_static_page_topics.rb +15 -0
- data/db/migrate/20181025082245_add_timestamps_to_components.rb +12 -0
- data/db/migrate/20181029121244_add_welcome_notification.rb +13 -0
- data/db/migrate/20181108131058_add_users_registration_mode_to_organizations.rb +7 -0
- data/db/migrate/20181113101935_create_decidim_contextual_help_sections.rb +11 -0
- data/db/migrate/20181115102958_add_following_and_followers_counters_to_users.rb +26 -0
- data/db/migrate/20181119140636_add_columns_to_static_page_topic.rb +10 -0
- data/db/migrate/20181126145142_add_id_documents_fields_to_org.rb +13 -0
- data/db/migrate/20181204110723_remove_following_users_count_from_users.rb +17 -0
- data/db/migrate/20181211080834_add_scope_to_action_logs.rb +7 -0
- data/db/migrate/20181211090933_add_area_to_action_logs.rb +7 -0
- data/db/migrate/20181214101250_add_notification_types_to_users.rb +12 -0
- data/db/migrate/20181218171503_add_user_groups_switch_to_organizations.rb +8 -0
- data/db/seeds.rb +6 -1
- data/lib/decidim/amendable.rb +86 -0
- data/lib/decidim/api/component_interface.rb +4 -0
- data/lib/decidim/api/participatory_space_interface.rb +7 -0
- data/lib/decidim/api/scopable_interface.rb +1 -1
- data/lib/decidim/coauthorable.rb +16 -7
- data/lib/decidim/component_manifest.rb +3 -2
- data/lib/decidim/components/export_manifest.rb +13 -2
- data/lib/decidim/content_parsers/hashtag_parser.rb +48 -15
- data/lib/decidim/content_parsers/user_parser.rb +26 -10
- data/lib/decidim/content_renderers/hashtag_renderer.rb +46 -23
- data/lib/decidim/core.rb +40 -2
- data/lib/decidim/core/engine.rb +46 -12
- data/lib/decidim/core/test.rb +11 -0
- data/lib/decidim/core/test/factories.rb +44 -15
- data/lib/decidim/core/test/shared_examples/amendable/accept_amendment_examples.rb +57 -0
- data/lib/decidim/core/test/shared_examples/amendable/amendment_accepted_event_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb +48 -0
- data/lib/decidim/core/test/shared_examples/amendable/amendment_form_examples.rb +45 -0
- data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/amendable/amendment_rejected_event_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/amendable/create_amendment_examples.rb +78 -0
- data/lib/decidim/core/test/shared_examples/amendable/promote_amendment_examples.rb +43 -0
- data/lib/decidim/core/test/shared_examples/amendable/reject_amendment_examples.rb +41 -0
- data/lib/decidim/core/test/shared_examples/amendable/withdraw_amendment_examples.rb +29 -0
- data/lib/decidim/core/test/shared_examples/has_contextual_help.rb +30 -0
- data/lib/decidim/core/test/shared_examples/resourceable.rb +17 -0
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/simple_event.rb +24 -2
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/events/base_event.rb +17 -12
- data/lib/decidim/events/simple_event.rb +21 -2
- data/lib/decidim/form_builder.rb +8 -0
- data/lib/decidim/gamification/badge_scorer.rb +3 -3
- data/lib/decidim/has_component.rb +1 -1
- data/lib/decidim/hashtag.rb +0 -2
- data/lib/decidim/hashtaggable.rb +2 -2
- data/lib/decidim/metric_manifest.rb +17 -2
- data/lib/decidim/metric_operation.rb +59 -0
- data/lib/decidim/metric_operation_manifest.rb +20 -0
- data/lib/decidim/metric_registry.rb +57 -19
- data/lib/decidim/paddable.rb +82 -0
- data/lib/decidim/participable.rb +24 -0
- data/lib/decidim/participatory_space_resourceable.rb +12 -0
- data/lib/decidim/query_extensions.rb +8 -1
- data/lib/decidim/resource_manifest.rb +5 -1
- data/lib/decidim/resourceable.rb +12 -0
- data/lib/decidim/searchable.rb +13 -4
- data/lib/decidim/settings_manifest.rb +2 -1
- data/lib/tasks/decidim_data_portability_tasks.rake +86 -0
- data/lib/tasks/decidim_open_data_tasks.rake +12 -0
- data/lib/tasks/decidim_tasks.rake +1 -83
- data/vendor/assets/javascripts/tribute.js +307 -145
- metadata +156 -22
- data/app/cells/decidim/conversation/show.erb +0 -18
- data/app/cells/decidim/conversation_cell.rb +0 -23
- data/app/cells/decidim/conversation_header/show.erb +0 -17
- data/app/cells/decidim/conversation_header_cell.rb +0 -16
- data/app/cells/decidim/conversations/show.erb +0 -45
- data/app/cells/decidim/conversations_cell.rb +0 -24
- data/app/cells/decidim/message/show.erb +0 -15
- data/app/cells/decidim/message_cell.rb +0 -23
- data/app/cells/decidim/new_conversation/show.erb +0 -19
- data/app/cells/decidim/new_conversation_cell.rb +0 -19
- data/app/views/decidim/pages/decidim_page.html.erb +0 -31
- data/app/views/decidim/searches/_results.html.erb +0 -5
- data/app/views/decidim/shared/_author_reference.html.erb +0 -1
data/config/locales/uk.yml
CHANGED
@@ -374,7 +374,6 @@ uk:
|
|
374
374
|
expired_session: Скінчився поточний сеанс виступу в ролі учасника.
|
375
375
|
menu:
|
376
376
|
home: Головна
|
377
|
-
more_information: Додаткові відомості
|
378
377
|
messaging:
|
379
378
|
conversation_mailer:
|
380
379
|
new_conversation:
|
@@ -391,13 +390,9 @@ uk:
|
|
391
390
|
create:
|
392
391
|
error: Бесіда не розпочата. Спробуйте ще раз пізніше
|
393
392
|
index:
|
394
|
-
from: Від
|
395
|
-
last_message_html: Останнє повідомлення <strong>%{time} тому</strong>
|
396
393
|
no_conversations: У вас ще немає бесід
|
397
|
-
|
398
|
-
|
399
|
-
reply: Відповісти
|
400
|
-
send: Надіслати
|
394
|
+
reply:
|
395
|
+
title: Відповісти
|
401
396
|
start:
|
402
397
|
send: Надіслати
|
403
398
|
title: Почати бесіду
|
@@ -482,8 +477,6 @@ uk:
|
|
482
477
|
votes_count: Голосів
|
483
478
|
sub_hero:
|
484
479
|
register: Зареєструватися
|
485
|
-
index:
|
486
|
-
title: Додаткові відомості
|
487
480
|
terms_and_conditions:
|
488
481
|
accept:
|
489
482
|
error: Під час прийняття умов участі виникла помилка.
|
@@ -510,10 +503,8 @@ uk:
|
|
510
503
|
profiles:
|
511
504
|
default_officialization_text_for_users: Особу цього учасника прилюдно підтверджено, його ім'я чи роль перевірено на відповідність його справжньому імені та ролі
|
512
505
|
show:
|
513
|
-
conversations: Бесіди
|
514
506
|
followers: Ті, хто стежить
|
515
507
|
following: 'Стежить за:'
|
516
|
-
notifications: Сповіщення
|
517
508
|
user:
|
518
509
|
edit_profile: Редагувати профіль
|
519
510
|
reported_mailer:
|
@@ -540,14 +531,9 @@ uk:
|
|
540
531
|
prompt: Оберіть обсяг
|
541
532
|
scopes: Обсяги
|
542
533
|
search:
|
543
|
-
filter:
|
544
|
-
all: Усі
|
545
|
-
component: Складові
|
546
534
|
results_found_for_term: '%{count} Висліди пошуку: "%{term}"'
|
547
535
|
term_input_placeholder: Шукати
|
548
536
|
searches:
|
549
|
-
filters:
|
550
|
-
search: Шукати
|
551
537
|
filters_small_view:
|
552
538
|
close_modal: Закрити віконце
|
553
539
|
filter: Відібрати
|
data/config/routes.rb
CHANGED
@@ -16,6 +16,14 @@ Decidim::Core::Engine.routes.draw do
|
|
16
16
|
omniauth_callbacks: "decidim/devise/omniauth_registrations"
|
17
17
|
}
|
18
18
|
|
19
|
+
devise_for :user_groups,
|
20
|
+
class_name: "Decidim::UserGroup",
|
21
|
+
module: :devise,
|
22
|
+
router_name: :decidim,
|
23
|
+
controllers: {
|
24
|
+
confirmations: "decidim/devise/confirmations"
|
25
|
+
}
|
26
|
+
|
19
27
|
devise_scope :user do
|
20
28
|
post "omniauth_registrations" => "devise/omniauth_registrations#create"
|
21
29
|
end
|
@@ -56,6 +64,8 @@ Decidim::Core::Engine.routes.draw do
|
|
56
64
|
end
|
57
65
|
end
|
58
66
|
|
67
|
+
resource :user_interests, only: [:show, :update]
|
68
|
+
|
59
69
|
get "/authorization_modals/:authorization_action/f/:component_id(/:resource_name/:resource_id)", to: "authorization_modals#show", as: :authorization_modal
|
60
70
|
|
61
71
|
resources :groups, except: [:destroy, :index, :show] do
|
@@ -71,6 +81,7 @@ Decidim::Core::Engine.routes.draw do
|
|
71
81
|
post :demote
|
72
82
|
end
|
73
83
|
end
|
84
|
+
resource :email_confirmation, only: [:create], controller: "group_email_confirmations"
|
74
85
|
|
75
86
|
member do
|
76
87
|
delete :leave
|
@@ -85,6 +96,8 @@ Decidim::Core::Engine.routes.draw do
|
|
85
96
|
get "badges", to: "profiles#badges", as: "profile_badges"
|
86
97
|
get "groups", to: "profiles#groups", as: "profile_groups"
|
87
98
|
get "members", to: "profiles#members", as: "profile_members"
|
99
|
+
get "activity", to: "user_activities#index", as: "profile_activity"
|
100
|
+
get "timeline", to: "user_timeline#index", as: "profile_timeline"
|
88
101
|
end
|
89
102
|
|
90
103
|
resources :pages, only: [:index, :show], format: false
|
@@ -102,8 +115,21 @@ Decidim::Core::Engine.routes.draw do
|
|
102
115
|
match "/404", to: "errors#not_found", via: :all
|
103
116
|
match "/500", to: "errors#internal_server_error", via: :all
|
104
117
|
|
118
|
+
get "/open-data/download", to: "open_data#download", as: :open_data_download
|
119
|
+
|
105
120
|
resource :follow, only: [:create, :destroy]
|
106
121
|
resource :report, only: [:create]
|
122
|
+
resources :amends, only: [:new, :reject, :accept], controller: :amendments do
|
123
|
+
collection do
|
124
|
+
post :create
|
125
|
+
end
|
126
|
+
member do
|
127
|
+
patch :reject
|
128
|
+
post :promote
|
129
|
+
get :review
|
130
|
+
patch :accept
|
131
|
+
end
|
132
|
+
end
|
107
133
|
|
108
134
|
namespace :gamification do
|
109
135
|
resources :badges, only: [:index]
|
@@ -123,5 +149,5 @@ Decidim::Core::Engine.routes.draw do
|
|
123
149
|
get "/me" => "doorkeeper/credentials#me"
|
124
150
|
end
|
125
151
|
|
126
|
-
root to: "
|
152
|
+
root to: "homepage#show"
|
127
153
|
end
|
@@ -11,7 +11,7 @@ class CreateUniqueNicknames < ActiveRecord::Migration[5.1]
|
|
11
11
|
add_column :decidim_users, :nickname, :string, limit: 20
|
12
12
|
|
13
13
|
User.where.not(name: nil).find_each do |user|
|
14
|
-
user.update!(nickname:
|
14
|
+
user.update!(nickname: UserBaseEntity.nicknamize(user.name, decidim_organization_id: user.decidim_organization_id))
|
15
15
|
end
|
16
16
|
|
17
17
|
add_index :decidim_users,
|
@@ -11,7 +11,7 @@ class FixNicknameIndex < ActiveRecord::Migration[5.1]
|
|
11
11
|
User.where(nickname: nil)
|
12
12
|
.where(deleted_at: nil)
|
13
13
|
.where(managed: false)
|
14
|
-
.find_each { |u| u.update(nickname:
|
14
|
+
.find_each { |u| u.update(nickname: UserBaseEntity.nicknamize(u.name, decidim_organization_id: u.decidim_organization_id)) }
|
15
15
|
|
16
16
|
# rubocop:disable Rails/SkipsModelValidations
|
17
17
|
User.where(nickname: nil).update_all("nickname = ''")
|
@@ -7,7 +7,7 @@ class AddNicknameToManagedUsers < ActiveRecord::Migration[5.2]
|
|
7
7
|
|
8
8
|
def up
|
9
9
|
User.where(managed: true, nickname: nil).includes(:organization).find_each do |user|
|
10
|
-
user.nickname =
|
10
|
+
user.nickname = UserBaseEntity.nicknamize(user.name, organization: user.organization)
|
11
11
|
user.save
|
12
12
|
end
|
13
13
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateDecidimAmendments < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
create_table :decidim_amendments do |t|
|
6
|
+
t.references :decidim_user, null: false
|
7
|
+
t.references :decidim_amendable, polymorphic: true, index: false
|
8
|
+
t.references :decidim_emendation, polymorphic: true, index: false
|
9
|
+
t.string :state, index: true
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :decidim_amendments,
|
14
|
+
[:decidim_user_id, :decidim_amendable_id, :decidim_amendable_type],
|
15
|
+
name: "index_on_amender_and_amendable"
|
16
|
+
|
17
|
+
add_index :decidim_amendments,
|
18
|
+
[:decidim_amendable_id, :decidim_amendable_type],
|
19
|
+
name: "index_on_amendable"
|
20
|
+
end
|
21
|
+
end
|
@@ -64,7 +64,7 @@ class MoveUsersGroupsToUsersTable < ActiveRecord::Migration[5.2]
|
|
64
64
|
verified_at: old_user_group.verified_at
|
65
65
|
}
|
66
66
|
new_attributes = clean_attributes.merge(
|
67
|
-
nickname:
|
67
|
+
nickname: UserBaseEntity.nicknamize(clean_attributes["name"]),
|
68
68
|
extended_data: extended_data
|
69
69
|
)
|
70
70
|
new_user_group = NewUserGroup.create!(new_attributes)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddColumnsToPages < ActiveRecord::Migration[5.2]
|
4
|
+
class StaticPage < ApplicationRecord
|
5
|
+
self.table_name = :decidim_static_pages
|
6
|
+
end
|
7
|
+
|
8
|
+
# rubocop:disable Rails/SkipsModelValidations
|
9
|
+
def change
|
10
|
+
change_table :decidim_static_pages do |t|
|
11
|
+
t.column :weight, :integer, default: nil, null: true
|
12
|
+
t.column :show_in_footer, :boolean, default: false, null: false
|
13
|
+
end
|
14
|
+
|
15
|
+
Decidim::StaticPage.where(
|
16
|
+
slug: ["faq", "terms-and-conditions", "accessibility"]
|
17
|
+
).update_all(show_in_footer: true)
|
18
|
+
# rubocop:enable Rails/SkipsModelValidations
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddStaticPageTopics < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
create_table :decidim_static_page_topics do |t|
|
6
|
+
t.column :title, :jsonb, null: false
|
7
|
+
t.column :description, :jsonb, null: false
|
8
|
+
t.references :organization, null: false
|
9
|
+
end
|
10
|
+
|
11
|
+
change_table :decidim_static_pages do |t|
|
12
|
+
t.references :topic
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddTimestampsToComponents < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
add_timestamps :decidim_components, null: true
|
6
|
+
# rubocop:disable Rails/SkipsModelValidations
|
7
|
+
Decidim::Component.update_all(created_at: Time.current, updated_at: Time.current)
|
8
|
+
# rubocop:enable Rails/SkipsModelValidations
|
9
|
+
change_column_null :decidim_components, :created_at, false
|
10
|
+
change_column_null :decidim_components, :updated_at, false
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddWelcomeNotification < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
change_table :decidim_organizations do |t|
|
6
|
+
t.boolean :send_welcome_notification, null: false, default: false
|
7
|
+
t.jsonb :welcome_notification_subject, null: true
|
8
|
+
t.jsonb :welcome_notification_body, null: true
|
9
|
+
end
|
10
|
+
|
11
|
+
execute "UPDATE decidim_organizations SET send_welcome_notification = 'true'"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateDecidimContextualHelpSections < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
create_table :decidim_contextual_help_sections do |t|
|
6
|
+
t.string :section_id, null: false
|
7
|
+
t.references :organization, null: false
|
8
|
+
t.jsonb :content, null: false
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddFollowingAndFollowersCountersToUsers < ActiveRecord::Migration[5.2]
|
4
|
+
def up
|
5
|
+
add_column :decidim_users, :following_count, :integer, null: false, default: 0
|
6
|
+
add_column :decidim_users, :following_users_count, :integer, null: false, default: 0
|
7
|
+
add_column :decidim_users, :followers_count, :integer, null: false, default: 0
|
8
|
+
|
9
|
+
Decidim::UserBaseEntity.find_each do |entity|
|
10
|
+
follower_count = Decidim::Follow.where(followable: entity).count
|
11
|
+
following_count = Decidim::Follow.where(decidim_user_id: entity.id).count
|
12
|
+
following_users_count = Decidim::Follow.where(decidim_user_id: entity.id, decidim_followable_type: ["Decidim::UserBaseEntity", "Decidim::User", "Decidim::UserGroup"]).count
|
13
|
+
|
14
|
+
entity.followers_count = follower_count
|
15
|
+
entity.following_count = following_count
|
16
|
+
entity.following_users_count = following_users_count
|
17
|
+
entity.save
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def down
|
22
|
+
remove_column :decidim_users, :following_count
|
23
|
+
remove_column :decidim_users, :following_users_count
|
24
|
+
remove_column :decidim_users, :followers_count
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddColumnsToStaticPageTopic < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
change_table :decidim_static_page_topics do |t|
|
6
|
+
t.column :weight, :integer, default: nil, null: true
|
7
|
+
t.column :show_in_footer, :boolean, default: false, null: false
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddIdDocumentsFieldsToOrg < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
add_column :decidim_organizations, :id_documents_methods, :string, array: true, default: ["online"]
|
6
|
+
add_column :decidim_organizations, :id_documents_explanation_text, :jsonb, default: {}
|
7
|
+
|
8
|
+
# rubocop:disable Rails/SkipsModelValidations
|
9
|
+
Decidim::Organization.reset_column_information
|
10
|
+
Decidim::Organization.update_all(id_documents_methods: ["online"])
|
11
|
+
# rubocop:enable Rails/SkipsModelValidations
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class RemoveFollowingUsersCountFromUsers < ActiveRecord::Migration[5.2]
|
4
|
+
def up
|
5
|
+
remove_column :decidim_users, :following_users_count
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
add_column :decidim_users, :following_users_count, :integer, null: false, default: 0
|
10
|
+
|
11
|
+
Decidim::UserBaseEntity.find_each do |entity|
|
12
|
+
following_users_count = Decidim::Follow.where(decidim_user_id: entity.id, decidim_followable_type: ["Decidim::UserBaseEntity", "Decidim::User", "Decidim::UserGroup"]).count
|
13
|
+
entity.following_users_count = following_users_count
|
14
|
+
entity.save
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddNotificationTypesToUsers < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
add_column :decidim_users, :notification_types, :string, default: "all"
|
6
|
+
# rubocop:disable Rails/SkipsModelValidations
|
7
|
+
Decidim::UserBaseEntity.update_all(notification_types: "all")
|
8
|
+
# rubocop:enable Rails/SkipsModelValidations
|
9
|
+
|
10
|
+
change_column_null :decidim_users, :notification_types, false
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddUserGroupsSwitchToOrganizations < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
add_column :decidim_organizations, :user_groups_enabled, :boolean, null: false, default: false
|
6
|
+
execute "UPDATE decidim_organizations set user_groups_enabled = true"
|
7
|
+
end
|
8
|
+
end
|
data/db/seeds.rb
CHANGED
@@ -31,8 +31,11 @@ if !Rails.env.production? || ENV["SEED"]
|
|
31
31
|
available_locales: Decidim.available_locales,
|
32
32
|
reference_prefix: Faker::Name.suffix,
|
33
33
|
available_authorizations: Decidim.authorization_workflows.map(&:name),
|
34
|
+
users_registration_mode: :enabled,
|
34
35
|
tos_version: Time.current,
|
35
|
-
badges_enabled: true
|
36
|
+
badges_enabled: true,
|
37
|
+
user_groups_enabled: true,
|
38
|
+
send_welcome_notification: true
|
36
39
|
)
|
37
40
|
|
38
41
|
if organization.top_scopes.none?
|
@@ -140,6 +143,7 @@ if !Rails.env.production? || ENV["SEED"]
|
|
140
143
|
user_group = Decidim::UserGroup.create!(
|
141
144
|
name: Faker::Company.unique.name,
|
142
145
|
nickname: Faker::Twitter.unique.screen_name,
|
146
|
+
email: Faker::Internet.email,
|
143
147
|
extended_data: {
|
144
148
|
document_number: Faker::Number.number(10),
|
145
149
|
phone: Faker::PhoneNumber.phone_number,
|
@@ -147,6 +151,7 @@ if !Rails.env.production? || ENV["SEED"]
|
|
147
151
|
},
|
148
152
|
decidim_organization_id: user.organization.id
|
149
153
|
)
|
154
|
+
user_group.confirm
|
150
155
|
|
151
156
|
Decidim::UserGroupMembership.create!(
|
152
157
|
user: user,
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
# This concern contains the logic related to amendable resources.
|
5
|
+
module Amendable
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
has_many :amendments, as: :amendable, foreign_key: "decidim_amendable_id", foreign_type: "decidim_amendable_type", class_name: "Decidim::Amendment"
|
10
|
+
|
11
|
+
# resource.emendations : resources that have amend the resource
|
12
|
+
has_many :emendations, through: :amendments, source: :emendation, source_type: name, inverse_of: :emendations
|
13
|
+
|
14
|
+
# resource.amenders : users that have emendations for the resource
|
15
|
+
has_many :amenders, through: :amendments, source: :amender
|
16
|
+
|
17
|
+
# resource.amended : the original resource that was amended
|
18
|
+
has_one :amended, as: :amendable, foreign_key: "decidim_emendation_id", foreign_type: "decidim_emendation_type", class_name: "Decidim::Amendment"
|
19
|
+
has_one :amendable, through: :amended, source: :amendable, source_type: name
|
20
|
+
end
|
21
|
+
|
22
|
+
class_methods do
|
23
|
+
attr_reader :amendable_options
|
24
|
+
# Public: Configures amendable for this model.
|
25
|
+
#
|
26
|
+
# fields - An `Array` of `symbols` specifying the fields that can be
|
27
|
+
# amended.
|
28
|
+
# ignore - An `Array` of `symbols` specifying the fields to be
|
29
|
+
# ignored from amendable when creating the related emendation,
|
30
|
+
# the :id is allways ignored.
|
31
|
+
# reset - The counters that should be reseted on the creation of the emmendation
|
32
|
+
# form - The form used for the validation and creation of the emmendation
|
33
|
+
#
|
34
|
+
# Returns nothing.
|
35
|
+
def amendable(fields: nil, ignore: [], reset: nil, form: nil)
|
36
|
+
@amendable_options = {}
|
37
|
+
raise "You must provide a set of fields to amend" unless fields
|
38
|
+
raise "You must provide a form class of the amendable" unless form
|
39
|
+
@amendable_options[:fields] = fields
|
40
|
+
@amendable_options[:ignore_fields] = ignore + [:id, :created_at, :updated_at]
|
41
|
+
@amendable_options[:reset] = reset
|
42
|
+
@amendable_options[:form] = form
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def fields
|
47
|
+
self.class.amendable_options[:fields]
|
48
|
+
end
|
49
|
+
|
50
|
+
def ignore_fields
|
51
|
+
self.class.amendable_options[:ignore_fields]
|
52
|
+
end
|
53
|
+
|
54
|
+
def form
|
55
|
+
self.class.amendable_options[:form].constantize
|
56
|
+
end
|
57
|
+
|
58
|
+
def amendment
|
59
|
+
return Decidim::Amendment.find_by(emendation: id) if emendation?
|
60
|
+
Decidim::Amendment.find_by(amendable: id)
|
61
|
+
end
|
62
|
+
|
63
|
+
def emendation?
|
64
|
+
true if amendable.present?
|
65
|
+
end
|
66
|
+
|
67
|
+
def amendable?
|
68
|
+
return false if emendation?
|
69
|
+
component.settings.amendments_enabled
|
70
|
+
end
|
71
|
+
|
72
|
+
def resource_state
|
73
|
+
attributes["state"]
|
74
|
+
end
|
75
|
+
|
76
|
+
def emendation_state
|
77
|
+
return resource_state if resource_state == "withdrawn"
|
78
|
+
amendment.state if emendation?
|
79
|
+
end
|
80
|
+
|
81
|
+
def state
|
82
|
+
return emendation_state if emendation?
|
83
|
+
resource_state
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|