decidim-core 0.28.1 → 0.28.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/announcement/show.erb +2 -2
  3. data/app/cells/decidim/author/show.erb +5 -5
  4. data/app/cells/decidim/card/show.erb +1 -1
  5. data/app/cells/decidim/card_metadata/show.erb +2 -2
  6. data/app/cells/decidim/data_consent/category.erb +1 -1
  7. data/app/cells/decidim/nav_links/show.erb +2 -2
  8. data/app/cells/decidim/notification/moderated.erb +12 -0
  9. data/app/cells/decidim/notification_cell.rb +5 -1
  10. data/app/cells/decidim/profile/details.erb +1 -1
  11. data/app/cells/decidim/progress_bar/show.erb +1 -1
  12. data/app/cells/decidim/progress_bar_cell.rb +2 -0
  13. data/app/cells/decidim/report_button/flag_modal.erb +5 -1
  14. data/app/cells/decidim/resource_types_filter/show.erb +3 -3
  15. data/app/cells/decidim/statistic/show.erb +2 -2
  16. data/app/cells/decidim/upload_modal/modal.erb +3 -4
  17. data/app/controllers/concerns/decidim/force_authentication.rb +1 -1
  18. data/app/controllers/concerns/decidim/use_organization_time_zone.rb +1 -1
  19. data/app/controllers/decidim/gamification/badges_controller.rb +2 -0
  20. data/app/controllers/decidim/links_controller.rb +15 -2
  21. data/app/helpers/concerns/decidim/flash_helper_extensions.rb +2 -2
  22. data/app/helpers/decidim/check_boxes_tree_helper.rb +1 -2
  23. data/app/mailers/decidim/application_mailer.rb +40 -6
  24. data/app/packs/src/decidim/a11y.js +14 -0
  25. data/app/packs/src/decidim/abide_form_validator_fixer.js +44 -0
  26. data/app/packs/src/decidim/direct_uploads/upload_modal.js +2 -6
  27. data/app/packs/src/decidim/index.js +29 -1
  28. data/app/packs/stylesheets/decidim/_accordion.scss +2 -2
  29. data/app/packs/stylesheets/decidim/_cards.scss +2 -2
  30. data/app/packs/stylesheets/decidim/_layout.scss +3 -3
  31. data/app/packs/stylesheets/decidim/_modal_update.scss +1 -3
  32. data/app/presenters/decidim/admin_log/organization_presenter.rb +1 -1
  33. data/app/presenters/decidim/log/resource_presenter.rb +7 -1
  34. data/app/services/decidim/log/diff_changeset_calculator.rb +1 -1
  35. data/app/views/decidim/account/show.html.erb +2 -2
  36. data/app/views/decidim/application/_document.html.erb +2 -2
  37. data/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +2 -1
  38. data/app/views/decidim/gamification/badges/index.html.erb +34 -33
  39. data/app/views/decidim/links/_modal.html.erb +1 -1
  40. data/app/views/decidim/links/new.html.erb +3 -1
  41. data/app/views/decidim/manifests/show.json.erb +1 -1
  42. data/app/views/decidim/messaging/conversations/create.js.erb +1 -1
  43. data/app/views/decidim/notifications_settings/show.html.erb +6 -6
  44. data/app/views/decidim/pages/_tabbed.html.erb +2 -2
  45. data/app/views/decidim/searches/_filters.html.erb +2 -2
  46. data/app/views/decidim/shared/_filters.html.erb +2 -2
  47. data/app/views/decidim/shared/_orders.html.erb +2 -2
  48. data/app/views/decidim/shared/filters/_collection.html.erb +5 -3
  49. data/app/views/decidim/shared/filters/_dropdown_label.html.erb +21 -19
  50. data/app/views/layouts/decidim/_wrapper.html.erb +1 -1
  51. data/app/views/layouts/decidim/footer/_main_links.html.erb +3 -1
  52. data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +4 -2
  53. data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +2 -0
  54. data/app/views/layouts/decidim/shared/_layout_user_profile.html.erb +2 -2
  55. data/config/locales/ar.yml +1 -5
  56. data/config/locales/bg.yml +878 -1
  57. data/config/locales/ca.yml +2 -0
  58. data/config/locales/cs.yml +1 -1
  59. data/config/locales/de.yml +3 -1
  60. data/config/locales/el.yml +8 -1
  61. data/config/locales/en.yml +3 -1
  62. data/config/locales/es-MX.yml +8 -6
  63. data/config/locales/es-PY.yml +8 -6
  64. data/config/locales/es.yml +32 -30
  65. data/config/locales/eu.yml +4 -2
  66. data/config/locales/fi-plain.yml +3 -1
  67. data/config/locales/fi.yml +4 -2
  68. data/config/locales/fr-CA.yml +2 -0
  69. data/config/locales/fr.yml +2 -0
  70. data/config/locales/ga-IE.yml +8 -0
  71. data/config/locales/gl.yml +1 -0
  72. data/config/locales/hu.yml +1 -2
  73. data/config/locales/it.yml +7 -1
  74. data/config/locales/ja.yml +3 -1
  75. data/config/locales/kaa.yml +5 -0
  76. data/config/locales/lb.yml +7 -1
  77. data/config/locales/lt.yml +8 -2
  78. data/config/locales/lv.yml +8 -1
  79. data/config/locales/nl.yml +7 -1
  80. data/config/locales/no.yml +7 -1
  81. data/config/locales/pl.yml +35 -0
  82. data/config/locales/pt-BR.yml +0 -1
  83. data/config/locales/pt.yml +7 -1
  84. data/config/locales/ro-RO.yml +8 -0
  85. data/config/locales/ru.yml +8 -0
  86. data/config/locales/sk.yml +8 -1
  87. data/config/locales/sl.yml +8 -0
  88. data/config/locales/sv.yml +8 -1
  89. data/config/locales/tr-TR.yml +21 -4
  90. data/config/locales/uk.yml +10 -0
  91. data/config/locales/zh-CN.yml +0 -1
  92. data/config/locales/zh-TW.yml +8 -1
  93. data/lib/decidim/core/seeds.rb +1 -1
  94. data/lib/decidim/core/test/shared_examples/comments_examples.rb +76 -6
  95. data/lib/decidim/core/test/shared_examples/logo_email.rb +2 -2
  96. data/lib/decidim/core/version.rb +1 -1
  97. data/lib/decidim/core.rb +6 -1
  98. data/lib/decidim/events/base_event.rb +4 -0
  99. data/lib/decidim/organization_settings.rb +10 -2
  100. metadata +12 -10
