decidim-forms 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +65 -0
  3. data/Rakefile +3 -0
  4. data/app/assets/config/admin/decidim_forms_manifest.js +1 -0
  5. data/app/assets/config/decidim_forms_manifest.js +1 -0
  6. data/app/assets/images/decidim/surveys/icon.svg +19 -0
  7. data/app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6 +25 -0
  8. data/app/assets/javascripts/decidim/forms/admin/auto_select_options_by_total_items.component.js.es6 +23 -0
  9. data/app/assets/javascripts/decidim/forms/admin/forms.js.es6 +188 -0
  10. data/app/assets/javascripts/decidim/forms/autosortable_checkboxes.component.js.es6 +65 -0
  11. data/app/assets/javascripts/decidim/forms/forms.js.es6 +20 -0
  12. data/app/assets/javascripts/decidim/forms/option_attached_inputs.component.js.es6 +32 -0
  13. data/app/commands/decidim/forms/admin/update_questionnaire.rb +86 -0
  14. data/app/commands/decidim/forms/answer_questionnaire.rb +54 -0
  15. data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +95 -0
  16. data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +84 -0
  17. data/app/forms/decidim/forms/admin/answer_option_form.rb +23 -0
  18. data/app/forms/decidim/forms/admin/question_form.rb +35 -0
  19. data/app/forms/decidim/forms/admin/questionnaire_form.rb +27 -0
  20. data/app/forms/decidim/forms/answer_choice_form.rb +15 -0
  21. data/app/forms/decidim/forms/answer_form.rb +69 -0
  22. data/app/forms/decidim/forms/questionnaire_form.rb +22 -0
  23. data/app/helpers/decidim/forms/admin/application_helper.rb +19 -0
  24. data/app/models/concerns/decidim/forms/has_questionnaire.rb +20 -0
  25. data/app/models/decidim/forms/answer.rb +45 -0
  26. data/app/models/decidim/forms/answer_choice.rb +15 -0
  27. data/app/models/decidim/forms/answer_option.rb +11 -0
  28. data/app/models/decidim/forms/application_record.rb +10 -0
  29. data/app/models/decidim/forms/question.rb +36 -0
  30. data/app/models/decidim/forms/questionnaire.rb +23 -0
  31. data/app/queries/decidim/forms/questionnaire_user_answers.rb +28 -0
  32. data/app/views/decidim/forms/admin/questionnaires/_answer_option.html.erb +44 -0
  33. data/app/views/decidim/forms/admin/questionnaires/_form.html.erb +51 -0
  34. data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +115 -0
  35. data/app/views/decidim/forms/admin/questionnaires/edit.html.erb +7 -0
  36. data/app/views/decidim/forms/questionnaires/_answer.html.erb +94 -0
  37. data/app/views/decidim/forms/questionnaires/show.html.erb +84 -0
  38. data/config/locales/ca.yml +79 -0
  39. data/config/locales/de.yml +79 -0
  40. data/config/locales/en.yml +79 -0
  41. data/config/locales/es-PY.yml +79 -0
  42. data/config/locales/es.yml +79 -0
  43. data/config/locales/eu.yml +79 -0
  44. data/config/locales/fi-pl.yml +79 -0
  45. data/config/locales/fi.yml +79 -0
  46. data/config/locales/fr.yml +79 -0
  47. data/config/locales/gl.yml +79 -0
  48. data/config/locales/hu.yml +79 -0
  49. data/config/locales/id-ID.yml +1 -0
  50. data/config/locales/it.yml +79 -0
  51. data/config/locales/nl.yml +79 -0
  52. data/config/locales/pl.yml +79 -0
  53. data/config/locales/pt-BR.yml +79 -0
  54. data/config/locales/pt.yml +79 -0
  55. data/config/locales/ru.yml +1 -0
  56. data/config/locales/sv.yml +79 -0
  57. data/config/locales/tr-TR.yml +1 -0
  58. data/config/locales/uk.yml +1 -0
  59. data/db/migrate/20170511092231_create_decidim_forms_questionnaires.rb +15 -0
  60. data/db/migrate/20170515090916_create_decidim_forms_questions.rb +17 -0
  61. data/db/migrate/20170515144119_create_decidim_forms_answers.rb +15 -0
  62. data/db/migrate/20180405015012_create_decidim_forms_answer_options.rb +11 -0
  63. data/db/migrate/20180405015147_create_decidim_forms_answer_choices.rb +13 -0
  64. data/lib/decidim/forms.rb +13 -0
  65. data/lib/decidim/forms/admin.rb +9 -0
  66. data/lib/decidim/forms/admin_engine.rb +21 -0
  67. data/lib/decidim/forms/data_portability_user_answers_serializer.rb +37 -0
  68. data/lib/decidim/forms/engine.rb +14 -0
  69. data/lib/decidim/forms/test.rb +4 -0
  70. data/lib/decidim/forms/test/factories.rb +55 -0
  71. data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +524 -0
  72. data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +626 -0
  73. data/lib/decidim/forms/user_answers_serializer.rb +29 -0
  74. data/lib/decidim/forms/version.rb +10 -0
  75. metadata +165 -0
