decidim-core 0.26.2 → 0.26.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/cells/decidim/content_blocks/cta/show.erb +1 -1
- data/app/cells/decidim/content_blocks/hero/show.erb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +1 -1
- data/app/cells/decidim/content_blocks/stats_cell.rb +1 -0
- data/app/controllers/concerns/decidim/resource_versions_concern.rb +4 -0
- data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
- data/app/events/decidim/resource_endorsed_event.rb +2 -1
- data/app/forms/decidim/account_form.rb +5 -4
- data/app/forms/decidim/registration_form.rb +8 -2
- data/app/helpers/decidim/filters_helper.rb +5 -1
- data/app/models/decidim/action_log.rb +9 -9
- data/app/models/decidim/user_base_entity.rb +1 -0
- data/app/packs/src/decidim/map/factory.js +3 -1
- data/app/packs/src/decidim/map/legacy.js +2 -2
- data/app/packs/src/decidim/map.js +2 -2
- data/app/packs/stylesheets/decidim/modules/_cards.scss +2 -0
- data/app/packs/stylesheets/decidim/modules/_comments.scss +2 -0
- data/app/packs/stylesheets/decidim/modules/_forms.scss +5 -0
- data/app/permissions/decidim/permissions.rb +4 -2
- data/app/presenters/decidim/user_presenter.rb +4 -1
- data/app/views/decidim/data_portability/show.html.erb +1 -1
- data/app/views/decidim/notifications_settings/show.html.erb +49 -51
- data/app/views/decidim/user_interests/show.html.erb +11 -13
- data/config/locales/ar.yml +0 -2
- data/config/locales/bg.yml +1 -1
- data/config/locales/ca.yml +4 -4
- data/config/locales/cs.yml +10 -10
- data/config/locales/de.yml +64 -3
- data/config/locales/es-MX.yml +3 -3
- data/config/locales/es-PY.yml +3 -3
- data/config/locales/es.yml +5 -5
- data/config/locales/eu.yml +4 -4
- data/config/locales/fr-CA.yml +2 -2
- data/config/locales/fr.yml +10 -10
- data/config/locales/ga-IE.yml +1 -1
- data/config/locales/gl.yml +0 -2
- data/config/locales/hu.yml +173 -1
- data/config/locales/id-ID.yml +0 -2
- data/config/locales/is-IS.yml +2 -1
- data/config/locales/it.yml +3 -3
- data/config/locales/ja.yml +2 -2
- data/config/locales/lb.yml +2 -2
- data/config/locales/lt.yml +1802 -0
- data/config/locales/nl.yml +3 -3
- data/config/locales/no.yml +1 -1
- data/config/locales/oc-FR.yml +1 -0
- data/config/locales/pl.yml +51 -2
- data/config/locales/pt-BR.yml +3 -3
- data/config/locales/pt.yml +2 -2
- data/config/locales/ro-RO.yml +1 -1
- data/config/locales/ru.yml +2 -3
- data/config/locales/sk.yml +1 -4
- data/config/locales/sv.yml +2 -1
- data/config/locales/tr-TR.yml +2 -2
- data/config/locales/uk.yml +1 -2
- data/config/locales/zh-CN.yml +2 -2
- data/lib/decidim/content_parsers/hashtag_parser.rb +1 -1
- data/lib/decidim/core/engine.rb +1 -1
- data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +60 -0
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +40 -0
- data/lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb +1 -1
- data/lib/decidim/core/test.rb +2 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/events/simple_event.rb +8 -1
- data/lib/decidim/has_resource_permission.rb +0 -2
- data/lib/decidim/map/provider/dynamic_map/here.rb +46 -1
- data/lib/decidim/nicknamizable.rb +1 -1
- data/lib/decidim/translatable_attributes.rb +8 -1
- metadata +9 -6
data/config/locales/nl.yml
CHANGED
@@ -973,7 +973,7 @@ nl:
|
|
973
973
|
title: conversaties
|
974
974
|
reply:
|
975
975
|
placeholder: Jouw antwoord...
|
976
|
-
send:
|
976
|
+
send: Verzenden
|
977
977
|
title: Beantwoorden
|
978
978
|
show:
|
979
979
|
back: Terug naar alle gesprekken
|
@@ -983,7 +983,7 @@ nl:
|
|
983
983
|
title: Gesprek met %{usernames}
|
984
984
|
start:
|
985
985
|
send: Verzenden
|
986
|
-
title:
|
986
|
+
title: Gesprek starten
|
987
987
|
update:
|
988
988
|
error: Bericht is niet verzonden vanwege een fout
|
989
989
|
metrics:
|
@@ -1618,7 +1618,7 @@ nl:
|
|
1618
1618
|
see_more: Zie meer
|
1619
1619
|
locale:
|
1620
1620
|
name: Nederlands
|
1621
|
-
name_with_error:
|
1621
|
+
name_with_error: Nederlands (fout!)
|
1622
1622
|
password_validator:
|
1623
1623
|
blacklisted: staat op de zwarte lijst
|
1624
1624
|
domain_included_in_password: lijkt te veel op deze domeinnaam
|
data/config/locales/no.yml
CHANGED
@@ -1672,7 +1672,7 @@
|
|
1672
1672
|
see_more: Se mer
|
1673
1673
|
locale:
|
1674
1674
|
name: Engelsk
|
1675
|
-
name_with_error:
|
1675
|
+
name_with_error: Norsk (feil!)
|
1676
1676
|
password_validator:
|
1677
1677
|
blacklisted: er svartelistet
|
1678
1678
|
domain_included_in_password: er for lik dette domenenavnet
|
@@ -0,0 +1 @@
|
|
1
|
+
oc:
|
data/config/locales/pl.yml
CHANGED
@@ -22,6 +22,7 @@ pl:
|
|
22
22
|
user:
|
23
23
|
about: O użytkowniku
|
24
24
|
email: Twój email
|
25
|
+
locale: Język
|
25
26
|
name: Twoje imię
|
26
27
|
nickname: Pseudonim
|
27
28
|
password: Hasło
|
@@ -34,12 +35,17 @@ pl:
|
|
34
35
|
decidim/demoted_membership: Nie jest już administratorem grupy
|
35
36
|
decidim/gamification/badge_earned_event: Zdobyta odznaka
|
36
37
|
decidim/gamification/level_up_event: Awansowałeś
|
38
|
+
decidim/invited_to_group_event: Zaproszono do grupy
|
37
39
|
decidim/join_request_accepted_event: Zaakceptowano prośbę o dołączenie
|
38
40
|
decidim/join_request_rejected_event: Odrzucono prośbę o dołączenie
|
39
41
|
decidim/profile_updated_event: Profil zaktualizowany
|
40
42
|
decidim/promote_to_admin: Awansowano na administratora grupy
|
43
|
+
decidim/promoted_to_admin_event: Awansowano na administratora grupy
|
41
44
|
decidim/removed_from_group: Usunięto z grupy
|
42
45
|
decidim/resource_endorsed_event: Zasoby zatwierdzone
|
46
|
+
decidim/resource_hidden_event: Zasób ukryty
|
47
|
+
decidim/user_group_created_event: Utworzono grupę użytkowników
|
48
|
+
decidim/welcome_notification_event: Wiadomość powitalna
|
43
49
|
activerecord:
|
44
50
|
attributes:
|
45
51
|
decidim/user:
|
@@ -84,9 +90,52 @@ pl:
|
|
84
90
|
decidim_with_day_and_month_name: "%A %d %b %Y"
|
85
91
|
decidim_with_month_name: "%d %B %Y"
|
86
92
|
decidim_with_month_name_short: "%d %b"
|
93
|
+
datetime:
|
94
|
+
distance_in_words:
|
95
|
+
about_x_hours:
|
96
|
+
one: około 1 godz.
|
97
|
+
few: około %{count} godz.
|
98
|
+
many: około %{count} godz.
|
99
|
+
other: około %{count} godz.
|
100
|
+
about_x_months:
|
101
|
+
one: około 1 mies.
|
102
|
+
few: około %{count} mies.
|
103
|
+
many: około %{count} mies.
|
104
|
+
other: około %{count} mies.
|
105
|
+
half_a_minute: pół minuty
|
106
|
+
less_than_x_minutes:
|
107
|
+
one: mniej niż min.
|
108
|
+
few: mniej niż %{count} min.
|
109
|
+
many: mniej niż %{count} min.
|
110
|
+
other: mniej niż %{count} min.
|
111
|
+
less_than_x_seconds:
|
112
|
+
one: teraz
|
113
|
+
few: mniej niż %{count} min.
|
114
|
+
many: mniej niż %{count} min.
|
115
|
+
other: mniej niż %{count} min.
|
116
|
+
x_days:
|
117
|
+
one: 1 dzień temu
|
118
|
+
few: "%{count} dni temu"
|
119
|
+
many: "%{count} dni temu"
|
120
|
+
other: "%{count} dni temu"
|
121
|
+
x_hours:
|
122
|
+
one: 1 godzinę temu
|
123
|
+
few: "%{count} godzin temu"
|
124
|
+
many: "%{count} godzin temu"
|
125
|
+
other: "%{count} godzin temu"
|
126
|
+
x_minutes:
|
127
|
+
one: 1 min. temu
|
128
|
+
few: "%{count} min. temu"
|
129
|
+
many: "%{count} min. temu"
|
130
|
+
other: "%{count} min. temu"
|
131
|
+
x_seconds:
|
132
|
+
one: 1 sekundę temu
|
133
|
+
other: "%{count} sekund temu"
|
134
|
+
zero: właśnie teraz
|
87
135
|
decidim:
|
88
136
|
accessibility:
|
89
137
|
external_link: Link zewnętrzny
|
138
|
+
front_page_link: Przejdź do strony głównej
|
90
139
|
logo: "Oficjalne logo %{organization}"
|
91
140
|
skip_button: Przejdź do głównej zawartości
|
92
141
|
account:
|
@@ -982,7 +1031,7 @@ pl:
|
|
982
1031
|
title: Konwersacja z %{usernames}
|
983
1032
|
start:
|
984
1033
|
send: Wyślij
|
985
|
-
title:
|
1034
|
+
title: Rozpocznij konwersację
|
986
1035
|
update:
|
987
1036
|
error: Wiadomość nie została wysłana z powodu błędu
|
988
1037
|
metrics:
|
@@ -1565,7 +1614,7 @@ pl:
|
|
1565
1614
|
other: 'Podczas przetwarzania Twojego żądania wystąpiły błędy:'
|
1566
1615
|
too_many_marks: używa zbyt wielu kolejnych znaków interpunkcyjnych (np.! i?)
|
1567
1616
|
too_much_caps: używa zbyt dużej liczby wielkich liter (ponad 25% tekstu)
|
1568
|
-
too_short: jest za
|
1617
|
+
too_short: jest za krótkie
|
1569
1618
|
forms:
|
1570
1619
|
correct_errors: Wystąpiły błędy w formularzu, popraw je, aby kontynuować.
|
1571
1620
|
length_validator:
|
data/config/locales/pt-BR.yml
CHANGED
@@ -963,7 +963,7 @@ pt-BR:
|
|
963
963
|
title: Conversas
|
964
964
|
reply:
|
965
965
|
placeholder: Sua resposta...
|
966
|
-
send:
|
966
|
+
send: Enviar
|
967
967
|
title: Resposta
|
968
968
|
show:
|
969
969
|
back: Voltar para todas as conversas
|
@@ -972,7 +972,7 @@ pt-BR:
|
|
972
972
|
title: Conversa com %{usernames}
|
973
973
|
start:
|
974
974
|
send: Enviar
|
975
|
-
title:
|
975
|
+
title: Iniciar uma conversa
|
976
976
|
update:
|
977
977
|
error: A mensagem não foi enviada devido a um erro
|
978
978
|
metrics:
|
@@ -1627,7 +1627,7 @@ pt-BR:
|
|
1627
1627
|
see_more: Ver mais
|
1628
1628
|
locale:
|
1629
1629
|
name: Português
|
1630
|
-
name_with_error:
|
1630
|
+
name_with_error: Português (erro!)
|
1631
1631
|
password_validator:
|
1632
1632
|
domain_included_in_password: é muito semelhante a este nome de domínio
|
1633
1633
|
email_included_in_password: é muito parecido com o seu email
|
data/config/locales/pt.yml
CHANGED
@@ -457,7 +457,7 @@ pt:
|
|
457
457
|
newsletter: Receber um boletim informativo ocasional com informações relevantes
|
458
458
|
newsletter_title: Permissão de contacto
|
459
459
|
nickname_help: A sua alcunha em %{organization}. Só pode conter letras, números, “-”, e “_”
|
460
|
-
password_help: "%{minimun_characters} caracteres no mínimo, não deverá ser muito comum (por ex. 123456) e deverá ser diferente da sua alcunha e do seu e-mail."
|
460
|
+
password_help: "%{minimun_characters} de caracteres no mínimo, não deverá ser muito comum (por ex. 123456) e deverá ser diferente da sua alcunha e do seu e-mail."
|
461
461
|
sign_in: Entrar
|
462
462
|
sign_up: Inscreva-se
|
463
463
|
sign_up_as:
|
@@ -963,7 +963,7 @@ pt:
|
|
963
963
|
title: Conversas
|
964
964
|
reply:
|
965
965
|
placeholder: A sua resposta...
|
966
|
-
send:
|
966
|
+
send: Enviar
|
967
967
|
title: Responder
|
968
968
|
show:
|
969
969
|
back: Retroceder a todas as conversas
|
data/config/locales/ro-RO.yml
CHANGED
@@ -473,7 +473,7 @@ ro:
|
|
473
473
|
newsletter: Primește un buletin informativ ocazional cu informații relevante
|
474
474
|
newsletter_title: Drepturi privind contactele
|
475
475
|
nickname_help: Pseudonimul tău în %{organization}. Poate conține doar litere, numere, '-' și '_'.
|
476
|
-
password_help: "minim %{minimun_characters} caractere, nu trebuie să fie prea comune (ex. 123456) și trebuie să fie diferite de
|
476
|
+
password_help: "minim %{minimun_characters} caractere, nu trebuie să fie prea comune (ex. 123456) și trebuie să fie diferite de porecla și adresa dvs. de e-mail."
|
477
477
|
sign_in: Autentificare
|
478
478
|
sign_up: Înscrie-te
|
479
479
|
sign_up_as:
|
data/config/locales/ru.yml
CHANGED
@@ -300,7 +300,6 @@ ru:
|
|
300
300
|
already_have_an_account?: У вас уже есть учетная запись?
|
301
301
|
newsletter: Получать время от времени рассылку со свежими новостями
|
302
302
|
newsletter_title: Разрешение на связь с вами
|
303
|
-
password_help: "Минимум %{minimun_characters} символов, не должен быть слишком распространенным (например, 123456) и должен отличаться от вашего имени и электронной почты."
|
304
303
|
sign_in: Войти
|
305
304
|
sign_up: Зарегистрироваться
|
306
305
|
sign_up_as:
|
@@ -513,10 +512,8 @@ ru:
|
|
513
512
|
no_conversations: У вас еще нет бесед
|
514
513
|
reply:
|
515
514
|
send: Отправить
|
516
|
-
title: Ответить
|
517
515
|
start:
|
518
516
|
send: Отправить
|
519
|
-
title: Начать беседу
|
520
517
|
newsletter_mailer:
|
521
518
|
newsletter:
|
522
519
|
note: Вы получили это электронное письмо, потому что подписались на новостные рассылки %{organization_name}. Вы можете изменить свои настройки на своей <a href="%{link}">странице уведомлений</a>.
|
@@ -763,6 +760,8 @@ ru:
|
|
763
760
|
edit:
|
764
761
|
new_password: Пароль
|
765
762
|
registrations:
|
763
|
+
edit:
|
764
|
+
are_you_sure: Вы уверены?
|
766
765
|
new:
|
767
766
|
sign_up: Зарегистрироваться
|
768
767
|
signed_up: Добро пожаловать! Вы успешно зарегистрировались.
|
data/config/locales/sk.yml
CHANGED
@@ -409,7 +409,7 @@ sk:
|
|
409
409
|
already_have_an_account?: Už máte účet?
|
410
410
|
newsletter: Dostávajte príležitostný spravodajca s relevantnými informáciami
|
411
411
|
newsletter_title: Povolenie kontaktu
|
412
|
-
password_help: "%{minimun_characters} minimum znakov, nesmie byť príliš bežné (napr. 123456) a musí byť iné ako vaše prezývka a váš e-mail."
|
412
|
+
password_help: "%{minimun_characters} je minimum znakov, nesmie byť príliš bežné (napr. 123456) a musí byť iné ako vaše prezývka a váš e-mail."
|
413
413
|
sign_in: Prihlásiť sa
|
414
414
|
sign_up: Zaregistrovať sa
|
415
415
|
sign_up_as:
|
@@ -821,15 +821,12 @@ sk:
|
|
821
821
|
no_conversations: Nemáte zatím žádné konverzace
|
822
822
|
title: Konverzace
|
823
823
|
reply:
|
824
|
-
placeholder: Vaša odpoveď...
|
825
824
|
send: Poslat
|
826
|
-
title: Odpověď
|
827
825
|
show:
|
828
826
|
chat_with: Konverzácia s
|
829
827
|
title: Konverzace s číslem %{usernames}
|
830
828
|
start:
|
831
829
|
send: Poslat
|
832
|
-
title: Spusťte konverzaci
|
833
830
|
metrics:
|
834
831
|
followers:
|
835
832
|
description: Počet účastníkov, ktorí sledujú tento participatívny priestor
|
data/config/locales/sv.yml
CHANGED
@@ -41,6 +41,7 @@ sv:
|
|
41
41
|
decidim/promote_to_admin: Befordrad till gruppadministratör
|
42
42
|
decidim/removed_from_group: Borttagen från gruppen
|
43
43
|
decidim/resource_endorsed_event: Resurs instämd
|
44
|
+
decidim/welcome_notification_event: Välkomstmeddelande
|
44
45
|
activerecord:
|
45
46
|
attributes:
|
46
47
|
decidim/user:
|
@@ -123,7 +124,7 @@ sv:
|
|
123
124
|
ok: Ja, radera mitt konto
|
124
125
|
question: Är du säker på att du vill radera ditt konto?
|
125
126
|
title: Radera mitt konto
|
126
|
-
explanation: Ange skälet till varför du vill radera ditt konto (
|
127
|
+
explanation: Ange skälet till varför du vill radera ditt konto (frivilligt).
|
127
128
|
destroy:
|
128
129
|
error: Det gick inte att radera ditt konto.
|
129
130
|
success: Ditt konto har raderats.
|
data/config/locales/tr-TR.yml
CHANGED
@@ -929,7 +929,7 @@ tr:
|
|
929
929
|
ok: OK
|
930
930
|
index:
|
931
931
|
ago: önce
|
932
|
-
close:
|
932
|
+
close: Yakın kalıcı
|
933
933
|
from: Gönderen
|
934
934
|
groups: Gruplarım
|
935
935
|
last_message: Son mesaj
|
@@ -947,7 +947,7 @@ tr:
|
|
947
947
|
title: '%{usernames} ile görüşme'
|
948
948
|
start:
|
949
949
|
send: Gönder
|
950
|
-
title: Bir görüşme
|
950
|
+
title: Bir görüşme başlatın
|
951
951
|
update:
|
952
952
|
error: Bir hata nedeniyle mesaj gönderilemedi
|
953
953
|
metrics:
|
data/config/locales/uk.yml
CHANGED
@@ -385,10 +385,9 @@ uk:
|
|
385
385
|
close: Закрити віконце
|
386
386
|
no_conversations: У вас ще немає бесід
|
387
387
|
reply:
|
388
|
-
|
388
|
+
send: Надіслати
|
389
389
|
start:
|
390
390
|
send: Надіслати
|
391
|
-
title: Почати бесіду
|
392
391
|
newsletter_mailer:
|
393
392
|
newsletter:
|
394
393
|
note: Ви отримали цього електронного листа, оскільки ви підписалися на новини щодо %{organization_name}. Ви можете змінити свої налаштування на <a href="%{link}">сторінці сповіщень</a>.
|
data/config/locales/zh-CN.yml
CHANGED
@@ -1472,8 +1472,8 @@ zh-CN:
|
|
1472
1472
|
widget:
|
1473
1473
|
see_more: 查看更多
|
1474
1474
|
locale:
|
1475
|
-
name:
|
1476
|
-
name_with_error:
|
1475
|
+
name: 中文
|
1476
|
+
name_with_error: 中文(错误!)
|
1477
1477
|
password_validator:
|
1478
1478
|
domain_included_in_password: 与这个域名太近了
|
1479
1479
|
email_included_in_password: 与您的电子邮件太相似了
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
|
19
19
|
# Matches a hashtag if it starts with a letter or number
|
20
20
|
# and only contains letters, numbers or underscores.
|
21
|
-
HASHTAG_REGEX =
|
21
|
+
HASHTAG_REGEX = /(?:\A|\s\K)\B#([[:alnum:]](?:[[:alnum:]]|_)*)\b/i.freeze
|
22
22
|
|
23
23
|
# Replaces hashtags name with new or existing hashtags models global ids.
|
24
24
|
#
|
data/lib/decidim/core/engine.rb
CHANGED
@@ -254,7 +254,7 @@ module Decidim
|
|
254
254
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Core::Engine.root}/app/views") # for partials
|
255
255
|
end
|
256
256
|
|
257
|
-
initializer "doorkeeper" do
|
257
|
+
initializer "doorkeeper", before: "doorkeeper.params.filter" do
|
258
258
|
Doorkeeper.configure do
|
259
259
|
orm :active_record
|
260
260
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
shared_examples_for "resource endorsed event" do
|
6
|
+
include_context "when a simple event"
|
7
|
+
|
8
|
+
let(:event_name) { "decidim.events.resource_endorsed" }
|
9
|
+
let(:author) { create :user, organization: resource.organization }
|
10
|
+
|
11
|
+
let(:extra) { { endorser_id: author.id } }
|
12
|
+
let(:endorsement) { create :endorsement, resource: resource, author: author }
|
13
|
+
let(:resource_path) { resource_locator(resource).path }
|
14
|
+
let(:follower) { create(:user, organization: resource.organization) }
|
15
|
+
let(:follow) { create(:follow, followable: author, user: follower) }
|
16
|
+
|
17
|
+
it_behaves_like "a simple event"
|
18
|
+
|
19
|
+
describe "types" do
|
20
|
+
subject { described_class }
|
21
|
+
|
22
|
+
it "supports notifications" do
|
23
|
+
expect(subject.types).to include :notification
|
24
|
+
end
|
25
|
+
|
26
|
+
it "supports emails" do
|
27
|
+
expect(subject.types).to include :email
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "email_subject" do
|
32
|
+
it "is generated correctly" do
|
33
|
+
expect(subject.email_subject).to eq("#{author_presenter.nickname} has performed a new endorsement")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "email_intro" do
|
38
|
+
it "is generated correctly" do
|
39
|
+
expect(subject.email_intro)
|
40
|
+
.to eq("#{author.name} #{author_presenter.nickname}, who you are following," \
|
41
|
+
" has just endorsed \"#{translated resource.title}\" and we think it may be interesting to you. Check it out and contribute:")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "notification_title" do
|
46
|
+
it "is generated correctly" do
|
47
|
+
expect(subject.notification_title)
|
48
|
+
.to include("The <a href=\"#{resource_path}\">#{translated resource.title}</a> #{resource_type} has been endorsed by ")
|
49
|
+
|
50
|
+
expect(subject.notification_title)
|
51
|
+
.to include("<a href=\"/profiles/#{author.nickname}\">#{author.name} #{author_presenter.nickname}</a>.")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "resource_text" do
|
56
|
+
it "shows the resource text" do
|
57
|
+
expect(subject.resource_text).to eq resource_text
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
shared_examples "versions controller" do
|
6
|
+
let(:base_params) do
|
7
|
+
if resource.is_a?(Decidim::Participable)
|
8
|
+
{ "#{resource.model_name.singular_route_key}_slug".to_sym => resource.slug }
|
9
|
+
else
|
10
|
+
{ "#{resource.model_name.singular_route_key}_id".to_sym => resource.id }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
before do
|
15
|
+
request.env["decidim.current_organization"] = resource.organization
|
16
|
+
|
17
|
+
if resource.is_a?(Decidim::HasComponent)
|
18
|
+
request.env["decidim.current_participatory_space"] = resource.participatory_space
|
19
|
+
request.env["decidim.current_component"] = resource.component
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "GET show" do
|
24
|
+
context "with an existing version" do
|
25
|
+
it "returns a HTTP 200" do
|
26
|
+
get :show, params: base_params.merge(id: 1)
|
27
|
+
|
28
|
+
expect(response).to have_http_status(:ok)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when the resource does not exist" do
|
33
|
+
it "raises a routing error" do
|
34
|
+
expect do
|
35
|
+
get :show, params: base_params.merge(id: 999_999_999)
|
36
|
+
end.to raise_error(ActionController::RoutingError)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -5,7 +5,7 @@ require "spec_helper"
|
|
5
5
|
# users of this test should delare the `subject` variable.
|
6
6
|
shared_examples "with endorsable permissions can perform actions related to endorsable" do
|
7
7
|
let(:action_subject) { :endorsement }
|
8
|
-
let(:resource) { create :dummy_resource }
|
8
|
+
let(:resource) { create :dummy_resource, component: component }
|
9
9
|
before do
|
10
10
|
context[:current_settings] = double(current_settings)
|
11
11
|
context[:resource] = resource
|
data/lib/decidim/core/test.rb
CHANGED
@@ -71,3 +71,5 @@ require "decidim/core/test/shared_examples/categories_container_examples"
|
|
71
71
|
require "decidim/core/test/shared_examples/assembly_announcements_examples"
|
72
72
|
require "decidim/core/test/shared_examples/translated_event_examples"
|
73
73
|
require "decidim/core/test/shared_examples/conversations_examples"
|
74
|
+
require "decidim/core/test/shared_examples/versions_controller_examples"
|
75
|
+
require "decidim/core/test/shared_examples/resource_endorsed_event_examples"
|
data/lib/decidim/core/version.rb
CHANGED
@@ -32,7 +32,14 @@ module Decidim
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def email_subject
|
35
|
-
I18n.t("email_subject",
|
35
|
+
I18n.t("email_subject", email_subject_i18n_options).html_safe
|
36
|
+
end
|
37
|
+
|
38
|
+
def email_subject_i18n_options
|
39
|
+
sanitized_values = { resource_title: decidim_sanitize(resource_title) }
|
40
|
+
sanitized_values[:mentioned_proposal_title] = decidim_sanitize(mentioned_proposal_title) if i18n_options.has_key?(:mentioned_proposal_title)
|
41
|
+
sanitized_values[:participatory_space_title] = decidim_sanitize(participatory_space_title) if i18n_options.has_key?(:participatory_space_title)
|
42
|
+
i18n_options.merge(sanitized_values)
|
36
43
|
end
|
37
44
|
|
38
45
|
def email_intro
|
@@ -14,8 +14,6 @@ module Decidim
|
|
14
14
|
|
15
15
|
delegate :resource_manifest, :resource_key, to: :class
|
16
16
|
|
17
|
-
alias_method :manifest, :resource_manifest
|
18
|
-
|
19
17
|
# Public: Whether the permissions for this object actions can be set at resource level.
|
20
18
|
def allow_resource_permissions?
|
21
19
|
false
|
@@ -33,7 +33,7 @@ module Decidim
|
|
33
33
|
)
|
34
34
|
end
|
35
35
|
|
36
|
-
base_config.merge(api_key: api_key)
|
36
|
+
base_config.merge(api_key: api_key, language: language_code)
|
37
37
|
end
|
38
38
|
|
39
39
|
# A builder for the HERE maps which needs to be configured differently
|
@@ -44,6 +44,51 @@ module Decidim
|
|
44
44
|
template.javascript_pack_tag("decidim_map_provider_here", defer: false)
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def language_code
|
51
|
+
primary = I18n.locale.to_s
|
52
|
+
secondary = primary.split("-")[0]
|
53
|
+
available_language_codes[primary] || available_language_codes[secondary] || ""
|
54
|
+
end
|
55
|
+
|
56
|
+
def available_language_codes
|
57
|
+
@available_language_codes ||= {
|
58
|
+
"ar" => "ara", # Arabic
|
59
|
+
"eu" => "baq", # Basque
|
60
|
+
"ca" => "cat", # Catalan
|
61
|
+
"zh" => "chi", # Chinese (simplified)
|
62
|
+
# "" => "cht", # Chinese (traditional)
|
63
|
+
"cs" => "cze", # Czech
|
64
|
+
"da" => "dan", # Danish
|
65
|
+
"nl" => "dut", # Dutch
|
66
|
+
"en" => "eng", # English
|
67
|
+
"fi" => "fin", # Finnish
|
68
|
+
"fr" => "fre", # French
|
69
|
+
"de" => "ger", # German
|
70
|
+
"ga" => "gle", # Gaelic
|
71
|
+
"el" => "gre", # Greek
|
72
|
+
"he" => "heb", # Hebrew
|
73
|
+
"hi" => "hin", # Hindi
|
74
|
+
"id" => "ind", # Indonesian
|
75
|
+
"it" => "ita", # Italian
|
76
|
+
"no" => "nor", # Norwegian
|
77
|
+
"fa" => "per", # Persian
|
78
|
+
"pl" => "pol", # Polish
|
79
|
+
"pt" => "por", # Portuguese
|
80
|
+
"ru" => "rus", # Russian
|
81
|
+
"si" => "sin", # Sinhalese
|
82
|
+
"es" => "spa", # Spanish
|
83
|
+
"sv" => "swe", # Swedish
|
84
|
+
"th" => "tha", # Thai
|
85
|
+
"tr" => "tur", # Turkish
|
86
|
+
"uk" => "ukr", # Ukrainian
|
87
|
+
"ur" => "urd", # Urdu
|
88
|
+
"vi" => "vie", # Vietnamese
|
89
|
+
"cy" => "wel" # Welsh
|
90
|
+
}
|
91
|
+
end
|
47
92
|
end
|
48
93
|
end
|
49
94
|
end
|
@@ -52,7 +52,7 @@ module Decidim
|
|
52
52
|
candidate = name
|
53
53
|
|
54
54
|
2.step do |n|
|
55
|
-
return candidate
|
55
|
+
return candidate if Decidim::UserBaseEntity.where("nickname ILIKE ?", candidate.downcase).where(scope).empty?
|
56
56
|
|
57
57
|
candidate = numbered_variation_of(name, n)
|
58
58
|
end
|
@@ -43,7 +43,14 @@ module Decidim
|
|
43
43
|
|
44
44
|
define_method attribute_name do
|
45
45
|
field = public_send(name) || {}
|
46
|
-
value =
|
46
|
+
value =
|
47
|
+
if field.is_a?(Hash)
|
48
|
+
field[locale.to_s] || field[locale.to_sym]
|
49
|
+
else
|
50
|
+
# The value may not be a hash in case the attribute type was
|
51
|
+
# changed and the old value is still stored against the record.
|
52
|
+
field
|
53
|
+
end
|
47
54
|
attribute_set[attribute_name].coerce(value)
|
48
55
|
end
|
49
56
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.26.
|
4
|
+
version: 0.26.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-09-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_link_to
|
@@ -754,28 +754,28 @@ dependencies:
|
|
754
754
|
requirements:
|
755
755
|
- - '='
|
756
756
|
- !ruby/object:Gem::Version
|
757
|
-
version: 0.26.
|
757
|
+
version: 0.26.3
|
758
758
|
type: :runtime
|
759
759
|
prerelease: false
|
760
760
|
version_requirements: !ruby/object:Gem::Requirement
|
761
761
|
requirements:
|
762
762
|
- - '='
|
763
763
|
- !ruby/object:Gem::Version
|
764
|
-
version: 0.26.
|
764
|
+
version: 0.26.3
|
765
765
|
- !ruby/object:Gem::Dependency
|
766
766
|
name: decidim-dev
|
767
767
|
requirement: !ruby/object:Gem::Requirement
|
768
768
|
requirements:
|
769
769
|
- - '='
|
770
770
|
- !ruby/object:Gem::Version
|
771
|
-
version: 0.26.
|
771
|
+
version: 0.26.3
|
772
772
|
type: :development
|
773
773
|
prerelease: false
|
774
774
|
version_requirements: !ruby/object:Gem::Requirement
|
775
775
|
requirements:
|
776
776
|
- - '='
|
777
777
|
- !ruby/object:Gem::Version
|
778
|
-
version: 0.26.
|
778
|
+
version: 0.26.3
|
779
779
|
description: Adds core features so other engines can hook into the framework.
|
780
780
|
email:
|
781
781
|
- josepjaume@gmail.com
|
@@ -1994,6 +1994,7 @@ files:
|
|
1994
1994
|
- config/locales/mt.yml
|
1995
1995
|
- config/locales/nl.yml
|
1996
1996
|
- config/locales/no.yml
|
1997
|
+
- config/locales/oc-FR.yml
|
1997
1998
|
- config/locales/om-ET.yml
|
1998
1999
|
- config/locales/pl.yml
|
1999
2000
|
- config/locales/pt-BR.yml
|
@@ -2392,6 +2393,7 @@ files:
|
|
2392
2393
|
- lib/decidim/core/test/shared_examples/railtie_examples.rb
|
2393
2394
|
- lib/decidim/core/test/shared_examples/reportable.rb
|
2394
2395
|
- lib/decidim/core/test/shared_examples/reports_examples.rb
|
2396
|
+
- lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb
|
2395
2397
|
- lib/decidim/core/test/shared_examples/resource_search_examples.rb
|
2396
2398
|
- lib/decidim/core/test/shared_examples/resourceable.rb
|
2397
2399
|
- lib/decidim/core/test/shared_examples/rich_text_editor_examples.rb
|
@@ -2410,6 +2412,7 @@ files:
|
|
2410
2412
|
- lib/decidim/core/test/shared_examples/traceable_interface_examples.rb
|
2411
2413
|
- lib/decidim/core/test/shared_examples/translated_event_examples.rb
|
2412
2414
|
- lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb
|
2415
|
+
- lib/decidim/core/test/shared_examples/versions_controller_examples.rb
|
2413
2416
|
- lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb
|
2414
2417
|
- lib/decidim/core/version.rb
|
2415
2418
|
- lib/decidim/data_portability.rb
|