@@ -283,7 +283,6 @@ sv:
283
283
  '1': Skapa ändringsförslag
284
284
  '2': Jämför ändringsförslag
285
285
  '3': Slutför ändringsförslaget
286
- '4': Publicera ändringsförslaget
287
286
  anonymous_user: Anonym
288
287
  application:
289
288
  document:
@@ -488,6 +487,7 @@ sv:
488
487
  registrations:
489
488
  new:
490
489
  already_have_an_account?: Har du redan ett konto?
490
+ log_in: Logga in
491
491
  newsletter: Få enstaka nyhetsbrev med relevant information
492
492
  newsletter_title: Kontakttillstånd
493
493
  sign_up: Registrera dig
@@ -756,6 +756,7 @@ sv:
756
756
  filename: Filnamn
757
757
  remove: Ta bort
758
758
  replace: Ersätt
759
+ save: Spara
759
760
  title: Titel
760
761
  title_required: Titel krävs!
761
762
  uploaded: Uppladdad
@@ -1369,10 +1370,14 @@ sv:
1369
1370
  signed_up_but_unconfirmed: Ett meddelande med en bekräftelselänk har skickats till din e-postadress. Aktivera kontot genom att följa länken.
1370
1371
  update_needs_confirmation: Kontot har uppdaterats, men vi måste verifiera din nya e-postadress. Kontrollera din e-post och följ länken som bekräftar din nya e-postadress.
1371
1372
  updated: Ditt konto har uppdaterats.
1373
+ sessions:
1374
+ new:
1375
+ log_in: Logga in
1372
1376
  shared:
1373
1377
  links:
1374
1378
  back: Tillbaka
1375
1379
  forgot_your_password: Glömt ditt lösenord?
1380
+ log_in: Logga in
1376
1381
  sign_up: Registrera dig