@@ -0,0 +1,79 @@
1
+ hu:
2
+ activemodel:
3
+ attributes:
4
+ answer:
5
+ body: Válasz
6
+ question:
7
+ max_choices: Maximális választási lehetőségek száma
8
+ question_type: Típus
9
+ questionnaire_question:
10
+ mandatory: Kötelező
11
+ errors:
12
+ models:
13
+ answer:
14
+ attributes:
15
+ choices:
16
+ missing: nem teljesek
17
+ too_many: túl sok
18
+ decidim:
19
+ forms:
20
+ admin:
21
+ models:
22
+ components:
23
+ description: Leírás
24
+ tos: Szolgáltatás feltételei
25
+ questionnaires:
26
+ answer_option:
27
+ answer_option: Válasz opció
28
+ free_text: Szabadszöveg
29
+ remove: Eltávolít
30
+ statement: Nyilatkozat
31
+ edit:
32
+ save: Mentés
33
+ title: Cím
34
+ form:
35
+ add_question: Kérdés hozzáadása
36
+ already_answered_warning: Néhány felhasználó már válaszolt a kérdőívre, így nem változtathatja meg kérdéseit.
37
+ question:
38
+ add_answer_option: Válasz opció hozzáadása
39
+ any: Bármilyen
40
+ description: Leírás
41
+ down: Le
42
+ question: Kérdés
43
+ remove: Eltávolít
44
+ statement: Nyilatkozat
45
+ up: Fel
46
+ update:
47
+ invalid: Hiba történt a kérdőív mentésekor.
48
+ success: A kérdőíveket sikeresen elmentettük.
49
+ errors:
50
+ answer:
51
+ body: A szövegtörzs nem lehet üres
52
+ question_types:
53
+ long_answer: Hosszú válasz
54
+ multiple_option: Több választási lehetőség
55
+ short_answer: Rövid válasz
56
+ single_option: Egy választási lehetőség
57
+ sorting: Válogatás
58
+ questionnaires:
59
+ answer:
60
+ invalid: Hiba történt a kérdőív megválaszolásakor.
61
+ success: A kérdőívre sikeresen válaszoltál.
62
+ question:
63
+ max_choices: 'Max választás: %{n}'
64
+ show:
65
+ answer_questionnaire:
66
+ anonymous_user_message: <a href="%{sign_in_link}">Jelentkezz be a fiókoddal </a> vagy <a href="%{sign_up_link}">iratkozz fel</a> a kérdőív megválaszolásához.
67
+ title: Válaszoljon a kérdőívre
68
+ are_you_sure: Ez a művelet nem vonható vissza, és nem tudod majd szerkeszteni a válaszokat. Biztos vagy ebben?
69
+ questionnaire_answered:
70
+ body: Már megválaszoltad ezt a kérdőívet.
71
+ title: Már megválaszolt
72
+ questionnaire_closed:
73
+ body: A kérdőív zárva van, és nem lehet megválaszolni.
74
+ title: A kérdőív lezárult
75
+ questionnaire_for_private_users:
76
+ body: A kérdőív csak magán felhasználók számára áll rendelkezésre
77
+ title: A kérdőív lezárult
78
+ submit: Beküldés
79
+ tos_agreement: A részvétellel elfogadja az Általános Szerződési Feltételeket
@@ -0,0 +1 @@
1
+ id:
@@ -0,0 +1,79 @@
1
+ it:
2
+ activemodel:
3
+ attributes:
4
+ answer:
5
+ body: Risposta
6
+ question:
7
+ max_choices: Numero massimo di scelte
8
+ question_type: genere
9
+ questionnaire_question:
10
+ mandatory: Obbligatorio
11
+ errors:
12
+ models:
13
+ answer:
14
+ attributes:
15
+ choices:
16
+ missing: non sono completi
17
+ too_many: sono troppi
18
+ decidim:
19
+ forms:
20
+ admin:
21
+ models:
22
+ components:
23
+ description: Descrizione
24
+ tos: Termini di servizio
25
+ questionnaires:
26
+ answer_option:
27
+ answer_option: Opzione di risposta
28
+ free_text: Testo libero
29
+ remove: Rimuovere
30
+ statement: dichiarazione
31
+ edit:
32
+ save: Salvare
33
+ title: Titolo
34
+ form:
35
+ add_question: Aggiungi domanda
36
+ already_answered_warning: Alcuni utenti hanno già risposto al questionario, quindi non è possibile modificare le sue domande.
37
+ question:
38
+ add_answer_option: Aggiungi l'opzione di risposta
39
+ any: Qualunque
40
+ description: Descrizione
41
+ down: Giù
42
+ question: Domanda
43
+ remove: Rimuovere
44
+ statement: dichiarazione
45
+ up: Su
46
+ update:
47
+ invalid: Si sono verificati errori durante il salvataggio del questionario.
48
+ success: Questionari salvati correttamente.
49
+ errors:
50
+ answer:
51
+ body: Il corpo non può essere vuoto
52
+ question_types:
53
+ long_answer: Risposta lunga
54
+ multiple_option: Opzione multipla
55
+ short_answer: Risposta breve
56
+ single_option: Opzione singola
57
+ sorting: Ordinamento
58
+ questionnaires:
59
+ answer:
60
+ invalid: Ci sono stati errori nel rispondere al questionario.
61
+ success: Il questionario ha risposto con successo.
62
+ question:
63
+ max_choices: 'Scelte massime: %{n}'
64
+ show:
65
+ answer_questionnaire:
66
+ anonymous_user_message: <a href="%{sign_in_link}">Accedi con il tuo account</a> o <a href="%{sign_up_link}">iscriviti</a> per rispondere al questionario.
67
+ title: Rispondi al questionario
68
+ are_you_sure: Questa azione non può essere annullata e non sarai in grado di modificare le tue risposte. Sei sicuro?
69
+ questionnaire_answered:
70
+ body: Hai già risposto a questo questionario.
71
+ title: Ho già risposto
72
+ questionnaire_closed:
73
+ body: Il questionario è chiuso e non è possibile rispondere.
74
+ title: Questionario chiuso
75
+ questionnaire_for_private_users:
76
+ body: Il questionario è disponibile solo per gli utenti privati
77
+ title: Questionario chiuso
78
+ submit: Sottoscrivi
79
+ tos_agreement: Partecipando accetti i suoi Termini di servizio
@@ -0,0 +1,79 @@
1
+ nl:
2
+ activemodel:
3
+ attributes:
4
+ answer:
5
+ body: Antwoord
6
+ question:
7
+ max_choices: Maximum aantal keuzes
8
+ question_type: Type
9
+ questionnaire_question:
10
+ mandatory: Verplicht
11
+ errors:
12
+ models:
13
+ answer:
14
+ attributes:
15
+ choices:
16
+ missing: zijn niet compleet
17
+ too_many: zijn te veel
18
+ decidim:
19
+ forms:
20
+ admin:
21
+ models:
22
+ components:
23
+ description: Omschrijving
24
+ tos: Servicevoorwaarden
25
+ questionnaires:
26
+ answer_option:
27
+ answer_option: Antwoord optie
28
+ free_text: Vrije tekst
29
+ remove: Verwijderen
30
+ statement: Uitspraak
31
+ edit:
32
+ save: Opslaan
33
+ title: Titel
34
+ form:
35
+ add_question: Vraag toevoegen
36
+ already_answered_warning: De vragenlijst is al door enkele gebruikers beantwoord, dus u kunt de vragen niet wijzigen.
37
+ question:
38
+ add_answer_option: Antwoordoptie toevoegen
39
+ any: Ieder
40
+ description: Omschrijving
41
+ down: naar beneden
42
+ question: Vraag
43
+ remove: Verwijderen
44
+ statement: Uitspraak
45
+ up: omhoog
46
+ update:
47
+ invalid: Er zijn fouten opgetreden bij het opslaan van de vragenlijst.
48
+ success: Vragenlijsten succesvol opgeslagen.
49
+ errors:
50
+ answer:
51
+ body: Lichaam mag niet leeg zijn
52
+ question_types:
53
+ long_answer: Lang antwoord
54
+ multiple_option: Meerdere optie
55
+ short_answer: Kort antwoord
56
+ single_option: Enkele optie
57
+ sorting: sorteer-
58
+ questionnaires:
59
+ answer:
60
+ invalid: Er zijn fouten opgetreden bij het beantwoorden van de vragenlijst.
61
+ success: Vragenlijst met succes beantwoord.
62
+ question:
63
+ max_choices: 'Max. Keuzes: %{n}'
64
+ show:
65
+ answer_questionnaire:
66
+ anonymous_user_message: <a href="%{sign_in_link}">Meld u aan met uw account</a> of <a href="%{sign_up_link}">meld u aan</a> om de vragenlijst te beantwoorden.
67
+ title: Beantwoord de vragenlijst
68
+ are_you_sure: Deze actie kan niet ongedaan worden gemaakt en u kunt uw antwoorden niet bewerken. Weet je het zeker?
69
+ questionnaire_answered:
70
+ body: U hebt deze vragenlijst al beantwoord.
71
+ title: Al beantwoord
72
+ questionnaire_closed:
73
+ body: De vragenlijst is gesloten en kan niet worden beantwoord.
74
+ title: Vragenlijst gesloten
75
+ questionnaire_for_private_users:
76
+ body: De vragenlijst is alleen beschikbaar voor privé-gebruikers
77
+ title: Vragenlijst gesloten
78
+ submit: voorleggen
79
+ tos_agreement: Door deel te nemen, gaat u akkoord met de Servicevoorwaarden
@@ -0,0 +1,79 @@
1
+ pl:
2
+ activemodel:
3
+ attributes:
4
+ answer:
5
+ body: Odpowiedź
6
+ question:
7
+ max_choices: Maksymalna liczba opcji
8
+ question_type: Rodzaj
9
+ questionnaire_question:
10
+ mandatory: Obowiązkowy
11
+ errors:
12
+ models:
13
+ answer:
14
+ attributes:
15
+ choices:
16
+ missing: nie są kompletne
17
+ too_many: jest zbyt wiele
18
+ decidim:
19
+ forms:
20
+ admin:
21
+ models:
22
+ components:
23
+ description: Opis
24
+ tos: Warunki usługi
25
+ questionnaires:
26
+ answer_option:
27
+ answer_option: Opcja odpowiedzi
28
+ free_text: Dowolny tekst
29
+ remove: Usunąć
30
+ statement: Komunikat
31
+ edit:
32
+ save: Zapisać
33
+ title: Tytuł
34
+ form:
35
+ add_question: Dodaj pytanie
36
+ already_answered_warning: Kwestionariusz jest już obsługiwany przez niektórych użytkowników, więc nie można modyfikować jego pytań.
37
+ question:
38
+ add_answer_option: Dodaj opcję odpowiedzi
39
+ any: Każdy
40
+ description: Opis
41
+ down: Na dół
42
+ question: Pytanie
43
+ remove: Usunąć
44
+ statement: Komunikat
45
+ up: W górę
46
+ update:
47
+ invalid: Podczas zapisywania kwestionariusza wystąpiły błędy.
48
+ success: Ankiety zostały pomyślnie zapisane.
49
+ errors:
50
+ answer:
51
+ body: Treść nie może być pusta
52
+ question_types:
53
+ long_answer: Długa odpowiedź
54
+ multiple_option: Wiele opcji
55
+ short_answer: Krótka odpowiedź
56
+ single_option: Opcja pojedyncza
57
+ sorting: Sortowanie
58
+ questionnaires:
59
+ answer:
60
+ invalid: Podczas odpowiadania na kwestionariusz wystąpiły błędy.
61
+ success: Kwestionariusz odpowiedział pomyślnie.
62
+ question:
63
+ max_choices: 'Maksymalne opcje: %{n}'
64
+ show:
65
+ answer_questionnaire:
66
+ anonymous_user_message: <a href="%{sign_in_link}">Zaloguj się na swoje konto</a> lub <a href="%{sign_up_link}">zarejestruj się</a> aby odpowiedzieć na kwestionariusz.
67
+ title: Odpowiedz na kwestionariusz
68
+ are_you_sure: Tego działania nie można cofnąć i nie będzie można edytować odpowiedzi. Jesteś pewny?
69
+ questionnaire_answered:
70
+ body: Już odpowiedziałeś na tę ankietę.
71
+ title: Już odpowiedziałem
72
+ questionnaire_closed:
73
+ body: Kwestionariusz jest zamknięty i nie można udzielić na nie odpowiedzi.
74
+ title: Ankieta została zamknięta
75
+ questionnaire_for_private_users:
76
+ body: Kwestionariusz jest dostępny tylko dla użytkowników prywatnych
77
+ title: Ankieta została zamknięta
78
+ submit: Zatwierdź
79
+ tos_agreement: Biorąc udział w programie, akceptujesz jego Warunki korzystania z usługi
@@ -0,0 +1,79 @@
1
+ pt-BR:
2
+ activemodel:
3
+ attributes:
4
+ answer:
5
+ body: Responda
6
+ question:
7
+ max_choices: Número máximo de escolhas
8
+ question_type: Tipo
9
+ questionnaire_question:
10
+ mandatory: Obrigatório
11
+ errors:
12
+ models:
13
+ answer:
14
+ attributes:
15
+ choices:
16
+ missing: não estão completos
17
+ too_many: são muitos
18
+ decidim:
19
+ forms:
20
+ admin:
21
+ models:
22
+ components:
23
+ description: Descrição
24
+ tos: Termos de serviço
25
+ questionnaires:
26
+ answer_option:
27
+ answer_option: Opção de resposta
28
+ free_text: Texto livre
29
+ remove: Remover
30
+ statement: Declaração
31
+ edit:
32
+ save: Salvar
33
+ title: Título
34
+ form:
35
+ add_question: Adicionar pergunta
36
+ already_answered_warning: O questionário já foi respondido por alguns usuários então você não pode modificar suas perguntas.
37
+ question:
38
+ add_answer_option: Adicionar opção de resposta
39
+ any: Qualquer
40
+ description: Descrição
41
+ down: Baixa
42
+ question: Questão
43
+ remove: Remover
44
+ statement: Declaração
45
+ up: Acima
46
+ update:
47
+ invalid: Houve erros ao salvar o questionário.
48
+ success: Questionários salvos com sucesso.
49
+ errors:
50
+ answer:
51
+ body: O corpo não pode ficar em branco
52
+ question_types:
53
+ long_answer: Resposta longa
54
+ multiple_option: Opção múltipla
55
+ short_answer: Resposta curta
56
+ single_option: Opção única
57
+ sorting: Classificação
58
+ questionnaires:
59
+ answer:
60
+ invalid: Houve erros ao responder a pesquisa.
61
+ success: Questionário respondido com sucesso.
62
+ question:
63
+ max_choices: 'Escolhas máximas: %{n}'
64
+ show:
65
+ answer_questionnaire:
66
+ anonymous_user_message: <a href="%{sign_in_link}">Entre com sua conta</a> ou <a href="%{sign_up_link}">inscreva-se</a> para responder ao questionário.
67
+ title: Responda o questionário
68
+ are_you_sure: Esta ação não pode ser desfeita e você não poderá editar suas respostas. Você tem certeza?
69
+ questionnaire_answered:
70
+ body: Você já respondeu esta pesquisa.
71
+ title: Já respondido
72
+ questionnaire_closed:
73
+ body: O questionário está fechado e não pode ser respondido.
74
+ title: Questionário fechado
75
+ questionnaire_for_private_users:
76
+ body: O questionário está disponível apenas para usuários particulares
77
+ title: Questionário fechado
78
+ submit: Enviar
79
+ tos_agreement: Ao participar você aceita seus Termos de Serviço
@@ -0,0 +1,79 @@
1
+ pt:
2
+ activemodel:
3
+ attributes:
4
+ answer:
5
+ body: Responda
6
+ question:
7
+ max_choices: Número máximo de escolhas
8
+ question_type: Tipo
9
+ questionnaire_question:
10
+ mandatory: Obrigatório
11
+ errors:
12
+ models:
13
+ answer:
14
+ attributes:
15
+ choices:
16
+ missing: não estão completos
17
+ too_many: são muitos
18
+ decidim:
19
+ forms:
20
+ admin:
21
+ models:
22
+ components:
23
+ description: Descrição
24
+ tos: Termos de serviço
25
+ questionnaires:
26
+ answer_option:
27
+ answer_option: Opção de resposta
28
+ free_text: Texto livre
29
+ remove: Remover
30
+ statement: Declaração
31
+ edit:
32
+ save: Salve 
33
+ title: Título
34
+ form:
35
+ add_question: Adicionar pergunta
36
+ already_answered_warning: O questionário já foi respondido por alguns usuários para que você não possa modificar suas perguntas.
37
+ question:
38
+ add_answer_option: Adicionar opção de resposta
39
+ any: Qualquer
40
+ description: Descrição
41
+ down: Baixa
42
+ question: Questão
43
+ remove: Remover
44
+ statement: Declaração
45
+ up: Acima
46
+ update:
47
+ invalid: Houve erros ao salvar o questionário.
48
+ success: Questionários salvos com sucesso.
49
+ errors:
50
+ answer:
51
+ body: O corpo não pode ficar em branco
52
+ question_types:
53
+ long_answer: Resposta longa
54
+ multiple_option: Múltipla opção
55
+ short_answer: Resposta curta
56
+ single_option: Opção única
57
+ sorting: Classificação
58
+ questionnaires:
59
+ answer:
60
+ invalid: Houve erros ao responder o questionário.
61
+ success: Questionário respondido com sucesso.
62
+ question:
63
+ max_choices: 'Escolhas máximas: %{n}'
64
+ show:
65
+ answer_questionnaire:
66
+ anonymous_user_message: <a href="%{sign_in_link}">Entre com sua conta</a> ou <a href="%{sign_up_link}">inscreva-se</a> para responder ao questionário.
67
+ title: Responda o questionário
68
+ are_you_sure: Esta ação não pode ser desfeita e você não poderá editar suas respostas. Você tem certeza?
69
+ questionnaire_answered:
70
+ body: Você já respondeu este questionário.
71
+ title: Já respondido
72
+ questionnaire_closed:
73
+ body: O questionário está fechado e não pode ser respondido.
74
+ title: Questionário fechado
75
+ questionnaire_for_private_users:
76
+ body: O questionário está disponível apenas para usuários particulares
77
+ title: Questionário fechado
78
+ submit: Enviar
79
+ tos_agreement: Ao participar você aceita seus Termos de Serviço