decidim-core 0.14.4 → 0.15.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 +20 -0
- data/app/assets/images/decidim/cc-badge.png +0 -0
- data/app/assets/images/decidim/gamification/badges/continuity.svg +73 -0
- data/app/assets/images/decidim/gamification/badges/followers.svg +115 -0
- data/app/assets/images/decidim/icons.svg +1 -0
- data/app/assets/javascripts/decidim/vizzs/areachart.js.es6 +186 -208
- data/app/assets/javascripts/decidim/vizzs/linechart.js.es6 +263 -0
- data/app/assets/javascripts/decidim/vizzs/metrics.js.es6 +36 -26
- data/app/assets/javascripts/decidim/vizzs/orgchart.js.es6 +3 -2
- data/app/assets/javascripts/decidim/vizzs/rowchart.js.es6 +324 -0
- data/app/assets/stylesheets/decidim/_decidim.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/_cards.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/_conference-diploma.scss +75 -0
- data/app/assets/stylesheets/decidim/modules/_conference-media.scss +44 -0
- data/app/assets/stylesheets/decidim/modules/_conference-programme.scss +5 -1
- data/app/assets/stylesheets/decidim/modules/_conference-registration.scss +34 -0
- data/app/assets/stylesheets/decidim/modules/_list-request.scss +16 -0
- data/app/assets/stylesheets/decidim/modules/_modules.scss +4 -4
- data/app/assets/stylesheets/decidim/modules/_process-phase.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/_reveal.scss +6 -1
- data/app/assets/stylesheets/decidim/utils/_helpers.scss +1 -1
- data/app/assets/stylesheets/decidim/{modules → vizzs}/_areachart.scss +8 -11
- data/app/assets/stylesheets/decidim/{modules → vizzs}/_chart-tooltip.scss +0 -0
- data/app/assets/stylesheets/decidim/vizzs/_linechart.scss +115 -0
- data/app/assets/stylesheets/decidim/vizzs/_rowchart.scss +77 -0
- data/app/cells/decidim/activities/show.erb +3 -0
- data/app/cells/decidim/activities_cell.rb +38 -0
- data/app/cells/decidim/activity/show.erb +21 -0
- data/app/cells/decidim/activity_cell.rb +85 -0
- data/app/cells/decidim/address/details.erb +7 -0
- data/app/cells/decidim/address/show.erb +14 -0
- data/app/cells/decidim/address_cell.rb +19 -0
- data/app/cells/decidim/author/contact.erb +1 -1
- data/app/cells/decidim/author_cell.rb +1 -0
- data/app/cells/decidim/badge/show.erb +2 -2
- data/app/cells/decidim/badge/small.erb +5 -0
- data/app/cells/decidim/badge_cell.rb +36 -14
- data/app/cells/decidim/badges/show.erb +6 -3
- data/app/cells/decidim/badges_cell.rb +4 -4
- data/app/cells/decidim/coauthorships_cell.rb +8 -2
- data/app/cells/decidim/collapsible_authors/show.erb +9 -7
- data/app/cells/decidim/content_blocks/html/show.erb +3 -0
- data/app/cells/decidim/content_blocks/html_cell.rb +11 -0
- data/app/cells/decidim/content_blocks/html_settings_form/show.erb +3 -0
- data/app/cells/decidim/content_blocks/html_settings_form_cell.rb +17 -0
- data/app/cells/decidim/content_blocks/last_activity/show.erb +17 -0
- data/app/cells/decidim/content_blocks/last_activity_cell.rb +60 -0
- data/app/cells/decidim/content_blocks/metrics/show.erb +13 -0
- data/app/cells/decidim/content_blocks/metrics_cell.rb +18 -0
- data/app/cells/decidim/content_blocks/stats/show.erb +2 -1
- data/app/cells/decidim/groups/show.erb +10 -0
- data/app/cells/decidim/groups_cell.rb +19 -0
- data/app/cells/decidim/members/show.erb +9 -0
- data/app/cells/decidim/members_cell.rb +32 -0
- data/app/cells/decidim/profile/show.erb +3 -11
- data/app/cells/decidim/profile/user_group_tabs.erb +5 -0
- data/app/cells/decidim/profile/user_tabs.erb +12 -0
- data/app/cells/decidim/profile_cell.rb +7 -2
- data/app/cells/decidim/profile_sidebar/show.erb +108 -23
- data/app/cells/decidim/profile_sidebar_cell.rb +36 -2
- data/app/cells/decidim/user_group_admin_membership_profile/footer.erb +29 -0
- data/app/cells/decidim/user_group_admin_membership_profile_cell.rb +14 -0
- data/app/cells/decidim/user_group_membership_profile/tags.erb +1 -0
- data/app/cells/decidim/user_group_membership_profile_cell.rb +8 -0
- data/app/cells/decidim/user_group_pending_invitations_list/show.erb +23 -0
- data/app/cells/decidim/user_group_pending_invitations_list_cell.rb +26 -0
- data/app/cells/decidim/user_group_pending_requests_list/show.erb +23 -0
- data/app/cells/decidim/user_group_pending_requests_list_cell.rb +26 -0
- data/app/cells/decidim/user_profile/header.erb +1 -1
- data/app/cells/decidim/user_profile_cell.rb +15 -9
- data/app/commands/decidim/accept_group_invitation.rb +43 -0
- data/app/commands/decidim/accept_user_group_join_request.rb +53 -0
- data/app/commands/decidim/create_follow.rb +6 -0
- data/app/commands/decidim/create_registration.rb +13 -23
- data/app/commands/decidim/create_user_group.rb +57 -0
- data/app/commands/decidim/delete_follow.rb +7 -0
- data/app/commands/decidim/demote_membership.rb +57 -0
- data/app/commands/decidim/destroy_account.rb +6 -0
- data/app/commands/decidim/invite_user.rb +1 -3
- data/app/commands/decidim/invite_user_to_group.rb +62 -0
- data/app/commands/decidim/join_user_group.rb +63 -0
- data/app/commands/decidim/leave_user_group.rb +41 -0
- data/app/commands/decidim/promote_membership.rb +55 -0
- data/app/commands/decidim/reject_group_invitation.rb +42 -0
- data/app/commands/decidim/reject_user_group_join_request.rb +53 -0
- data/app/commands/decidim/remove_user_from_group.rb +53 -0
- data/app/commands/decidim/update_user_group.rb +53 -0
- data/app/controllers/concerns/decidim/locale_switcher.rb +3 -3
- data/app/controllers/concerns/decidim/paginable.rb +1 -0
- data/app/controllers/decidim/application_controller.rb +7 -0
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/sessions_controller.rb +1 -1
- data/app/controllers/decidim/gamification/badges_controller.rb +11 -0
- data/app/controllers/decidim/group_admins_controller.rb +41 -0
- data/app/controllers/decidim/group_invites_controller.rb +74 -0
- data/app/controllers/decidim/group_members_controller.rb +59 -0
- data/app/controllers/decidim/groups_controller.rb +85 -0
- data/app/controllers/decidim/last_activities_controller.rb +46 -0
- data/app/controllers/decidim/pages_controller.rb +9 -1
- data/app/controllers/decidim/profiles_controller.rb +35 -5
- data/app/controllers/decidim/user_group_join_requests_controller.rb +69 -0
- data/app/events/decidim/demoted_membership_event.rb +28 -0
- data/app/events/decidim/invited_to_group_event.rb +33 -0
- data/app/events/decidim/join_request_accepted_event.rb +28 -0
- data/app/events/decidim/join_request_created_event.rb +28 -0
- data/app/events/decidim/join_request_rejected_event.rb +28 -0
- data/app/events/decidim/promoted_to_admin_event.rb +28 -0
- data/app/events/decidim/removed_from_group_event.rb +28 -0
- data/app/forms/decidim/account_form.rb +1 -1
- data/app/forms/decidim/invite_user_to_group_form.rb +29 -0
- data/app/forms/decidim/notifications_settings_form.rb +4 -0
- data/app/forms/decidim/registration_form.rb +0 -27
- data/app/forms/decidim/user_group_form.rb +81 -0
- data/app/helpers/decidim/component_path_helper.rb +10 -0
- data/app/helpers/decidim/filters_helper.rb +3 -2
- data/app/helpers/decidim/icon_helper.rb +3 -1
- data/app/helpers/decidim/map_helper.rb +1 -1
- data/app/jobs/decidim/metric_job.rb +14 -0
- data/app/mailers/decidim/newsletter_mailer.rb +2 -0
- data/app/mailers/decidim/notification_mailer.rb +1 -1
- data/app/models/decidim/action_log.rb +66 -0
- data/app/models/decidim/coauthorship.rb +9 -0
- data/app/models/decidim/component.rb +5 -0
- data/app/models/decidim/continuity_badge_status.rb +9 -0
- data/app/models/decidim/gamification/badge_score.rb +1 -1
- data/app/models/decidim/messaging/message.rb +1 -0
- data/app/models/decidim/metric.rb +13 -0
- data/app/models/decidim/participatory_space_private_user.rb +4 -0
- data/app/models/decidim/user.rb +14 -38
- data/app/models/decidim/user_base_entity.rb +52 -0
- data/app/models/decidim/user_group.rb +48 -9
- data/app/models/decidim/user_group_membership.rb +8 -0
- data/app/permissions/decidim/permissions.rb +21 -0
- data/app/presenters/decidim/admin_log/organization_presenter.rb +0 -2
- data/app/presenters/decidim/admin_log/participatory_space_private_user_presenter.rb +38 -0
- data/app/presenters/decidim/metric_charts_presenter.rb +53 -0
- data/app/presenters/decidim/metric_object_presenter.rb +28 -0
- data/app/presenters/decidim/user_group_presenter.rb +16 -8
- data/app/presenters/decidim/user_presenter.rb +14 -0
- data/app/queries/decidim/metric_manage.rb +59 -0
- data/app/queries/decidim/metrics/users_metric_manage.rb +26 -0
- data/app/queries/decidim/user_groups/accepted_memberships.rb +36 -0
- data/app/queries/decidim/user_groups/accepted_user_groups.rb +38 -0
- data/app/queries/decidim/user_groups/accepted_users.rb +36 -0
- data/app/queries/decidim/user_groups/admin_memberships.rb +37 -0
- data/app/queries/decidim/user_groups/invited_memberships.rb +36 -0
- data/app/queries/decidim/user_groups/manageable_user_groups.rb +39 -0
- data/app/queries/decidim/user_groups/member_memberships.rb +37 -0
- data/app/resolvers/decidim/core/metric_resolver.rb +38 -0
- data/app/services/decidim/action_logger.rb +4 -2
- data/app/services/decidim/activity_search.rb +76 -0
- data/app/services/decidim/continuity_badge_tracker.rb +64 -0
- data/app/services/decidim/resource_search.rb +0 -1
- data/app/types/decidim/core/metric_history_type.rb +17 -0
- data/app/types/decidim/core/metric_type.rb +14 -0
- data/app/types/decidim/core/session_type.rb +1 -1
- data/app/types/decidim/core/user_group_type.rb +2 -2
- data/app/views/decidim/authorization_modals/show.html.erb +40 -27
- data/app/views/decidim/devise/registrations/new.html.erb +0 -19
- data/app/views/decidim/gamification/badges/index.html.erb +42 -0
- data/app/views/decidim/group_admins/index.html.erb +18 -0
- data/app/views/decidim/group_invites/index.html.erb +27 -0
- data/app/views/decidim/group_members/index.html.erb +19 -0
- data/app/views/decidim/groups/_form.html.erb +23 -0
- data/app/views/decidim/groups/edit.html.erb +26 -0
- data/app/views/decidim/groups/new.html.erb +26 -0
- data/app/views/decidim/last_activities/_activities.html.erb +13 -0
- data/app/views/decidim/last_activities/index.html.erb +18 -0
- data/app/views/decidim/last_activities/index.js.erb +6 -0
- data/app/views/decidim/profiles/show.html.erb +1 -1
- data/app/views/layouts/decidim/_user_menu.html.erb +0 -1
- data/app/views/layouts/decidim/_wrapper.html.erb +1 -1
- data/config/initializers/devise.rb +1 -1
- data/config/initializers/foundation_rails_helper.rb +1 -0
- data/config/locales/ca.yml +325 -32
- data/config/locales/de.yml +325 -32
- data/config/locales/en.yml +325 -32
- data/config/locales/es-PY.yml +325 -32
- data/config/locales/es.yml +325 -32
- data/config/locales/eu.yml +325 -32
- data/config/locales/fi.yml +330 -37
- data/config/locales/fr.yml +325 -32
- data/config/locales/gl.yml +325 -32
- data/config/locales/hu.yml +327 -34
- data/config/locales/it.yml +325 -32
- data/config/locales/nl.yml +325 -32
- data/config/locales/pl.yml +329 -32
- data/config/locales/pt-BR.yml +326 -33
- data/config/locales/pt.yml +325 -32
- data/config/locales/ru.yml +4 -33
- data/config/locales/sv.yml +346 -53
- data/config/locales/uk.yml +4 -33
- data/config/routes.rb +27 -1
- data/db/migrate/20170128112958_change_user_groups_verified_to_timestamp.rb +11 -0
- data/db/migrate/20180705134647_create_decidim_metrics.rb +16 -0
- data/db/migrate/20180730071851_add_core_content_blocks.rb +3 -3
- data/db/migrate/20180810092428_move_organization_fields_to_hero_content_block.rb +4 -2
- data/db/migrate/20180918072506_add_visibility_to_action_logs.rb +8 -0
- data/db/migrate/20181001124950_move_users_groups_to_users_table.rb +84 -0
- data/db/migrate/20181008102144_add_badge_switch_to_organizations.rb +8 -0
- data/db/migrate/20181010044613_create_decidim_continuity_badge_statuses.rb +11 -0
- data/db/migrate/20181011080252_add_roles_to_memberships.rb +24 -0
- data/db/migrate/20181016091601_make_authors_polymorphic.rb +31 -0
- data/db/migrate/20181029112820_fix_user_follows.rb +18 -0
- data/db/migrate/20181030090144_destroy_deleted_users_follows.rb +16 -0
- data/db/seeds.rb +18 -4
- data/lib/decidim/attributes.rb +1 -0
- data/lib/decidim/attributes/localized_date.rb +16 -0
- data/lib/decidim/attributes/time_with_zone.rb +3 -1
- data/lib/decidim/authorable.rb +5 -4
- data/lib/decidim/authorization_form_builder.rb +2 -2
- data/lib/decidim/coauthorable.rb +68 -18
- data/lib/decidim/content_block_manifest.rb +7 -0
- data/lib/decidim/content_processor.rb +17 -7
- data/lib/decidim/core.rb +12 -0
- data/lib/decidim/core/engine.rb +54 -6
- data/lib/decidim/core/test/factories.rb +63 -17
- data/lib/decidim/core/test/shared_examples/coauthorable.rb +27 -9
- data/lib/decidim/core/test/shared_examples/coauthorable_interface_examples.rb +2 -2
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/data_portability.rb +3 -1
- data/lib/decidim/data_portability_file_reader.rb +1 -1
- data/lib/decidim/events/author_event.rb +4 -1
- data/lib/decidim/events/coauthor_event.rb +4 -1
- data/lib/decidim/faker/localized.rb +5 -4
- data/lib/decidim/form_builder.rb +18 -17
- data/lib/decidim/gamification.rb +8 -2
- data/lib/decidim/gamification/badge.rb +34 -0
- data/lib/decidim/gamification/badge_scorer.rb +29 -14
- data/lib/decidim/gamification/badge_status.rb +2 -0
- data/lib/decidim/hashtaggable.rb +1 -1
- data/lib/decidim/manifest_registry.rb +5 -3
- data/lib/decidim/metric_manifest.rb +20 -0
- data/lib/decidim/metric_registry.rb +71 -0
- data/lib/decidim/participable.rb +1 -1
- data/lib/decidim/participatory_space_resourceable.rb +0 -1
- data/lib/decidim/query_extensions.rb +19 -0
- data/lib/decidim/resourceable.rb +1 -0
- data/lib/decidim/searchable.rb +2 -1
- data/lib/tasks/decidim_metrics_tasks.rake +41 -0
- data/lib/tasks/decidim_tasks.rake +1 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ca.js +1 -2
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.es.js +1 -2
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.fr.js +1 -2
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.gl.js +1 -2
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.pt.js +1 -2
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ru.js +1 -2
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.uk.js +1 -2
- data/vendor/assets/javascripts/form_datepicker.js.es6 +1 -11
- metadata +144 -23
- data/app/cells/decidim/invitations_toggle/content.erb +0 -1
- data/app/cells/decidim/invitations_toggle/label.erb +0 -1
- data/app/cells/decidim/invitations_toggle_cell.rb +0 -27
- data/app/cells/decidim/toggle/show.erb +0 -8
- data/app/cells/decidim/toggle_cell.rb +0 -42
- data/app/commands/decidim/invite_friends.rb +0 -48
- data/app/controllers/decidim/invitations_controller.rb +0 -32
- data/app/forms/decidim/invitations_form.rb +0 -37
- data/app/views/decidim/invitations/index.html.erb +0 -48
- data/app/views/devise/mailer/invite_friend.html.erb +0 -27
- data/app/views/devise/mailer/invite_friend.text.erb +0 -19
- data/lib/decidim/rectify_ext.rb +0 -32
data/config/locales/uk.yml
CHANGED
@@ -14,9 +14,6 @@ uk:
|
|
14
14
|
password_confirmation: Підтвердьте свій пароль
|
15
15
|
personal_url: Особиста веб-адреса
|
16
16
|
remove_avatar: Видалити аватар
|
17
|
-
user_group_document_number: Номер документа організації
|
18
|
-
user_group_name: Назва організації
|
19
|
-
user_group_phone: Телефон організації
|
20
17
|
models:
|
21
18
|
decidim/attachment_created_event: Вкладений файл
|
22
19
|
decidim/component_published_event: Діюча складова
|
@@ -30,9 +27,6 @@ uk:
|
|
30
27
|
password: Пароль
|
31
28
|
password_confirmation: Підтвердження паролю
|
32
29
|
remember_me: Запам'ятати мене
|
33
|
-
user_group_document_number: Номер документа організації
|
34
|
-
user_group_name: Назва організації
|
35
|
-
user_group_phone: Телефон організації
|
36
30
|
models:
|
37
31
|
decidim/user:
|
38
32
|
one: Учасник
|
@@ -258,8 +252,6 @@ uk:
|
|
258
252
|
sign_up: Зареєструватися
|
259
253
|
sign_up_as:
|
260
254
|
legend: Зареєструватися як
|
261
|
-
user: Приватна особа
|
262
|
-
user_group: Організація / колектив
|
263
255
|
subtitle: Зареєструйтесь, щоб брати участь у обговореннях та підтримувати пропозиції.
|
264
256
|
terms: умови участі
|
265
257
|
tos_agreement: Реєструючись, ви приймаєте %{link}.
|
@@ -370,18 +362,6 @@ uk:
|
|
370
362
|
errors:
|
371
363
|
error: У цьому полі є помилка.
|
372
364
|
remove_this_file: Видалити цей файл
|
373
|
-
invitations:
|
374
|
-
create:
|
375
|
-
error: При спробі запросити друзів сталися помилки
|
376
|
-
error_empty_form: Будь ласка, введіть кілька адрес електронної пошти
|
377
|
-
success: Ми надіслали запрошення вашим друзям!
|
378
|
-
index:
|
379
|
-
customize_message: Налаштуйте повідомлення про запрошення
|
380
|
-
friend_email: 'Друг #%{index} Електронна пошта'
|
381
|
-
invitations_subtitle: Нехай ваші друзі дізнаються про цей сайт
|
382
|
-
invitations_title: Як ви гадаєте, чи більше голосів мають бути почутими в %{organization_name}?
|
383
|
-
invite: Запросити
|
384
|
-
visit_your_profile: Відвідайте свій профіль
|
385
365
|
log:
|
386
366
|
base_presenter:
|
387
367
|
create: "%{user_name} створив %{resource_name}"
|
@@ -539,7 +519,7 @@ uk:
|
|
539
519
|
deleted: Видалений учасник
|
540
520
|
view: Переглянути
|
541
521
|
profiles:
|
542
|
-
|
522
|
+
default_officialization_text_for_users: Особу цього учасника прилюдно підтверджено, його ім'я чи роль перевірено на відповідність його справжньому імені та ролі
|
543
523
|
show:
|
544
524
|
conversations: Бесіди
|
545
525
|
followers: Ті, хто стежить
|
@@ -629,7 +609,6 @@ uk:
|
|
629
609
|
ignore: |-
|
630
610
|
Якщо ви не бажаєте приймати запрошення, проігноруйте цей лист.<br /> Ваш обліковий запис не буде створено, доки ви не перейдете за наведеним вище посиланням та встановите свій псевдонім та пароль.
|
631
611
|
invited_you_as_admin: "%{invited_by} запросив вас як адміністратора %{application}. Ви можете прийняти це запрошення за посиланням нижче."
|
632
|
-
invited_you_as_friend: "%{invited_by} запросив вас до %{application}."
|
633
612
|
invited_you_as_private_user: "%{invited_by} запросив вас як приватного учасника %{application}. Ви можете прийняти це запрошення за посиланням нижче."
|
634
613
|
someone_invited_you: Хтось запросив вас до %{application}. Ви можете прийняти це запрошення за посиланням нижче.
|
635
614
|
someone_invited_you_as_admin: Хтось запросив вас як адміністратора %{application}, ви можете прийняти це запрошення за посиланням нижче.
|
@@ -638,10 +617,6 @@ uk:
|
|
638
617
|
subject: Вас запросили керувати %{organization}
|
639
618
|
invite_collaborator:
|
640
619
|
subject: Вас запросили співпрацювати на %{organization}
|
641
|
-
invite_friend:
|
642
|
-
accept_invitation: 'Ви можете прийняти запрошення за посиланням нижче:'
|
643
|
-
friend_custom_text: 'Вам надіслали таке повідомлення:'
|
644
|
-
subject: Вас запросили до %{organization}
|
645
620
|
invite_private_user:
|
646
621
|
subject: Вас запрошено до приватного руху співучасті від %{organization}
|
647
622
|
organization_admin_invitation_instructions:
|
@@ -650,6 +625,9 @@ uk:
|
|
650
625
|
greeting: Доброго дня, %{recipient}!
|
651
626
|
message: Ми пишемо вам, щоб повідомити про те, що ваш пароль був змінений.
|
652
627
|
subject: Пароль змінено
|
628
|
+
passwords:
|
629
|
+
edit:
|
630
|
+
new_password: Пароль
|
653
631
|
doorkeeper:
|
654
632
|
scopes:
|
655
633
|
public: Оприлюднені відомості про вас.
|
@@ -658,12 +636,7 @@ uk:
|
|
658
636
|
content_type_whitelist_error: цей тип файлу неприпустимий
|
659
637
|
cycle_detected: батько обсягу не може бути одним з його нащадків
|
660
638
|
file_size_is_less_than_or_equal_to: розмір файлу має бути меншим або рівним %{count}
|
661
|
-
long_words: містить занадто довгі слова
|
662
|
-
must_start_with_caps: має починатися з великих літер
|
663
639
|
nesting_too_deep: не може бути всередині підкатегорії
|
664
|
-
too_many_marks: містить забагато знаків оклику або питання
|
665
|
-
too_much_caps: містить забагато великих літер
|
666
|
-
too_short: занадто короткий
|
667
640
|
forms:
|
668
641
|
required: Обов'язкове поле
|
669
642
|
invisible_captcha:
|
@@ -693,7 +666,6 @@ uk:
|
|
693
666
|
user_menu:
|
694
667
|
admin_dashboard: Приладна дошка адміністрування
|
695
668
|
conversations: Бесіди
|
696
|
-
invite_friends: Запросити друзів
|
697
669
|
notifications: Сповіщення
|
698
670
|
profile: Мій обліковий запис
|
699
671
|
public_profile: Мій загальнодоступний профіль
|
@@ -705,7 +677,6 @@ uk:
|
|
705
677
|
my_data: Мої дані
|
706
678
|
notifications_settings: Налаштування сповіщень
|
707
679
|
title: Налаштування учасника
|
708
|
-
user_groups: Організації
|
709
680
|
widget:
|
710
681
|
see_more: Читати далі
|
711
682
|
locale:
|
data/config/routes.rb
CHANGED
@@ -37,7 +37,6 @@ Decidim::Core::Engine.routes.draw do
|
|
37
37
|
member do
|
38
38
|
get :delete
|
39
39
|
end
|
40
|
-
resources :invitations, only: [:index, :create]
|
41
40
|
end
|
42
41
|
resources :conversations, only: [:new, :create, :index, :show, :update], controller: "messaging/conversations"
|
43
42
|
resources :notifications, only: [:index, :destroy] do
|
@@ -58,6 +57,25 @@ Decidim::Core::Engine.routes.draw do
|
|
58
57
|
end
|
59
58
|
|
60
59
|
get "/authorization_modals/:authorization_action/f/:component_id(/:resource_name/:resource_id)", to: "authorization_modals#show", as: :authorization_modal
|
60
|
+
|
61
|
+
resources :groups, except: [:destroy, :index, :show] do
|
62
|
+
resources :join_requests, only: [:create, :update, :destroy], controller: "user_group_join_requests"
|
63
|
+
resources :invites, only: [:index, :create, :update, :destroy], controller: "group_invites"
|
64
|
+
resources :users, only: [:index, :destroy], controller: "group_members", as: "manage_users" do
|
65
|
+
member do
|
66
|
+
post :promote
|
67
|
+
end
|
68
|
+
end
|
69
|
+
resources :admins, only: [:index], controller: "group_admins", as: "manage_admins" do
|
70
|
+
member do
|
71
|
+
post :demote
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
member do
|
76
|
+
delete :leave
|
77
|
+
end
|
78
|
+
end
|
61
79
|
end
|
62
80
|
|
63
81
|
resources :profiles, only: [:show], param: :nickname, constraints: { nickname: %r{[^\/]+} }, format: false
|
@@ -65,6 +83,8 @@ Decidim::Core::Engine.routes.draw do
|
|
65
83
|
get "following", to: "profiles#following", as: "profile_following"
|
66
84
|
get "followers", to: "profiles#followers", as: "profile_followers"
|
67
85
|
get "badges", to: "profiles#badges", as: "profile_badges"
|
86
|
+
get "groups", to: "profiles#groups", as: "profile_groups"
|
87
|
+
get "members", to: "profiles#members", as: "profile_members"
|
68
88
|
end
|
69
89
|
|
70
90
|
resources :pages, only: [:index, :show], format: false
|
@@ -85,10 +105,16 @@ Decidim::Core::Engine.routes.draw do
|
|
85
105
|
resource :follow, only: [:create, :destroy]
|
86
106
|
resource :report, only: [:create]
|
87
107
|
|
108
|
+
namespace :gamification do
|
109
|
+
resources :badges, only: [:index]
|
110
|
+
end
|
111
|
+
|
88
112
|
resources :newsletters, only: [:show] do
|
89
113
|
get :unsubscribe, on: :collection
|
90
114
|
end
|
91
115
|
|
116
|
+
resources :last_activities, only: [:index]
|
117
|
+
|
92
118
|
use_doorkeeper do
|
93
119
|
skip_controllers :applications, :authorized_applications
|
94
120
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ChangeUserGroupsVerifiedToTimestamp < ActiveRecord::Migration[5.0]
|
4
|
+
def change
|
5
|
+
ActiveRecord::Base.transaction do
|
6
|
+
add_column :decidim_user_groups, :verified_at, :datetime
|
7
|
+
execute("UPDATE decidim_user_groups SET verified_at = '#{Time.current.to_s(:db)}' WHERE verified = 't'")
|
8
|
+
remove_column :decidim_user_groups, :verified
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateDecidimMetrics < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
create_table :decidim_metrics do |t|
|
6
|
+
t.date :day, null: false, index: true
|
7
|
+
t.string :metric_type, null: false, index: true
|
8
|
+
t.integer :cumulative, null: false
|
9
|
+
t.integer :quantity, null: false
|
10
|
+
t.references :decidim_organization, null: false, index: true
|
11
|
+
t.references :participatory_space, polymorphic: true, index: { name: "index_metric_on_participatory_space_id_and_type" }
|
12
|
+
t.references :related_object, polymorphic: true, index: { name: "index_metric_on_related_object_id_and_type" }
|
13
|
+
t.references :decidim_category
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -10,16 +10,16 @@ class AddCoreContentBlocks < ActiveRecord::Migration[5.2]
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def change
|
13
|
-
default_blocks =
|
13
|
+
default_blocks = Decidim.content_blocks.for(:homepage).select(&:default)
|
14
14
|
|
15
15
|
Organization.pluck(:id).each do |organization_id|
|
16
|
-
default_blocks.each_with_index do |
|
16
|
+
default_blocks.each_with_index do |manifest, index|
|
17
17
|
weight = (index + 1) * 10
|
18
18
|
ContentBlock.create(
|
19
19
|
decidim_organization_id: organization_id,
|
20
20
|
weight: weight,
|
21
21
|
scope: :homepage,
|
22
|
-
manifest_name:
|
22
|
+
manifest_name: manifest.name,
|
23
23
|
published_at: Time.current
|
24
24
|
)
|
25
25
|
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class MoveOrganizationFieldsToHeroContentBlock < ActiveRecord::Migration[5.2]
|
4
|
-
class
|
4
|
+
class Organization < ApplicationRecord
|
5
|
+
self.table_name = :decidim_organizations
|
6
|
+
|
5
7
|
mount_uploader :homepage_image, ::Decidim::HomepageImageUploader
|
6
8
|
end
|
7
9
|
|
8
10
|
def change
|
9
11
|
Decidim::ContentBlock.reset_column_information
|
10
|
-
|
12
|
+
Organization.find_each do |organization|
|
11
13
|
content_block = Decidim::ContentBlock.find_by(organization: organization, scope: :homepage, manifest_name: :hero)
|
12
14
|
settings = {}
|
13
15
|
welcome_text = organization.welcome_text || {}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class MoveUsersGroupsToUsersTable < ActiveRecord::Migration[5.2]
|
4
|
+
class Organization < ApplicationRecord
|
5
|
+
self.table_name = "decidim_organizations"
|
6
|
+
end
|
7
|
+
|
8
|
+
class OldUserGroup < ApplicationRecord
|
9
|
+
self.table_name = "decidim_user_groups"
|
10
|
+
end
|
11
|
+
|
12
|
+
class User < ApplicationRecord
|
13
|
+
include Decidim::Nicknamizable
|
14
|
+
|
15
|
+
self.table_name = "decidim_users"
|
16
|
+
end
|
17
|
+
|
18
|
+
class NewUserGroup < User
|
19
|
+
include Decidim::Nicknamizable
|
20
|
+
end
|
21
|
+
|
22
|
+
class Membership < ApplicationRecord
|
23
|
+
self.table_name = "decidim_user_group_memberships"
|
24
|
+
end
|
25
|
+
|
26
|
+
class Coauthorship < ApplicationRecord
|
27
|
+
self.table_name = "decidim_coauthorships"
|
28
|
+
end
|
29
|
+
|
30
|
+
# rubocop:disable Rails/SkipsModelValidations
|
31
|
+
def change
|
32
|
+
add_column :decidim_users, :type, :string
|
33
|
+
User.update_all(type: "Decidim::User")
|
34
|
+
change_column_null(:decidim_users, :type, false)
|
35
|
+
|
36
|
+
add_column :decidim_users, :extended_data, :jsonb, default: {}
|
37
|
+
|
38
|
+
remove_index :decidim_users, %w(email decidim_organization_id)
|
39
|
+
add_index(
|
40
|
+
:decidim_users,
|
41
|
+
%w(email decidim_organization_id),
|
42
|
+
where: "((deleted_at IS NULL) AND (managed = false) AND (type = 'Decidim::User'))",
|
43
|
+
name: "index_decidim_users_on_email_and_decidim_organization_id",
|
44
|
+
unique: true
|
45
|
+
)
|
46
|
+
|
47
|
+
User.reset_column_information
|
48
|
+
NewUserGroup.reset_column_information
|
49
|
+
|
50
|
+
new_ids = {}
|
51
|
+
OldUserGroup.find_each do |old_user_group|
|
52
|
+
clean_attributes = old_user_group.attributes.except(
|
53
|
+
"id",
|
54
|
+
"document_number",
|
55
|
+
"phone",
|
56
|
+
"rejected_at",
|
57
|
+
"verified_at"
|
58
|
+
)
|
59
|
+
extended_data = {
|
60
|
+
old_user_group_id: old_user_group.id,
|
61
|
+
document_number: old_user_group.document_number,
|
62
|
+
phone: old_user_group.phone,
|
63
|
+
rejected_at: old_user_group.rejected_at,
|
64
|
+
verified_at: old_user_group.verified_at
|
65
|
+
}
|
66
|
+
new_attributes = clean_attributes.merge(
|
67
|
+
nickname: User.nicknamize(clean_attributes["name"]),
|
68
|
+
extended_data: extended_data
|
69
|
+
)
|
70
|
+
new_user_group = NewUserGroup.create!(new_attributes)
|
71
|
+
new_ids[old_user_group.id] = new_user_group.id
|
72
|
+
end
|
73
|
+
|
74
|
+
User.where.not(type: "Decidim::User").update_all(type: "Decidim::UserGroup")
|
75
|
+
|
76
|
+
new_ids.each do |old_id, new_id|
|
77
|
+
Membership.where(decidim_user_group_id: old_id).update_all(decidim_user_group_id: new_id)
|
78
|
+
Coauthorship.where(decidim_user_group_id: old_id).update_all(decidim_user_group_id: new_id)
|
79
|
+
end
|
80
|
+
|
81
|
+
drop_table :decidim_user_groups
|
82
|
+
end
|
83
|
+
# rubocop:enable Rails/SkipsModelValidations
|
84
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddBadgeSwitchToOrganizations < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
add_column :decidim_organizations, :badges_enabled, :boolean, null: false, default: false
|
6
|
+
execute "UPDATE decidim_organizations set badges_enabled = true"
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateDecidimContinuityBadgeStatuses < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
create_table :decidim_continuity_badge_statuses do |t|
|
6
|
+
t.integer :current_streak, :integer, null: false, default: 0
|
7
|
+
t.date :last_session_at, null: false
|
8
|
+
t.references :subject, null: false, polymorphic: true, index: { name: "decidim_continuity_statuses_subject" }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddRolesToMemberships < ActiveRecord::Migration[5.2]
|
4
|
+
def up
|
5
|
+
add_column :decidim_user_group_memberships, :role, :string, default: "requested"
|
6
|
+
execute("UPDATE decidim_user_group_memberships SET role = 'creator'")
|
7
|
+
change_column_null :decidim_user_group_memberships, :role, false
|
8
|
+
add_index(
|
9
|
+
:decidim_user_group_memberships,
|
10
|
+
%w(role decidim_user_group_id),
|
11
|
+
where: "(role = 'creator')",
|
12
|
+
name: "decidim_group_membership_one_creator_per_group",
|
13
|
+
unique: true
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
def down
|
18
|
+
remove_column :decidim_user_group_memberships, :role
|
19
|
+
remove_index(
|
20
|
+
:decidim_user_group_memberships,
|
21
|
+
name: "decidim_group_membership_one_creator_per_group"
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class MakeAuthorsPolymorphic < ActiveRecord::Migration[5.2]
|
4
|
+
class Coauthorship < ApplicationRecord
|
5
|
+
self.table_name = :decidim_coauthorships
|
6
|
+
end
|
7
|
+
|
8
|
+
def change
|
9
|
+
remove_index :decidim_coauthorships, :decidim_author_id
|
10
|
+
|
11
|
+
add_column :decidim_coauthorships, :decidim_author_type, :string
|
12
|
+
|
13
|
+
reversible do |direction|
|
14
|
+
direction.up do
|
15
|
+
execute <<~SQL.squish
|
16
|
+
UPDATE decidim_coauthorships
|
17
|
+
SET decidim_author_type = 'Decidim::UserBaseEntity'
|
18
|
+
SQL
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
add_index :decidim_coauthorships,
|
23
|
+
[:decidim_author_id, :decidim_author_type],
|
24
|
+
name: "index_decidim_coauthorships_on_decidim_author"
|
25
|
+
|
26
|
+
change_column_null :decidim_coauthorships, :decidim_author_id, false
|
27
|
+
change_column_null :decidim_coauthorships, :decidim_author_type, false
|
28
|
+
|
29
|
+
Coauthorship.reset_column_information
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class FixUserFollows < ActiveRecord::Migration[5.2]
|
4
|
+
class Follow < ApplicationRecord
|
5
|
+
self.table_name = "decidim_follows"
|
6
|
+
|
7
|
+
belongs_to :followable, foreign_key: "decidim_followable_id", foreign_type: "decidim_followable_type", polymorphic: true
|
8
|
+
belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
|
9
|
+
end
|
10
|
+
|
11
|
+
def change
|
12
|
+
# rubocop:disable Rails/SkipsModelValidations
|
13
|
+
Follow.where(
|
14
|
+
decidim_followable_type: "Decidim::User"
|
15
|
+
).update_all(decidim_followable_type: "Decidim::UserBaseEntity")
|
16
|
+
# rubocop:enable Rails/SkipsModelValidations
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class DestroyDeletedUsersFollows < ActiveRecord::Migration[5.2]
|
4
|
+
class Follow < ApplicationRecord
|
5
|
+
self.table_name = "decidim_follows"
|
6
|
+
end
|
7
|
+
class User < ApplicationRecord
|
8
|
+
self.table_name = "decidim_users"
|
9
|
+
end
|
10
|
+
|
11
|
+
def change
|
12
|
+
deleted_users = Decidim::User.where.not(deleted_at: nil).pluck(:id)
|
13
|
+
Follow.where(decidim_followable_type: "Decidim::UserBaseEntity", decidim_followable_id: deleted_users).destroy_all
|
14
|
+
Follow.where(decidim_user_id: deleted_users).destroy_all
|
15
|
+
end
|
16
|
+
end
|