1377
1382
  minimum_password_length:
1378
1383
  one: "(minst %{count} tecken)"
@@ -1524,10 +1529,12 @@ sv:
1524
1529
  decidim_logo: Decidim logotyp
1525
1530
  decidim_title: Decidim
1526
1531
  download_open_data: Hämta öppna datafiler
1532
+ log_in: Logga in
1527
1533
  made_with_open_source: Webbplats skapad med <a target="_blank" href="https://github.com/decidim/decidim">fri programvara</a>.
1528
1534
  resources: Resurser
1529
1535
  sign_up: Registrera
1530
1536
  header:
1537
+ log_in: Logga in
1531
1538
  main_menu: Huvudmeny
1532
1539
  user_menu: Användarmeny
1533
1540
  impersonation_warning:
@@ -71,6 +71,7 @@ tr:
71
71
  accessibility:
72
72
  external_link: Dış bağlantı
73
73
  logo: "%{organization} resmi logosu"
74
+ opens_in_new_tab: Yeni Seçmede Aç
74
75
  skip_button: Ana içeriğe geç
75
76
  account:
76
77
  delete:
@@ -416,6 +417,7 @@ tr:
416
417
  hide_password: Şifrenizi Gizleyin
417
418
  show_password: Şifreyi Göster
418
419
  shown_password: Şifreniz Gösteriliyor
420
+ placeholder_email: selam@example.org
419
421
  doorkeeper:
420
422
  authorizations:
421
423
  new:
@@ -746,6 +748,7 @@ tr:
746
748
  admin_in_group: Bunu, %{group} grubunun yöneticisi olduğunuz için alıyorsunuz.
747
749
  greeting: Merhaba, %{recipient}!
748
750
  intro: "%{manager}, %{group} adına yeni bir görüşme başlattı. Görmek için buraya tıklayın:"
751
+ outro: Platformun tadını çıkarın!
749
752
  subject: "%{manager}, %{group} olarak yeni bir görüşme başlattı"
750
753
  comanagers_new_message:
751
754
  admin_in_group: Bunu, %{group} grubunun yöneticisi olduğunuz için alıyorsunuz.
@@ -755,20 +758,24 @@ tr:
755
758
  new_conversation:
756
759
  greeting: Merhaba %{recipient}!
757
760
  intro: "%{sender} sizinle yeni bir sohbet başlattı. Görmek için buraya tıklayın:"
761
+ outro: Platformun tadını çıkarın!
758
762
  subject: "%{sender} sizinle bir konuşma başlattı"
759
763
  new_group_conversation:
760
764
  admin_in_group: Bunu, %{group} grubunun yöneticisi olduğunuz için alıyorsunuz.
761
765
  greeting: Merhaba, %{recipient}!
762
766
  intro: "%{sender}, %{group} adına yeni bir görüşme başlattı. Görmek için buraya tıklayın:"
767
+ outro: Platformun tadını çıkarın!
763
768
  subject: "%{sender}, %{group} olarak yeni bir görüşme başlattı"
764
769
  new_group_message:
765
770
  admin_in_group: Bunu, %{group} grubunun yöneticisi olduğunuz için alıyorsunuz.
766
771
  greeting: Merhaba, %{recipient}!
767
772
  intro: "%{sender}, %{group} grubuyla bir görüşmede yeni mesajlar yayınladı. Görmek için buraya tıklayın:"
773
+ outro: Platformun tadını çıkarın!
768
774
  subject: "%{group}, %{sender} adlı kişiden yeni mesajlar aldı"
769
775
  new_message:
770
776
  greeting: Merhaba %{recipient}!
771
777
  intro: "%{sender}, konuşmanıza yeni mesajlar gönderdi. Görmek için buraya tıklayın:"
778
+ outro: Platformun tadını çıkarın!
772
779
  subject: '%{sender}, size yeni mesaj gönderdi'
773
780
  conversations:
774
781
  add_conversation_users:
@@ -844,6 +851,8 @@ tr:
844
851
  subject: '%{organization_name} ile ilgili bilgileri almaya devam etmek istiyor musunuz?'
845
852
  notifications:
846
853
  no_notifications: Henüz bildirim yok.
854
+ show:
855
+ moderated: İçerik Denetlendi
847
856
  notifications_settings:
