decidim-core 0.31.6 → 0.31.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/cells/decidim/card_metadata_cell.rb +1 -1
- data/app/cells/decidim/comments_button_cell.rb +9 -1
- data/app/cells/decidim/content_blocks/participatory_space_main_data/title.erb +1 -14
- data/app/cells/decidim/data_consent/category.erb +20 -33
- data/app/cells/decidim/following_cell.rb +1 -1
- data/app/cells/decidim/footer_topics/show.erb +5 -8
- data/app/cells/decidim/nav_links/show.erb +3 -1
- data/app/cells/decidim/participatory_space_dropdown_metadata/links.erb +1 -1
- data/app/cells/decidim/participatory_space_private_user/show.erb +1 -1
- data/app/cells/decidim/share_text_widget/modal.erb +1 -0
- data/app/cells/decidim/share_widget/modal.erb +1 -0
- data/app/cells/decidim/share_widget/qr_code_modal.erb +2 -4
- data/app/commands/decidim/create_omniauth_registration.rb +17 -2
- data/app/controllers/concerns/decidim/devise_authentication_methods.rb +4 -0
- data/app/controllers/concerns/decidim/devise_controllers.rb +2 -0
- data/app/controllers/concerns/decidim/disable_redirection_to_external_host.rb +2 -0
- data/app/controllers/concerns/decidim/filter_resource.rb +2 -0
- data/app/controllers/concerns/decidim/impersonate_users.rb +2 -2
- data/app/controllers/concerns/decidim/locale_switcher.rb +62 -11
- data/app/controllers/concerns/decidim/needs_permission.rb +22 -10
- data/app/controllers/concerns/decidim/onboarding_action_methods.rb +2 -0
- data/app/controllers/concerns/decidim/paginable.rb +7 -3
- data/app/controllers/concerns/decidim/payload_info.rb +2 -0
- data/app/controllers/concerns/decidim/resource_versions_concern.rb +14 -0
- data/app/controllers/decidim/application_controller.rb +0 -6
- data/app/controllers/decidim/authorization_modals_controller.rb +2 -0
- data/app/controllers/decidim/components/base_controller.rb +2 -0
- data/app/controllers/decidim/devise/passwords_controller.rb +8 -0
- data/app/controllers/decidim/favicon_controller.rb +9 -0
- data/app/controllers/decidim/free_resource_authorization_modals_controller.rb +2 -0
- data/app/controllers/decidim/gamification/badges_controller.rb +2 -0
- data/app/controllers/decidim/homepage_controller.rb +4 -1
- data/app/controllers/decidim/likes_controller.rb +1 -1
- data/app/controllers/decidim/links_controller.rb +2 -0
- data/app/controllers/decidim/manifests_controller.rb +2 -0
- data/app/controllers/decidim/messaging/conversations_controller.rb +10 -4
- data/app/controllers/decidim/newsletters_controller.rb +4 -0
- data/app/controllers/decidim/notifications_subscriptions_controller.rb +4 -0
- data/app/controllers/decidim/offline_controller.rb +5 -1
- data/app/controllers/decidim/open_data_controller.rb +5 -1
- data/app/controllers/decidim/pages_controller.rb +31 -3
- data/app/controllers/decidim/private_downloads_controller.rb +2 -0
- data/app/controllers/decidim/profiles_controller.rb +10 -0
- data/app/controllers/decidim/qr_controller.rb +3 -1
- data/app/controllers/decidim/resource_autocomplete_controller.rb +2 -0
- data/app/controllers/decidim/searches_controller.rb +2 -0
- data/app/controllers/decidim/short_links_controller.rb +4 -0
- data/app/controllers/decidim/static_map_controller.rb +2 -0
- data/app/controllers/decidim/timeouts_controller.rb +4 -0
- data/app/controllers/decidim/tos_controller.rb +2 -0
- data/app/controllers/decidim/upload_validations_controller.rb +4 -2
- data/app/controllers/decidim/user_activities_controller.rb +2 -0
- data/app/events/decidim/amendable/amendment_base_event.rb +7 -1
- data/app/forms/decidim/upload_validation_form.rb +16 -10
- data/app/helpers/concerns/decidim/user_role_checker.rb +35 -10
- data/app/helpers/decidim/menu_helper.rb +0 -2
- data/app/helpers/decidim/sanitize_helper.rb +11 -1
- data/app/jobs/decidim/application_job.rb +4 -0
- data/app/models/decidim/authorization.rb +24 -0
- data/app/models/decidim/oauth_application.rb +1 -0
- data/app/models/decidim/user.rb +3 -2
- data/app/models/decidim/user_base_entity.rb +1 -1
- data/app/packs/src/decidim/callout.js +10 -0
- data/app/packs/src/decidim/callout.test.js +32 -0
- data/app/packs/src/decidim/controllers/accordion/accordion.test.js +260 -42
- data/app/packs/src/decidim/controllers/accordion/controller.js +136 -17
- data/app/packs/src/decidim/controllers/dropdown/controller.js +6 -0
- data/app/packs/src/decidim/controllers/dropdown/dropdown.test.js +28 -0
- data/app/packs/src/decidim/controllers/password_toggler/controller.js +22 -1
- data/app/packs/src/decidim/controllers/password_toggler/password_toggler.test.js +11 -20
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +34 -23
- data/app/packs/src/decidim/datepicker/generate_datepicker.js +4 -4
- data/app/packs/src/decidim/datepicker/test/time.test.js +39 -24
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +2 -1
- data/app/packs/src/decidim/map/controller.js +10 -1
- data/app/packs/src/decidim/refactor/moved/focus_guard.js +12 -12
- data/app/packs/src/decidim/refactor/moved/focus_guard.test.js +136 -0
- data/app/packs/src/decidim/utilities/dom.js +2 -2
- data/app/packs/stylesheets/decidim/_cards.scss +1 -1
- data/app/packs/stylesheets/decidim/_content_blocks.scss +4 -10
- data/app/packs/stylesheets/decidim/_conversations.scss +0 -8
- data/app/packs/stylesheets/decidim/_cookies.scss +13 -5
- data/app/packs/stylesheets/decidim/_documents.scss +1 -1
- data/app/packs/stylesheets/decidim/_footer.scss +33 -1
- data/app/packs/stylesheets/decidim/_modal.scss +16 -8
- data/app/packs/stylesheets/decidim/_modal_share.scss +0 -22
- data/app/packs/stylesheets/decidim/_participatory_spaces.scss +12 -2
- data/app/packs/stylesheets/decidim/_rich_text.scss +12 -9
- data/app/packs/stylesheets/decidim/_typography.scss +5 -2
- data/app/packs/stylesheets/decidim/legacy/email.scss +0 -5
- data/app/permissions/decidim/permissions.rb +20 -0
- data/app/presenters/decidim/admin_log/component_presenter.rb +1 -1
- data/app/presenters/decidim/footer_menu_presenter.rb +2 -4
- data/app/presenters/decidim/log/base_presenter.rb +10 -1
- data/app/presenters/decidim/log/user_presenter.rb +2 -2
- data/app/resolvers/decidim/meta_image_url_resolver.rb +7 -0
- data/app/serializers/decidim/exporters/open_data_blocked_user_serializer.rb +11 -2
- data/app/serializers/decidim/exporters/open_data_moderation_serializer.rb +25 -1
- data/app/services/decidim/svg_content_validator.rb +554 -0
- data/app/uploaders/decidim/application_uploader.rb +2 -2
- data/app/validators/uploader_image_content_validator.rb +278 -0
- data/app/views/decidim/application/_radio_accordion.html.erb +1 -5
- data/app/views/decidim/messaging/conversations/create.js.erb +1 -3
- data/app/views/decidim/searches/_filters.html.erb +1 -1
- data/app/views/decidim/shared/_login_modal.html.erb +12 -14
- data/app/views/layouts/decidim/_mailer_logo.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_links.html.erb +56 -28
- data/config/initializers/rack_attack.rb +10 -0
- data/config/locales/ar.yml +0 -20
- data/config/locales/bg.yml +0 -20
- data/config/locales/ca-IT.yml +31 -24
- data/config/locales/ca.yml +31 -24
- data/config/locales/cs.yml +20 -22
- data/config/locales/de.yml +59 -26
- data/config/locales/el.yml +0 -18
- data/config/locales/en.yml +31 -24
- data/config/locales/es-MX.yml +31 -24
- data/config/locales/es-PY.yml +31 -24
- data/config/locales/es.yml +31 -24
- data/config/locales/eu.yml +178 -176
- data/config/locales/fi-plain.yml +29 -24
- data/config/locales/fi.yml +29 -24
- data/config/locales/fr-CA.yml +10 -20
- data/config/locales/fr.yml +10 -20
- data/config/locales/gl.yml +1440 -51
- data/config/locales/hu.yml +0 -18
- data/config/locales/id-ID.yml +0 -18
- data/config/locales/is-IS.yml +0 -6
- data/config/locales/it.yml +0 -17
- data/config/locales/ja.yml +29 -24
- data/config/locales/lb.yml +0 -18
- data/config/locales/lt.yml +0 -19
- data/config/locales/lv.yml +0 -18
- data/config/locales/nl.yml +0 -18
- data/config/locales/no.yml +0 -18
- data/config/locales/pl.yml +2 -20
- data/config/locales/pt-BR.yml +0 -26
- data/config/locales/pt.yml +0 -18
- data/config/locales/ro-RO.yml +0 -19
- data/config/locales/ru.yml +0 -8
- data/config/locales/sk.yml +2 -26
- data/config/locales/sv.yml +45 -29
- data/config/locales/tr-TR.yml +0 -20
- data/config/locales/uk.yml +0 -6
- data/config/locales/zh-CN.yml +0 -16
- data/config/locales/zh-TW.yml +0 -19
- data/db/migrate/20250217192438_convert_user_groups_into_users.rb +3 -2
- data/db/migrate/20260909000000_add_failed_attempts_and_locked_at_to_decidim_authorizations.rb +8 -0
- data/decidim-core.gemspec +3 -0
- data/lib/decidim/core/test/shared_examples/amendable/amendment_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +26 -0
- data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +2 -1
- data/lib/decidim/core/test/shared_examples/participatory_space_members_page_examples.rb +77 -0
- data/lib/decidim/core/test/shared_examples/participatory_space_members_shared_examples.rb +85 -6
- data/lib/decidim/core/test/shared_examples/resource_liked_event_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +23 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +10 -1
- data/lib/decidim/has_upload_validations.rb +1 -0
- data/lib/decidim/legacy_form_builder.rb +4 -0
- data/lib/decidim/map/dynamic_map.rb +3 -1
- data/lib/decidim/query_extensions.rb +2 -0
- metadata +31 -6
data/config/locales/tr-TR.yml
CHANGED
|
@@ -419,13 +419,9 @@ tr:
|
|
|
419
419
|
affected_user:
|
|
420
420
|
email_intro: '%{amendable_title}için bir ödeme kabul edildi. Bu sayfadan görebilirsiniz:'
|
|
421
421
|
email_outro: Bu bildirimi aldınız, çünkü %{amendable_title}yazarı sizsiniz.
|
|
422
|
-
email_subject: '%{emendation_author_nickname}%{amendable_title} bir değişiklik kabul edildi'
|
|
423
|
-
notification_title: <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> tarafından yaratılan <a href="%{emendation_path}">değişiklik</a> <a href="%{amendable_path}">%{amendable_title}</a>için kabul edilmiştir.
|
|
424
422
|
follower:
|
|
425
423
|
email_intro: '%{amendable_title}için bir ödeme kabul edildi. Bu sayfadan görebilirsiniz:'
|
|
426
424
|
email_outro: Bu bildirimi, %{amendable_title}izlediğiniz için aldınız. Önceki bağlantıyı takip ederek bildirimleri almayı durdurabilirsiniz.
|
|
427
|
-
email_subject: '%{emendation_author_nickname}%{amendable_title} bir değişiklik kabul edildi'
|
|
428
|
-
notification_title: <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> tarafından yaratılan <a href="%{emendation_path}">değişiklik</a> <a href="%{amendable_path}">%{amendable_title}</a>için kabul edilmiştir.
|
|
429
425
|
amendment_created:
|
|
430
426
|
affected_user:
|
|
431
427
|
email_intro: '%{amendable_title}için yeni bir emendation oluşturuldu. Bu sayfadan görebilirsiniz:'
|
|
@@ -441,24 +437,16 @@ tr:
|
|
|
441
437
|
affected_user:
|
|
442
438
|
email_intro: '%{amendable_title} için reddedilen bir tahliye, bağımsız %{amendable_type} yükseltilmiştir. Bu sayfadan görebilirsiniz:'
|
|
443
439
|
email_outro: Bu bildirimi aldınız, çünkü %{amendable_title} yazarı sizsiniz.
|
|
444
|
-
email_subject: '%{emendation_author_nickname} bir değişiklik yeni olarak yayınlandı %{amendable_type}'
|
|
445
|
-
notification_title: Bir <a href="%{emendation_path}">değişikliğini reddetmiştir</a> için <a href="%{amendable_path}">%{amendable_title}</a>, yeni olarak yayınlanmış %{amendable_type} ile <a href="%{emendation_author_path}">%{emendation_author_nickname}</a>.
|
|
446
440
|
follower:
|
|
447
441
|
email_intro: '%{amendable_title} için reddedilen bir tahliye, bağımsız %{amendable_type} yükseltilmiştir. Bu sayfadan görebilirsiniz:'
|
|
448
442
|
email_outro: Bu bildirimi, %{amendable_title} izlediğiniz için aldınız. Önceki bağlantıyı takip ederek bildirimleri almayı durdurabilirsiniz.
|
|
449
|
-
email_subject: '%{emendation_author_nickname} bir değişiklik yeni olarak yayınlandı %{amendable_type}'
|
|
450
|
-
notification_title: Bir <a href="%{emendation_path}">değişikliğini reddetmiştir</a> için <a href="%{amendable_path}">%{amendable_title}</a>, yeni olarak yayınlanmış %{amendable_type} ile <a href="%{emendation_author_path}">%{emendation_author_nickname}</a>.
|
|
451
443
|
amendment_rejected:
|
|
452
444
|
affected_user:
|
|
453
445
|
email_intro: 'Bir emendation %{amendable_title} için reddedildi. Bu sayfadan görebilirsiniz:'
|
|
454
446
|
email_outro: Bu bildirimi aldınız, çünkü %{amendable_title} yazarı sizsiniz.
|
|
455
|
-
email_subject: Bir değişiklik %{emendation_author_nickname}%{amendable_title} için reddedildi
|
|
456
|
-
notification_title: <a href="%{emendation_path}">değişiklik</a> tarafından oluşturulan <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> reddedildi <a href="%{amendable_path}">%{amendable_title}</a>.
|
|
457
447
|
follower:
|
|
458
448
|
email_intro: 'Bir emendation %{amendable_title} için reddedildi. Bu sayfadan görebilirsiniz:'
|
|
459
449
|
email_outro: Bu bildirimi, %{amendable_title} izlediğiniz için aldınız. Önceki bağlantıyı takip ederek bildirimleri almayı durdurabilirsiniz.
|
|
460
|
-
email_subject: Bir değişiklik %{emendation_author_nickname}%{amendable_title} için reddedildi
|
|
461
|
-
notification_title: <a href="%{emendation_path}">değişiklik</a> tarafından oluşturulan <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> reddedildi <a href="%{amendable_path}">%{amendable_title}</a>.
|
|
462
450
|
attachments:
|
|
463
451
|
attachment_created:
|
|
464
452
|
email_intro: '%{resource_title} yeni bir belge eklendi. Bu sayfadan görebilirsiniz:'
|
|
@@ -489,12 +477,6 @@ tr:
|
|
|
489
477
|
notification_title: |-
|
|
490
478
|
Bir yönetici, %{resource_type}'nizi %{report_reasons} olarak bildirildiği için kaldırdı. </br>
|
|
491
479
|
<i>%{resource_content} </i>
|
|
492
|
-
users:
|
|
493
|
-
profile_updated:
|
|
494
|
-
email_intro: <a href="%{resource_url}">profil sayfası</a> arasında %{name} (%{nickname} izlediğiniz), güncellendi.
|
|
495
|
-
email_outro: Bu bildirimi, %{nickname} izlediğiniz için aldınız. Önceki bağlantıyı takip ederek bildirimleri almayı durdurabilirsiniz.
|
|
496
|
-
email_subject: "%{nickname} profilini güncelledi"
|
|
497
|
-
notification_title: <a href="%{resource_path}">profil sayfası</a> arasında %{name} (%{nickname} izlediğiniz), güncellendi.
|
|
498
480
|
export_mailer:
|
|
499
481
|
download_your_data_export:
|
|
500
482
|
download: İndir
|
|
@@ -986,8 +968,6 @@ tr:
|
|
|
986
968
|
timestamp_error_message: Üzgünüm, bu çok hızlıydı! Lütfen yeniden gönderin.
|
|
987
969
|
layouts:
|
|
988
970
|
decidim:
|
|
989
|
-
announcements:
|
|
990
|
-
view_less: Daha Az Göster
|
|
991
971
|
data_consent:
|
|
992
972
|
details:
|
|
993
973
|
columns:
|
data/config/locales/uk.yml
CHANGED
|
@@ -250,12 +250,6 @@ uk:
|
|
|
250
250
|
email_intro: '"%{resource_title}" було оновлено. Ви можете переглянути його на сторінці:'
|
|
251
251
|
email_outro: Ви отримали це сповіщення, тому що ви стежите за "%{resource_title}". Ви можете припинити стежити за ним, перейшовши за наведеним вище посиланням.
|
|
252
252
|
email_subject: Оновлення до %{resource_title}
|
|
253
|
-
users:
|
|
254
|
-
profile_updated:
|
|
255
|
-
email_intro: Сторінка <a href="%{resource_url}">профілю</a> учасника %{name} (%{nickname}), за яким ви стежите, була оновлена.
|
|
256
|
-
email_outro: Ви отримали це сповіщення, тому що ви стежите за %{nickname}. Ви можете відписатися від цих сповіщень, перейшовши за наведеним вище посиланням.
|
|
257
|
-
email_subject: "%{nickname} оновив свій профіль"
|
|
258
|
-
notification_title: Сторінка <a href="%{resource_path}">профілю</a> учасника %{name} (%{nickname}), за яким ви стежите, була оновлена.
|
|
259
253
|
export_mailer:
|
|
260
254
|
download_your_data_export:
|
|
261
255
|
download: Завантажити
|
data/config/locales/zh-CN.yml
CHANGED
|
@@ -351,13 +351,9 @@ zh-CN:
|
|
|
351
351
|
affected_user:
|
|
352
352
|
email_intro: '%{amendable_title}的修改已被接受。您可以从这个页面查看:'
|
|
353
353
|
email_outro: 您收到此通知是因为您是 %{amendable_title} 的作者。
|
|
354
|
-
email_subject: 接受来自 %{amendable_title} 的 %{emendation_author_nickname} 修正案
|
|
355
|
-
notification_title: 由 <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> 创建的 <a href="%{emendation_path}">修正</a> 已被接受 <a href="%{amendable_path}">%{amendable_title}</a>。
|
|
356
354
|
follower:
|
|
357
355
|
email_intro: '%{amendable_title}的修改已被接受。您可以从这个页面查看:'
|
|
358
356
|
email_outro: 您收到此通知是因为您正在关注 %{amendable_title}。您可以停止收到跟随上一个链接的通知。
|
|
359
|
-
email_subject: 接受来自 %{amendable_title} 的 %{emendation_author_nickname} 修正案
|
|
360
|
-
notification_title: 由 <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> 创建的 <a href="%{emendation_path}">修正</a> 已被接受 <a href="%{amendable_path}">%{amendable_title}</a>。
|
|
361
357
|
amendment_created:
|
|
362
358
|
affected_user:
|
|
363
359
|
email_intro: '已经为 %{amendable_title}创建了一个新的版本。您可以从这个页面查看它:'
|
|
@@ -373,22 +369,16 @@ zh-CN:
|
|
|
373
369
|
affected_user:
|
|
374
370
|
email_intro: '%{amendable_title} 的被拒绝的修订已经发布为新的 %{amendable_type}。您可以从这个页面查看:'
|
|
375
371
|
email_outro: 您收到此通知是因为您是 %{amendable_title} 的作者。
|
|
376
|
-
email_subject: 来自 %{emendation_author_nickname} 的修订已经发布为新的 %{amendable_type}
|
|
377
372
|
follower:
|
|
378
373
|
email_intro: '%{amendable_title} 的被拒绝的修订已经发布为新的 %{amendable_type}。您可以从这个页面查看:'
|
|
379
374
|
email_outro: 您收到此通知是因为您正在关注 %{amendable_title}。您可以停止收到跟随上一个链接的通知。
|
|
380
|
-
email_subject: 来自 %{emendation_author_nickname} 的修订已经发布为新的 %{amendable_type}
|
|
381
375
|
amendment_rejected:
|
|
382
376
|
affected_user:
|
|
383
377
|
email_intro: '%{amendable_title}的修订已被拒绝。您可以从这个页面查看:'
|
|
384
378
|
email_outro: 您收到此通知是因为您是 %{amendable_title} 的作者。
|
|
385
|
-
email_subject: '%{amendable_title} 的 %{emendation_author_nickname} 修正案被拒绝'
|
|
386
|
-
notification_title: 由 <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> 创建的 <a href="%{emendation_path}">项修正</a> 已被 <a href="%{amendable_path}">%{amendable_title}</a> 拒绝。
|
|
387
379
|
follower:
|
|
388
380
|
email_intro: '%{amendable_title}的修订已被拒绝。您可以从这个页面查看:'
|
|
389
381
|
email_outro: 您收到此通知是因为您正在关注 %{amendable_title}。您可以停止收到跟随上一个链接的通知。
|
|
390
|
-
email_subject: '%{amendable_title} 的 %{emendation_author_nickname} 修正案被拒绝'
|
|
391
|
-
notification_title: 由 <a href="%{emendation_author_path}">%{emendation_author_nickname}</a> 创建的 <a href="%{emendation_path}">项修正</a> 已被 <a href="%{amendable_path}">%{amendable_title}</a> 拒绝。
|
|
392
382
|
attachments:
|
|
393
383
|
attachment_created:
|
|
394
384
|
email_intro: '一个新文档已添加到 %{resource_title}。您可以从这个页面查看:'
|
|
@@ -411,12 +401,6 @@ zh-CN:
|
|
|
411
401
|
email_outro: 您收到此通知是因为您在我们的网站上进行了活动。
|
|
412
402
|
level_up:
|
|
413
403
|
email_outro: 您收到此通知是因为您在我们的网站上进行了活动。
|
|
414
|
-
users:
|
|
415
|
-
profile_updated:
|
|
416
|
-
email_intro: 您关注的 %{name} (%{nickname}) 的 <a href="%{resource_url}">个人资料页面</a> 已经更新。
|
|
417
|
-
email_outro: 您收到此通知是因为您正在关注 %{nickname}。您可以停止收到跟随上一个链接的通知。
|
|
418
|
-
email_subject: "%{nickname} 更新了他们的个人资料"
|
|
419
|
-
notification_title: 您关注的 %{name} (%{nickname}) 的 <a href="%{resource_path}">个人资料页面</a> 已经更新。
|
|
420
404
|
export_mailer:
|
|
421
405
|
download_your_data_export:
|
|
422
406
|
download: 下载
|
data/config/locales/zh-TW.yml
CHANGED
|
@@ -550,13 +550,9 @@ zh-TW:
|
|
|
550
550
|
affected_user:
|
|
551
551
|
email_intro: '已接受對於 %{amendable_title} 的修正案。您可以從此頁面中查看:'
|
|
552
552
|
email_outro: 你收到此通知,是因為你是%{amendable_title} 的作者。
|
|
553
|
-
email_subject: 已接受對於 %{amendable_title} 的修正案,來自於 %{emendation_author_nickname}
|
|
554
|
-
notification_title: <a href="%{emendation_path}">修正案</a>由<a href="%{emendation_author_path}">%{emendation_author_nickname}</a>創建,已被接受適用於<a href="%{amendable_path}">%{amendable_title}</a>。
|
|
555
553
|
follower:
|
|
556
554
|
email_intro: '已接受對於 %{amendable_title} 的修正案。您可以從此頁面中查看:'
|
|
557
555
|
email_outro: 您收到此通知,是因為您正在關注 %{amendable_title}。您可以使用上面的連結停止接收通知。
|
|
558
|
-
email_subject: 已接受對於 %{amendable_title} 的修正案,來自於 %{emendation_author_nickname}
|
|
559
|
-
notification_title: <a href="%{emendation_path}">修正案</a>由<a href="%{emendation_author_path}">%{emendation_author_nickname}</a>創建,已被接受適用於<a href="%{amendable_path}">%{amendable_title}</a>。
|
|
560
556
|
amendment_created:
|
|
561
557
|
affected_user:
|
|
562
558
|
email_intro: '已為 %{amendable_title} 創建一個新的修正案。您可以從此頁面查看:'
|
|
@@ -572,24 +568,16 @@ zh-TW:
|
|
|
572
568
|
affected_user:
|
|
573
569
|
email_intro: '一個被拒絕的修正案已被發佈為新的 %{amendable_type},針對 %{amendable_title}。您可以從此頁面查看:'
|
|
574
570
|
email_outro: 你收到此通知,是因為你是%{amendable_title} 的作者。
|
|
575
|
-
email_subject: 來自 %{emendation_author_nickname} 的修正案已被發佈為新的 %{amendable_type}
|
|
576
|
-
notification_title: 一個<a href="%{emendation_path}">被拒絕的修正案</a>已由<a href="%{emendation_author_path}">%{emendation_author_nickname}</a>發佈為新的 %{amendable_type},針對<a href="%{amendable_path}">%{amendable_title}</a>。
|
|
577
571
|
follower:
|
|
578
572
|
email_intro: '一個被拒絕的修正案已被發佈為新的 %{amendable_type},針對 %{amendable_title}。您可以從此頁面查看:'
|
|
579
573
|
email_outro: 您收到此通知,是因為您正在關注 %{amendable_title}。您可以使用上面的連結停止接收通知。
|
|
580
|
-
email_subject: 來自 %{emendation_author_nickname} 的修正案已被發佈為新的 %{amendable_type}
|
|
581
|
-
notification_title: 一個<a href="%{emendation_path}">被拒絕的修正案</a>已由<a href="%{emendation_author_path}">%{emendation_author_nickname}</a>發佈為新的 %{amendable_type},針對<a href="%{amendable_path}">%{amendable_title}</a>。
|
|
582
574
|
amendment_rejected:
|
|
583
575
|
affected_user:
|
|
584
576
|
email_intro: '一個修正案已被拒絕,針對 %{amendable_title}。您可以從此頁面查看:'
|
|
585
577
|
email_outro: 你收到此通知,是因為你是%{amendable_title} 的作者。
|
|
586
|
-
email_subject: 修正案由 %{emendation_author_nickname} 提交,針對 %{amendable_title},已被拒絕。
|
|
587
|
-
notification_title: <a href="%{emendation_path}">%{emendation_author_nickname}</a>創建的<a href="%{emendation_path}">修正案</a>已被拒絕,針對<a href="%{amendable_path}">%{amendable_title}</a>。
|
|
588
578
|
follower:
|
|
589
579
|
email_intro: '一個修正案已被拒絕,針對 %{amendable_title}。您可以從此頁面查看:'
|
|
590
580
|
email_outro: 您收到此通知,是因為您正在關注 %{amendable_title}。您可以使用上面的連結停止接收通知。
|
|
591
|
-
email_subject: 修正案由 %{emendation_author_nickname} 提交,針對 %{amendable_title},已被拒絕。
|
|
592
|
-
notification_title: <a href="%{emendation_path}">%{emendation_author_nickname}</a>創建的<a href="%{emendation_path}">修正案</a>已被拒絕,針對<a href="%{amendable_path}">%{amendable_title}</a>。
|
|
593
581
|
attachments:
|
|
594
582
|
attachment_created:
|
|
595
583
|
email_intro: '已新增一個文件至 %{resource_title}。您可以從此頁面查看:'
|
|
@@ -626,16 +614,9 @@ zh-TW:
|
|
|
626
614
|
notification_title: |-
|
|
627
615
|
一位管理員因為 %{report_reasons} 的舉報,移除了您的%{resource_type}。</br> <i>%{resource_content}</i>
|
|
628
616
|
users:
|
|
629
|
-
profile_updated:
|
|
630
|
-
email_intro: 你正在追蹤的 %{name}(%{nickname}) 的<a href="%{resource_path}">個人資料頁面</a>已被更新。
|
|
631
|
-
email_outro: 您收到此通知是因為您正在關注 %{nickname}。您可以點擊上方的連結停止接收通知。
|
|
632
|
-
email_subject: "%{nickname} 更新了他們的個人資料。"
|
|
633
|
-
notification_title: 你正在追蹤的 %{name}(%{nickname}) 的<a href="%{resource_path}">個人資料頁面</a>已被更新。
|
|
634
617
|
user_officialized:
|
|
635
|
-
email_intro: 參與者 %{name} (%{nickname}) 已被官方認證。
|
|
636
618
|
email_outro: 您收到此通知是因為您是該組織的管理員。
|
|
637
619
|
email_subject: "%{name} 已被官方認證。"
|
|
638
|
-
notification_title: 參與者 %{name} (%{nickname}) 已被官方認證。
|
|
639
620
|
export_mailer:
|
|
640
621
|
download_your_data_export:
|
|
641
622
|
download: 下載
|
|
@@ -33,8 +33,8 @@ class ConvertUserGroupsIntoUsers < ActiveRecord::Migration[7.0]
|
|
|
33
33
|
def up
|
|
34
34
|
User.old_group.find_each do |group|
|
|
35
35
|
if group.email.blank? || another_user_with_same_email_in_organization?(group)
|
|
36
|
-
group.update_attribute(:email, "user_group_#{group.id}@#{group.organization.host}.invalid")
|
|
37
36
|
group.update_attribute(:extended_data, (group.extended_data || {}).merge("patched" => true, "previous_email" => group.email))
|
|
37
|
+
group.update_attribute(:email, "user_group_#{group.id}@#{group.organization.host}.invalid")
|
|
38
38
|
|
|
39
39
|
group.reload
|
|
40
40
|
end
|
|
@@ -49,7 +49,8 @@ class ConvertUserGroupsIntoUsers < ActiveRecord::Migration[7.0]
|
|
|
49
49
|
User.new_group.find_each do |group|
|
|
50
50
|
group.update_attribute(:officialized_at, nil)
|
|
51
51
|
group.update_attribute(:type, "Decidim::UserGroup")
|
|
52
|
-
group.update_attribute(:
|
|
52
|
+
group.update_attribute(:email, group.extended_data["previous_email"]) if group.extended_data["previous_email"].present?
|
|
53
|
+
group.update_attribute(:extended_data, (group.extended_data || {}).except("group", "patched", "previous_email"))
|
|
53
54
|
end
|
|
54
55
|
end
|
|
55
56
|
# rubocop:enable Rails/SkipsModelValidations
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AddFailedAttemptsAndLockedAtToDecidimAuthorizations < ActiveRecord::Migration[7.0]
|
|
4
|
+
def change
|
|
5
|
+
add_column :decidim_authorizations, :failed_attempts, :integer, default: 0, null: false
|
|
6
|
+
add_column :decidim_authorizations, :locked_at, :datetime
|
|
7
|
+
end
|
|
8
|
+
end
|
data/decidim-core.gemspec
CHANGED
|
@@ -74,6 +74,9 @@ Gem::Specification.new do |s|
|
|
|
74
74
|
s.add_dependency "premailer-rails", "~> 1.10"
|
|
75
75
|
s.add_dependency "rack", "~> 2.2", ">= 2.2.8.1"
|
|
76
76
|
s.add_dependency "rack-attack", "~> 6.0"
|
|
77
|
+
# Workaround until shakapacker releases a new version compatible with rack-proxy v1.0
|
|
78
|
+
# @see https://github.com/shakacode/shakapacker/issues/1220
|
|
79
|
+
s.add_dependency "rack-proxy", "~> 0.8.3", "< 1.0"
|
|
77
80
|
s.add_dependency "rails", "~> 7.2.0", ">= 7.2.2.2"
|
|
78
81
|
s.add_dependency "rails-i18n", "~> 7.0"
|
|
79
82
|
s.add_dependency "ransack", "~> 4.2.0"
|
|
@@ -8,7 +8,7 @@ shared_examples "amendment event" do
|
|
|
8
8
|
it_behaves_like "a simple event email"
|
|
9
9
|
it_behaves_like "a simple event notification"
|
|
10
10
|
|
|
11
|
-
let(:
|
|
11
|
+
let(:emendation_author_name) { emendation.creator_author.name }
|
|
12
12
|
let(:emendation_path) { Decidim::ResourceLocatorPresenter.new(emendation).path }
|
|
13
13
|
let(:emendation_author_path) { Decidim::UserPresenter.new(emendation.creator_author).profile_path }
|
|
14
14
|
let(:amendable_path) { Decidim::ResourceLocatorPresenter.new(amendable).path }
|
|
@@ -16,5 +16,5 @@ shared_examples "amendment event" do
|
|
|
16
16
|
let(:email_intro) { "An amendment has been #{amendment_type} for #{amendable_title}. You can see it from this page:" }
|
|
17
17
|
let(:email_outro) { "You have received this notification because you are following #{amendable_title}. You can stop receiving notifications following the previous link." }
|
|
18
18
|
|
|
19
|
-
let(:notification_title) { "The <a href=\"#{emendation_path}\">amendment</a> created by <a href=\"#{emendation_author_path}\">#{
|
|
19
|
+
let(:notification_title) { "The <a href=\"#{emendation_path}\">amendment</a> created by <a href=\"#{emendation_author_path}\">#{emendation_author_name}</a> has been #{amendment_type} for <a href=\"#{amendable_path}\">#{amendable_title}</a>." } # rubocop:disable Layout/LineLength
|
|
20
20
|
end
|
|
@@ -10,15 +10,15 @@ shared_examples "amendment promoted event" do
|
|
|
10
10
|
it_behaves_like "a simple event email"
|
|
11
11
|
it_behaves_like "a simple event notification"
|
|
12
12
|
|
|
13
|
-
let(:
|
|
13
|
+
let(:emendation_author_name) { emendation.creator_author.name }
|
|
14
14
|
let(:emendation_path) { Decidim::ResourceLocatorPresenter.new(emendation).path }
|
|
15
15
|
let(:emendation_author_path) { Decidim::UserPresenter.new(emendation.creator_author).profile_path }
|
|
16
16
|
let(:amendable_path) { Decidim::ResourceLocatorPresenter.new(amendable).path }
|
|
17
17
|
|
|
18
|
-
let(:email_subject) { "An amendment from #{
|
|
18
|
+
let(:email_subject) { "An amendment from #{emendation_author_name} has been published as a new proposal" }
|
|
19
19
|
let(:email_intro) { "A rejected amendment for #{amendable_title} has been published as a new #{amendable_type}. You can see it from this page:" }
|
|
20
20
|
let(:email_outro) { "You have received this notification because you are following #{amendable_title}. You can stop receiving notifications following the previous link." }
|
|
21
21
|
# rubocop:disable Layout/LineLength
|
|
22
|
-
let(:notification_title) { "A <a href=\"#{emendation_path}\">rejected amendment</a> for <a href=\"#{amendable_path}\">#{amendable_title}</a> has been published as a new #{amendable_type} by <a href=\"#{emendation_author_path}\">#{
|
|
22
|
+
let(:notification_title) { "A <a href=\"#{emendation_path}\">rejected amendment</a> for <a href=\"#{amendable_path}\">#{amendable_title}</a> has been published as a new #{amendable_type} by <a href=\"#{emendation_author_path}\">#{emendation_author_name}</a>." }
|
|
23
23
|
# rubocop:enable Layout/LineLength
|
|
24
24
|
end
|
|
@@ -147,6 +147,16 @@ shared_examples "comments" do
|
|
|
147
147
|
expect(page).to have_css(".comment-thread")
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
+
it "opens the login modal when clicking the comment button" do
|
|
151
|
+
visit resource_path
|
|
152
|
+
|
|
153
|
+
expect(page).to have_no_css("#loginModal-content", visible: :visible)
|
|
154
|
+
|
|
155
|
+
find(".add-comment-mobile").click
|
|
156
|
+
|
|
157
|
+
expect(page).to have_css("#loginModal-content", visible: :visible)
|
|
158
|
+
end
|
|
159
|
+
|
|
150
160
|
context "when user visit a mobile browser" do
|
|
151
161
|
before do
|
|
152
162
|
driven_by(:iphone)
|
|
@@ -176,6 +186,22 @@ shared_examples "comments" do
|
|
|
176
186
|
expect(page).to have_css(".add-comment form")
|
|
177
187
|
end
|
|
178
188
|
|
|
189
|
+
it "does not show login modal when clicking the comment button" do
|
|
190
|
+
visit resource_path
|
|
191
|
+
|
|
192
|
+
find("a.add-comment-mobile").click
|
|
193
|
+
|
|
194
|
+
expect(page).to have_no_css("#loginModal-content", visible: :visible)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
it "guides the user to the comment form when clicking the comment button" do
|
|
198
|
+
visit resource_path
|
|
199
|
+
|
|
200
|
+
find("a.add-comment-mobile").click
|
|
201
|
+
|
|
202
|
+
expect(page).to have_css("#add-comment-anchor")
|
|
203
|
+
end
|
|
204
|
+
|
|
179
205
|
context "when user visit a computer browser" do
|
|
180
206
|
before do
|
|
181
207
|
switch_to_host(organization.host)
|
|
@@ -8,7 +8,8 @@ shared_examples_for "has space in m-cell" do
|
|
|
8
8
|
let(:show_space) { true }
|
|
9
9
|
|
|
10
10
|
it "renders the space where the model belongs to" do
|
|
11
|
-
expect(cell_html).to have_content(
|
|
11
|
+
expect(cell_html).to have_content(translated_attribute(model.component.participatory_space.title))
|
|
12
|
+
expect(cell_html.to_s).to include(decidim_escape_translated(model.component.participatory_space.title).gsub(""", "\""))
|
|
12
13
|
end
|
|
13
14
|
end
|
|
14
15
|
end
|
|
@@ -42,5 +42,82 @@ shared_examples "participatory space members page examples" do
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
|
+
|
|
46
|
+
context "when participatory space has paginated members" do
|
|
47
|
+
let(:users) { create_list(:user, 30, organization: privatable_to.organization) }
|
|
48
|
+
let!(:members) do
|
|
49
|
+
users.map do |user|
|
|
50
|
+
create(:participatory_space_private_user, privatable_to:, user:, published: true)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
context "with default pagination" do
|
|
55
|
+
it "returns first page with 25 members" do
|
|
56
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale }
|
|
57
|
+
|
|
58
|
+
expect(assigns(:members).count).to eq(25)
|
|
59
|
+
expect(assigns(:members).current_page).to eq(1)
|
|
60
|
+
expect(assigns(:members).total_count).to eq(30)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
context "with page parameter" do
|
|
65
|
+
it "returns second page with remaining members" do
|
|
66
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale, :page => 2 }
|
|
67
|
+
|
|
68
|
+
expect(assigns(:members).count).to eq(5)
|
|
69
|
+
expect(assigns(:members).current_page).to eq(2)
|
|
70
|
+
expect(assigns(:members).total_count).to eq(30)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it "returns empty collection for out-of-range page" do
|
|
74
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale, :page => 999 }
|
|
75
|
+
|
|
76
|
+
expect(assigns(:members).count).to eq(0)
|
|
77
|
+
expect(assigns(:members).current_page).to eq(999)
|
|
78
|
+
expect(assigns(:members).total_count).to eq(30)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
context "with per_page parameter" do
|
|
83
|
+
it "returns all members when per_page is 50" do
|
|
84
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale, :per_page => 50 }
|
|
85
|
+
|
|
86
|
+
expect(assigns(:members).count).to eq(30)
|
|
87
|
+
expect(assigns(:members).current_page).to eq(1)
|
|
88
|
+
expect(assigns(:members).limit_value).to eq(50)
|
|
89
|
+
expect(assigns(:members).total_count).to eq(30)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it "returns first 25 members when per_page is 25" do
|
|
93
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale, :per_page => 25 }
|
|
94
|
+
|
|
95
|
+
expect(assigns(:members).count).to eq(25)
|
|
96
|
+
expect(assigns(:members).limit_value).to eq(25)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
it "limits per_page to maximum allowed value" do
|
|
100
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale, :per_page => 200 }
|
|
101
|
+
|
|
102
|
+
expect(assigns(:members).limit_value).to eq(100)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
it "limit per_page to minimum allowed value" do
|
|
106
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale, :per_page => 5 }
|
|
107
|
+
|
|
108
|
+
expect(assigns(:members).limit_value).to eq(25)
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
context "with both page and per_page parameters" do
|
|
113
|
+
it "returns correct page with custom per_page" do
|
|
114
|
+
get :index, params: { slug_param => slug, :locale => I18n.locale, :page => 2, :per_page => 50 }
|
|
115
|
+
|
|
116
|
+
expect(assigns(:members).count).to eq(0)
|
|
117
|
+
expect(assigns(:members).current_page).to eq(2)
|
|
118
|
+
expect(assigns(:members).limit_value).to eq(50)
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
45
122
|
end
|
|
46
123
|
end
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
shared_examples "participatory space members" do
|
|
4
4
|
let(:blocks_manifests) { [] }
|
|
5
5
|
let(:organization) { create(:organization) }
|
|
6
|
-
let(:user) { create(:user, organization: participatory_space.organization) }
|
|
6
|
+
let(:user) { create(:user, :confirmed, organization: participatory_space.organization) }
|
|
7
7
|
let(:unpublished_user) { create(:user, organization: participatory_space.organization) }
|
|
8
|
+
# A visitor allowed to reach the space homepage even when the space is
|
|
9
|
+
# private (e.g. an organization admin). Homepage checks use it so that they
|
|
10
|
+
# inspect the actual homepage instead of a redirect target.
|
|
11
|
+
let(:allowed_visitor) { create(:user, :admin, :confirmed, organization: participatory_space.organization) }
|
|
12
|
+
# Spaces whose members page is not publicly accessible (e.g. private
|
|
13
|
+
# participatory processes) require a logged in member. Host specs can opt in
|
|
14
|
+
# by overriding this to true.
|
|
15
|
+
let(:login_as_member) { false }
|
|
8
16
|
|
|
9
17
|
before do
|
|
10
18
|
switch_to_host(organization.host)
|
|
@@ -17,10 +25,15 @@ shared_examples "participatory space members" do
|
|
|
17
25
|
end
|
|
18
26
|
|
|
19
27
|
context "when there are no members and accessing from the space homepage" do
|
|
28
|
+
before do
|
|
29
|
+
login_as allowed_visitor, scope: :user
|
|
30
|
+
end
|
|
31
|
+
|
|
20
32
|
context "and the main data content block is disabled" do
|
|
21
33
|
it "the menu nav is not shown" do
|
|
22
34
|
visit participatory_space_homepage_path
|
|
23
35
|
|
|
36
|
+
expect(page).to have_current_path participatory_space_homepage_path
|
|
24
37
|
expect(page).to have_no_css(".participatory-space__nav-container")
|
|
25
38
|
end
|
|
26
39
|
end
|
|
@@ -31,6 +44,7 @@ shared_examples "participatory space members" do
|
|
|
31
44
|
it "the menu link is not shown" do
|
|
32
45
|
visit participatory_space_homepage_path
|
|
33
46
|
|
|
47
|
+
expect(page).to have_current_path participatory_space_homepage_path
|
|
34
48
|
expect(page).to have_no_content("Members")
|
|
35
49
|
end
|
|
36
50
|
end
|
|
@@ -44,7 +58,7 @@ shared_examples "participatory space members" do
|
|
|
44
58
|
|
|
45
59
|
context "when there are some members and all are unpublished" do
|
|
46
60
|
before do
|
|
47
|
-
create(:
|
|
61
|
+
create(:participatory_space_private_user, user:, privatable_to: participatory_space, published: false)
|
|
48
62
|
end
|
|
49
63
|
|
|
50
64
|
context "and directly accessing from URL" do
|
|
@@ -54,10 +68,15 @@ shared_examples "participatory space members" do
|
|
|
54
68
|
end
|
|
55
69
|
|
|
56
70
|
context "and accessing from the homepage" do
|
|
71
|
+
before do
|
|
72
|
+
login_as allowed_visitor, scope: :user
|
|
73
|
+
end
|
|
74
|
+
|
|
57
75
|
context "and the main data content block is disabled" do
|
|
58
76
|
it "the menu nav is not shown" do
|
|
59
77
|
visit participatory_space_homepage_path
|
|
60
78
|
|
|
79
|
+
expect(page).to have_current_path participatory_space_homepage_path
|
|
61
80
|
expect(page).to have_no_css(".participatory-space__nav-container")
|
|
62
81
|
end
|
|
63
82
|
end
|
|
@@ -68,6 +87,7 @@ shared_examples "participatory space members" do
|
|
|
68
87
|
it "the menu link is not shown" do
|
|
69
88
|
visit participatory_space_homepage_path
|
|
70
89
|
|
|
90
|
+
expect(page).to have_current_path participatory_space_homepage_path
|
|
71
91
|
expect(page).to have_no_content("Members")
|
|
72
92
|
end
|
|
73
93
|
end
|
|
@@ -75,10 +95,11 @@ shared_examples "participatory space members" do
|
|
|
75
95
|
end
|
|
76
96
|
|
|
77
97
|
context "when there are some published members" do
|
|
78
|
-
let!(:member) { create(:
|
|
79
|
-
let!(:unpublished_member) { create(:
|
|
98
|
+
let!(:member) { create(:participatory_space_private_user, user:, privatable_to: participatory_space, published: true) }
|
|
99
|
+
let!(:unpublished_member) { create(:participatory_space_private_user, user: unpublished_user, privatable_to: participatory_space, published: false) }
|
|
80
100
|
|
|
81
101
|
before do
|
|
102
|
+
login_as(member.user, scope: :user) if login_as_member
|
|
82
103
|
visit members_path
|
|
83
104
|
end
|
|
84
105
|
|
|
@@ -107,9 +128,9 @@ shared_examples "participatory space members" do
|
|
|
107
128
|
end
|
|
108
129
|
|
|
109
130
|
it "lists all the members" do
|
|
110
|
-
within "
|
|
131
|
+
within "#assembly_members-grid" do
|
|
111
132
|
expect(page).to have_css(".profile__user", count: 1)
|
|
112
|
-
expect(page).to have_no_content(Decidim::
|
|
133
|
+
expect(page).to have_no_content(Decidim::ParticipatorySpacePrivateUserPresenter.new(unpublished_member).name)
|
|
113
134
|
end
|
|
114
135
|
|
|
115
136
|
click_on(member.name)
|
|
@@ -117,5 +138,63 @@ shared_examples "participatory space members" do
|
|
|
117
138
|
expect(page).to have_content("Profile")
|
|
118
139
|
end
|
|
119
140
|
end
|
|
141
|
+
|
|
142
|
+
context "when there are more members than the pagination per_page limit" do
|
|
143
|
+
let(:per_page) { Decidim::Paginable::OPTIONS.first }
|
|
144
|
+
let(:users) { create_list(:user, per_page + 5, organization: participatory_space.organization) }
|
|
145
|
+
let!(:extra_members) do
|
|
146
|
+
users.map do |user|
|
|
147
|
+
create(:participatory_space_private_user, privatable_to: participatory_space, user:, published: true)
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
before do
|
|
152
|
+
visit members_path
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
it "paginates the members list" do
|
|
156
|
+
within "#assembly_members-grid" do
|
|
157
|
+
expect(page).to have_css(".profile__user", count: per_page)
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
it "shows pagination controls" do
|
|
162
|
+
within("div[data-pagination]") do
|
|
163
|
+
expect(page).to have_css('nav[aria-label="Pagination"]')
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
it "navigates to the next page" do
|
|
168
|
+
within "nav[aria-label=\"Pagination\"]" do
|
|
169
|
+
click_on "Next"
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
within "#assembly_members-grid" do
|
|
173
|
+
expect(page).to have_css(".profile__user", count: 6)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
it "maintains pagination when navigating back" do
|
|
178
|
+
within "nav[aria-label=\"Pagination\"]" do
|
|
179
|
+
click_on "Next"
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
within "nav[aria-label=\"Pagination\"]" do
|
|
183
|
+
click_on "Prev"
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
within "#assembly_members-grid" do
|
|
187
|
+
expect(page).to have_css(".profile__user", count: per_page)
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
it "shows the correct page number in the URL" do
|
|
192
|
+
within "nav[aria-label=\"Pagination\"]" do
|
|
193
|
+
click_on "Next"
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
expect(page).to have_current_path(/page=2/)
|
|
197
|
+
end
|
|
198
|
+
end
|
|
120
199
|
end
|
|
121
200
|
end
|
|
@@ -30,7 +30,7 @@ shared_examples_for "resource liked event" do
|
|
|
30
30
|
|
|
31
31
|
describe "email_subject" do
|
|
32
32
|
it "is generated correctly" do
|
|
33
|
-
expect(subject.email_subject).to eq("#{author_presenter.
|
|
33
|
+
expect(subject.email_subject).to eq("#{author_presenter.name} has performed a new like")
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ shared_examples_for "resource liked event" do
|
|
|
38
38
|
let(:resource_title) { decidim_sanitize_translated(resource.title) }
|
|
39
39
|
it "is generated correctly" do
|
|
40
40
|
expect(subject.email_intro)
|
|
41
|
-
.to eq("#{author.name}
|
|
41
|
+
.to eq("#{author.name}, who you are following, " \
|
|
42
42
|
"has just liked \"#{resource_title}\" and we think it may be interesting to you. Check it out and contribute:")
|
|
43
43
|
end
|
|
44
44
|
end
|
|
@@ -51,7 +51,7 @@ shared_examples_for "resource liked event" do
|
|
|
51
51
|
.to include("The <a href=\"#{resource_path}\">#{resource_title}</a> #{resource_type} has been liked by ")
|
|
52
52
|
|
|
53
53
|
expect(subject.notification_title)
|
|
54
|
-
.to include("<a href=\"/profiles/#{author.nickname}\">#{author.name}
|
|
54
|
+
.to include("<a href=\"/profiles/#{author.nickname}\">#{author.name}</a>.")
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
@@ -28,7 +28,7 @@ shared_examples "a version of a hidden object" do
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
shared_context "versions controller resource" do
|
|
32
32
|
let(:base_params) do
|
|
33
33
|
if resource.is_a?(Decidim::Participable)
|
|
34
34
|
{ :"#{resource.model_name.singular_route_key}_slug" => resource.slug }
|
|
@@ -45,6 +45,10 @@ shared_examples "versions controller" do
|
|
|
45
45
|
request.env["decidim.current_component"] = resource.component
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
shared_examples "versions controller" do
|
|
51
|
+
include_context "versions controller resource"
|
|
48
52
|
|
|
49
53
|
describe "GET show" do
|
|
50
54
|
context "with an existing version" do
|
|
@@ -64,3 +68,21 @@ shared_examples "versions controller" do
|
|
|
64
68
|
end
|
|
65
69
|
end
|
|
66
70
|
end
|
|
71
|
+
|
|
72
|
+
# The versions of a resource must be readable with the same `:read` permission
|
|
73
|
+
# as the resource itself. This ensures that a resource that is hidden, private,
|
|
74
|
+
# deleted or unpublished cannot be reached through its versions.
|
|
75
|
+
#
|
|
76
|
+
# Requires a `resource` that is not readable through its public `:read`
|
|
77
|
+
# permission.
|
|
78
|
+
shared_examples "versions controller denying unreadable resources" do
|
|
79
|
+
include_context "versions controller resource"
|
|
80
|
+
|
|
81
|
+
it "does not expose the versions" do
|
|
82
|
+
get :show, params: base_params.merge(id: 1)
|
|
83
|
+
|
|
84
|
+
expect(response).not_to have_http_status(:ok)
|
|
85
|
+
rescue ActiveRecord::RecordNotFound
|
|
86
|
+
# The resource is filtered out before the permission is evaluated.
|
|
87
|
+
end
|
|
88
|
+
end
|