848
857
  show:
849
858
  direct_messages: Herkesten doğrudan mesaj alın
@@ -1019,6 +1028,7 @@ tr:
1019
1028
  filters:
1020
1029
  areas: alanlar
1021
1030
  select_an_area: Bir bölge seçin
1031
+ progress: "Süreç\nİlerleme"
1022
1032
  reference:
1023
1033
  reference: 'Referans: %{reference}'
1024
1034
  represent_user_group:
@@ -1182,13 +1192,13 @@ tr:
1182
1192
  sessions:
1183
1193
  already_signed_out: Başarıyla Çıkış Yapıldı
1184
1194
  new:
1185
- log_in: Giriş Yapın
1195
+ log_in: "Giriş \nGiriş Yapın "
1186
1196
  signed_out:
1187
1197
  shared:
1188
1198
  links:
1189
1199
  back: Geri
1190
1200
  forgot_your_password: Parolanızı mı unuttunuz?
1191
- log_in: Giriş Yapın
1201
+ log_in: "Giriş \nGiriş Yapın "
1192
1202
  log_in_with_provider: '%{provider} ile giriş yapın'
1193
1203
  sign_up: kaydol
1194
1204
  minimum_password_length:
@@ -1229,6 +1239,8 @@ tr:
1229
1239
  timestamp_error_message: Üzgünüm, bu çok hızlıydı! Lütfen yeniden gönderin.
1230
1240
  layouts:
1231
1241
  decidim:
1242
+ announcements:
1243
+ view_less: Daha Az Göster
1232
1244
  data_consent:
1233
1245
  details:
1234
1246
  columns:
@@ -1239,11 +1251,11 @@ tr:
1239
1251
  cc_by_license: Kar Amaçsız Lisanslama (Creative Commons License)
1240
1252
  decidim_logo: Decidim Logo
1241
1253
  download_open_data: Açık Veri dosyalarını indir
1242
- log_in: Giriş Yapın
1254
+ log_in: "Giriş \nGiriş Yapın "
1243
1255
  made_with_open_source: Web sitesi <a target="_blank" href="https://github.com/decidim/decidim">ücretsiz yazılımla yapılmıştır</a>.
1244
1256
  sign_up: Kaydol
1245
1257
  header:
1246
- log_in: Giriş Yapın
1258
+ log_in: "Giriş \nGiriş Yapın "
1247
1259
  impersonation_warning:
1248
1260
  close_session: Oturumu kapat
1249
1261
  description_html: Kullanıcının kimliğine bürünüyorsunuz <b>%{user_name}</b>.
@@ -1253,6 +1265,9 @@ tr:
1253
1265
  notifications_dashboard:
1254
1266
  mark_all_as_read: Tümünü okundu olarak işaretle
1255
1267
  mark_as_read: Okundu olarak işaretle
1268
+ shared:
1269
+ layout_item:
1270
+ prev: Önceki
1256
1271
  social_media_links:
1257
1272
  facebook: "Facebook'ta %{organization}"
1258
1273
  github: "GitHub'da %{organization}"
@@ -1332,6 +1347,7 @@ tr:
1332
1347
  long_dashed: "%Y-%m-%d %H:%M:%S"
1333
1348
  short: "%d/%m/%Y %H:%M"
1334
1349
  time_of_day: "%H:%M"
1350
+ tooltip: "%d-%m-%Y %H:%M %p %Z (GMT %:z)\n%Gün-%Ay-%Yıl %Saat:%Dakika %p %Zone (GMT %:z)"
1335
1351
  versions:
1336
1352
  directions:
1337
1353
  left: Silme
@@ -1343,6 +1359,7 @@ tr:
1343
1359
  option_split: Yan yana
1344
1360
  option_unescaped: Yakalandı
1345
1361
  option_unified: Birleşik
1362
+ toggle: Görünümü değiştir
1346
1363
  views:
1347
1364
  pagination:
1348
1365
  next_title: Sonraki sayfaya git
@@ -201,6 +201,7 @@ uk:
201
201
  registrations:
202
202
  new:
203
203
  already_have_an_account?: Вже маєте обліковий запис?
204
+ log_in: Увійти
204
205
  newsletter: Отримувати іноді розсилання зі свіжими новинами
205
206
  newsletter_title: Дозвіл на зв'язок
206
207
  sign_up: Зареєструватися
@@ -476,6 +477,12 @@ uk:
476
477
  passwords:
477
478
  edit:
478
479
  new_password: Пароль
480
+ sessions:
481
+ new:
482
+ log_in: Увійти
483
+ shared:
484
+ links:
485
+ log_in: Увійти
479
486
  doorkeeper:
480
487
  scopes:
481
488
  public: Оприлюднені відомості про вас.
@@ -493,8 +500,11 @@ uk:
493
500
  edit_link:
494
501
  edit: Редагувати
495
502
  footer:
503
+ log_in: Увійти
496
504
  made_with_open_source: Цей веб-сайт створено за допомогою <a target="_blank" href="https://github.com/decidim/decidim">безкоштовного програмного забезпечення</a>.
497
505
  sign_up: Зареєструватися
506
+ header:
507
+ log_in: Увійти
498
508
  impersonation_warning:
499
509
  close_session: Завершити сеанс
500
510
  description_html: Ви виступаєте в ролі учасника <b>%{user_name}</b>.
@@ -192,7 +192,6 @@ zh-CN:
192
192
  '1': 创建您的修改
193
193
  '2': 比较您的修改
194
194
  '3': 完成您的修改
195
- '4': 发布您的修改
196
195
  anonymous_user: 匿名的
197
196
  application:
198
197
  document:
@@ -315,7 +315,6 @@ zh-TW:
315
315
  '1': 創建您的修正案
316
316
  '2': 比較您的修正案
317
317
  '3': 完成您的修正案
318
- '4': 發佈您的修正案
319
318
  anonymous_user: 匿名
320
319
  application:
321
320
  document:
@@ -514,6 +513,7 @@ zh-TW:
514
513
  registrations:
515
514
  new:
516
515
  already_have_an_account?: 已經有帳號了嗎?
516
+ log_in: 登入
517
517
  newsletter: 偶爾收到包含相關信息的時事通訊。
518
518
  newsletter_title: 聯絡人權限
519
519
  sign_up: 註冊登記
@@ -819,6 +819,7 @@ zh-TW:
819
819
  filename: 檔案名稱
820
820
  remove: 移除
821
821
  replace: 替換
822
+ save: 儲存
822
823
  title: 標題
823
824
  title_required: 標題為必填欄位!
824
825
  uploaded: 已上傳
@@ -1565,12 +1566,16 @@ zh-TW:
1565
1566
  signed_up_but_unconfirmed: 確認信件已送至您的 Email 信箱,請點擊信件內連結以啓動您的帳號。
1566
1567
  update_needs_confirmation: 您已經成功的更新帳號資訊,但我們仍需確認您的電子信箱,請至新信箱收信並點擊連結以確認您的新電子郵件帳號。
1567
1568
  updated: 您的帳號已成功升級。
1569
+ sessions:
1570
+ new:
1571
+ log_in: 登入
1568
1572
  shared:
1569
1573
  links:
1570
1574
  back: 返回
1571
1575
  didn_t_receive_confirmation_instructions: 沒有收到確認的說明嗎?
1572
1576
  didn_t_receive_unlock_instructions: 沒有收到解鎖說明?
1573
1577
  forgot_your_password: 忘記密碼了嗎?
1578
+ log_in: 登入
1574
1579
  sign_up: 註冊登記
1575
1580
  minimum_password_length:
1576
1581
  other: "One\n(最少%{count} 個字符)\n\nOther\n(最少%{count} 個字符)"
@@ -1695,9 +1700,11 @@ zh-TW:
1695
1700
  data_consent_settings: Cookie 設定
1696
1701
  decidim_logo: Decidim 商標
1697
1702
  download_open_data: 下載開放數據檔案
1703
+ log_in: 登入
1698
1704
  made_with_open_source: 使用<a target="_blank" href="https://github.com/decidim/decidim">自由軟體</a>建立的網站。
1699
1705
  sign_up: 註冊
1700
1706
  header:
1707
+ log_in: 登入
1701
1708
  main_menu: 主選單
1702
1709
  user_menu: 使用者選單
1703
1710
  impersonation_warning:
@@ -209,7 +209,7 @@ module Decidim
209
209
 
210
210
  oauth_application.organization_logo.attach(io: File.open(File.join(seeds_root, "homepage_image.jpg")), filename: "organization_logo.jpg", content_type: "image/jpeg")
211
211
 
212
- Decidim::System::CreateDefaultContentBlocks.call(organization)
212
+ Decidim::ContentBlocksCreator.new(organization).create_default!
213
213
 
214
214
  hero_content_block = Decidim::ContentBlock.find_by(organization:, manifest_name: :hero, scope_name: :homepage)
215
215
  hero_content_block.images_container.background_image = create_blob!(seeds_file: "homepage_image.jpg", filename: "homepage_image.jpg", content_type: "image/jpeg")
@@ -54,7 +54,7 @@ shared_examples "comments" do
54
54
  expect(page).to have_css(".comment", minimum: 1)
55
55
 
56
56
  within("#accordion-#{single_comment.id}") do
57
- expect(page).to have_content "Hide replies"
57
+ expect(page).to have_content "Hide reply"
58
58
  end
59
59
  end
60
60
 
@@ -70,7 +70,7 @@ shared_examples "comments" do
70
70
  expect(page).to have_css(".comment", minimum: 1)
71
71
 
72
72
  within("#accordion-#{single_comment.id}") do
73
- expect(page).not_to have_content "Hide replies"
73
+ expect(page).not_to have_content "Hide reply"
74
74
  end
75
75
  end
76
76
  end
@@ -117,7 +117,8 @@ shared_examples "comments" do
117
117
  context "when not authenticated" do
118
118
  it "does not show form to add comments to user" do
119
119
  visit resource_path
120
- expect(page).not_to have_selector(".add-comment form")
120
+ expect(page).not_to have_css(".add-comment form")
121
+ expect(page).to have_css(".comment-thread")
121
122
  end
122
123
  end
123
124
 
@@ -131,6 +132,32 @@ shared_examples "comments" do
131
132
  expect(page).to have_selector(".add-comment form")
132
133
  end
133
134
 
135
+ context "when user is not authorized to comment" do
136
+ let(:permissions) do
137
+ {
138
+ comment: {
139
+ authorization_handlers: {
140
+ "dummy_authorization_handler" => { "options" => {} }
141
+ }
142
+ }
143
+ }
144
+ end
145
+
146
+ before do
147
+ organization.available_authorizations = ["dummy_authorization_handler"]
148
+ organization.save!
149
+ commentable.create_resource_permission(permissions:)
150
+ allow(commentable).to receive(:user_allowed_to_comment?).with(user).and_return(false)
151
+ allow(commentable).to receive(:user_authorized_to_comment?).with(user).and_return(true)
152
+ end
153
+
154
+ it "shows a message indicating that comments are restricted" do
155
+ visit resource_path
156
+ expect(page).not_to have_content("Comments are disabled at this time")
157
+ expect(page).to have_content("You need to be verified to comment at this moment")
158
+ end
159
+ end
160
+
134
161
  describe "when using emojis" do
135
162
  before do
136
163
  within_language_menu do
@@ -520,7 +547,7 @@ shared_examples "comments" do
520
547
  it "displays the hide button" do
521
548
  visit current_path
522
549
  within "#comment_#{thread.id}" do
523
- expect(page).to have_content("Hide replies")
550
+ expect(page).to have_content("Hide reply")
524
551
  expect(page).to have_content(new_reply_body)
525
552
  end
526
553
  end
@@ -528,7 +555,7 @@ shared_examples "comments" do
528
555
  it "displays the show button" do
529
556
  visit current_path
530
557
  within "#comment_#{thread.id}" do
531
- click_button "Hide replies"
558
+ click_button "Hide reply"
532
559
  expect(page).to have_content("Show reply")
533
560
  expect(page).not_to have_content(new_reply_body)
534
561
  end
@@ -540,7 +567,7 @@ shared_examples "comments" do
540
567
  it "displays the show button" do
541
568
  visit current_path
542
569
  within "#comment_#{thread.id}" do
543
- click_button "Hide replies"
570
+ click_button "Hide 3 replies"
544
571
  expect(page).to have_content("Show 3 replies")
545
572
  expect(page).not_to have_content(new_reply_body)
546
573
  end
@@ -969,3 +996,46 @@ shared_examples "comments" do
969
996
  end
970
997
  end
971
998
  end
999
+
1000
+ shared_examples "comments blocked" do
1001
+ context "when not authenticated" do
1002
+ context "when comments are blocked" do
1003
+ let(:active_step_id) { component.participatory_space.active_step.id }
1004
+
1005
+ before do
1006
+ component.update!(step_settings: { active_step_id => { comments_blocked: true } })
1007
+ end
1008
+
1009
+ it "shows a message indicating that comments are disabled" do
1010
+ visit resource_path
1011
+ expect(page).to have_content("Comments are disabled at this time")
1012
+ expect(page).not_to have_content("You need to be verified to comment at this moment")
1013
+ end
1014
+ end
1015
+ end
1016
+
1017
+ context "when authenticated" do
1018
+ let!(:organization) { create(:organization) }
1019
+ let!(:user) { create(:user, :confirmed, organization:) }
1020
+ let!(:comments) { create_list(:comment, 3, commentable:) }
1021
+
1022
+ before do
1023
+ login_as user, scope: :user
1024
+ visit resource_path
1025
+ end
1026
+
1027
+ context "when comments are blocked" do
1028
+ let(:active_step_id) { component.participatory_space.active_step.id }
1029
+
1030
+ before do
1031
+ component.update!(step_settings: { active_step_id => { comments_blocked: true } })
1032
+ end
1033
+
1034
+ it "shows a message indicating that comments are disabled" do
1035
+ visit resource_path
1036
+ expect(page).to have_content("Comments are disabled at this time")
1037
+ expect(page).not_to have_content("You need to be verified to comment at this moment")
1038
+ end
1039
+ end
1040
+ end
1041
+ end
@@ -5,7 +5,7 @@ require "spec_helper"
5
5
  shared_examples "email with logo" do
6
6
  context "when organization has a logo" do
7
7
  let(:organization_logo) { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
8
- let(:organization) { create(:organization, logo: organization_logo) }
8
+ let(:organization) { create(:organization, name: "O'Higgins", logo: organization_logo) }
9
9
  let(:mail) { described_class.event_received(event, event_class_name, resource, user, :follower, extra) }
10
10
  let(:logo_path) { Rails.application.routes.url_helpers.rails_representation_path(organization.logo.variant(resize_to_fit: [600, 160]), only_path: true) }
11
11
 
@@ -14,7 +14,7 @@ shared_examples "email with logo" do
14
14
  end
15
15
 
16
16
  it "includes organization logo with full link" do
17
- expect(mail.body).to include("alt=\"#{organization.name}\"")
17
+ expect(mail.body).to include("alt=\"#{decidim_escape_translated(organization.name)}\"")
18
18
  expect(mail.body).to match(%r{https{0,1}://#{organization.host}:#{Capybara.server_port}#{logo_path}})
19
19
  end
20
20
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-core version.
5
5
  module Core
6
6
  def self.version
7
- "0.28.1"
7
+ "0.28.2"
8
8
  end
9
9
  end
10
10
  end
data/lib/decidim/core.rb CHANGED
@@ -191,8 +191,13 @@ module Decidim
191
191
  resource_type.constantize.find_each do |resource|
192
192
  # exclude the users that already endorsed
193
193
  users = resource.endorsements.map(&:author)
194
- rand(50).times do
194
+ remaining_count = Decidim::User.count - users.count
195
+ next if remaining_count < 1
196
+
197
+ rand([50, remaining_count].min).times do
195
198
  user = (Decidim::User.all - users).sample
199
+ next unless user
200
+
196
201
  Decidim::Endorsement.create!(resource:, author: user)
197
202
  users << user
198
203
  end
@@ -111,6 +111,10 @@ module Decidim
111
111
  Decidim::ContentProcessor.render_without_format(title, links: false).html_safe
112
112
  end
113
113
 
114
+ def hidden_resource?
115
+ resource.respond_to?(:hidden?) && resource.hidden?
116
+ end
117
+
114
118
  private
115
119
 
116
120
  def component
@@ -129,12 +129,20 @@ module Decidim
129
129
  )
130
130
  },
131
131
  "maximum_file_size" => {
132
- "default" => 10.0,
133
- "avatar" => 5.0
132
+ "default" => default_maximum_attachment_size,
133
+ "avatar" => default_maximum_avatar_size
134
134
  }
135
135
  }
136
136
  }
137
137
  end
138
+
139
+ def default_maximum_attachment_size
140
+ (Rails.application.secrets.decidim[:maximum_attachment_size].presence || 10).to_f
141
+ end
142
+
143
+ def default_maximum_avatar_size
144
+ (Rails.application.secrets.decidim[:maximum_avatar_size].presence || 5).to_f
145
+ end
138
146
  end
139
147
 
140
148
  def initialize(organization)
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.1
4
+ version: 0.28.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
8
8
  - Marc Riera Casals
9
9
  - Oriol Gual Oliva
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-04-30 00:00:00.000000000 Z
13
+ date: 2024-07-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_link_to
@@ -764,28 +764,28 @@ dependencies:
764
764
  requirements:
765
765
  - - '='
766
766
  - !ruby/object:Gem::Version
767
- version: 0.28.1
767
+ version: 0.28.2
768
768
  type: :development
769
769
  prerelease: false
770
770
  version_requirements: !ruby/object:Gem::Requirement
771
771
  requirements:
772
772
  - - '='
773
773
  - !ruby/object:Gem::Version
774
- version: 0.28.1
774
+ version: 0.28.2
775
775
  - !ruby/object:Gem::Dependency
776
776
  name: decidim-dev
777
777
  requirement: !ruby/object:Gem::Requirement
778
778
  requirements:
779
779
  - - '='
780
780
  - !ruby/object:Gem::Version
781
- version: 0.28.1
781
+ version: 0.28.2
782
782
  type: :development
783
783
  prerelease: false
784
784
  version_requirements: !ruby/object:Gem::Requirement
785
785
  requirements:
786
786
  - - '='
787
787
  - !ruby/object:Gem::Version
788
- version: 0.28.1
788
+ version: 0.28.2
789
789
  description: Adds core features so other engines can hook into the framework.
790
790
  email:
791
791
  - josepjaume@gmail.com
@@ -1023,6 +1023,7 @@ files:
1023
1023
  - app/cells/decidim/newsletter_templates/image_text_cta_cell.rb
1024
1024
  - app/cells/decidim/newsletter_templates/image_text_cta_settings_form/show.erb
1025
1025
  - app/cells/decidim/newsletter_templates/image_text_cta_settings_form_cell.rb
1026
+ - app/cells/decidim/notification/moderated.erb
1026
1027
  - app/cells/decidim/notification/show.erb
1027
1028
  - app/cells/decidim/notification_cell.rb
1028
1029
  - app/cells/decidim/notifications/show.erb
@@ -1538,6 +1539,7 @@ files:
1538
1539
  - app/packs/images/decidim/vendor/social-share-button/x.svg
1539
1540
  - app/packs/images/decidim/vendor/social-share-button/xing.svg
1540
1541
  - app/packs/src/decidim/a11y.js
1542
+ - app/packs/src/decidim/abide_form_validator_fixer.js
1541
1543
  - app/packs/src/decidim/account_form.js
1542
1544
  - app/packs/src/decidim/append_elements.js
1543
1545
  - app/packs/src/decidim/append_redirect_url_to_modals.js
@@ -2868,7 +2870,7 @@ metadata:
2868
2870
  funding_uri: https://opencollective.com/decidim
2869
2871
  homepage_uri: https://decidim.org
2870
2872
  source_code_uri: https://github.com/decidim/decidim
2871
- post_install_message:
2873
+ post_install_message:
2872
2874
  rdoc_options: []
2873
2875
  require_paths:
2874
2876
  - lib
@@ -2883,8 +2885,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2883
2885
  - !ruby/object:Gem::Version
2884
2886
  version: '0'
2885
2887
  requirements: []
2886
- rubygems_version: 3.5.9
2887
- signing_key:
2888
+ rubygems_version: 3.3.7
2889
+ signing_key:
2888
2890
  specification_version: 4
2889
2891
  summary: The core of the Decidim framework.
2890
2892
  test_files: []