decidim-surveys 0.21.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/decidim/surveys/surveys.scss +20 -3
  3. data/app/controllers/decidim/surveys/surveys_controller.rb +5 -0
  4. data/app/queries/decidim/surveys/metrics/answers_metric_manage.rb +2 -8
  5. data/app/types/decidim/surveys/survey_type.rb +0 -1
  6. data/config/locales/bg-BG.yml +10 -0
  7. data/config/locales/da-DK.yml +1 -0
  8. data/config/locales/de.yml +3 -0
  9. data/config/locales/el.yml +58 -0
  10. data/config/locales/et-EE.yml +1 -0
  11. data/config/locales/fi.yml +2 -2
  12. data/config/locales/fr-CA.yml +59 -0
  13. data/config/locales/ga-IE.yml +1 -0
  14. data/config/locales/hr-HR.yml +1 -0
  15. data/config/locales/it.yml +6 -6
  16. data/config/locales/ja-JP.yml +57 -0
  17. data/config/locales/lt-LT.yml +1 -0
  18. data/config/locales/lv-LV.yml +61 -0
  19. data/config/locales/mt-MT.yml +1 -0
  20. data/config/locales/pl.yml +4 -1
  21. data/config/locales/pt-BR.yml +1 -1
  22. data/config/locales/pt.yml +26 -23
  23. data/config/locales/ro-RO.yml +61 -0
  24. data/config/locales/sk-SK.yml +63 -0
  25. data/config/locales/sk.yml +63 -0
  26. data/config/locales/sl.yml +8 -0
  27. data/config/locales/sr-CS.yml +1 -0
  28. data/config/locales/sv.yml +4 -1
  29. data/db/migrate/20200609090533_check_legacy_tables.rb +113 -0
  30. data/db/migrate/20200610090533_remove_survey_answer_choices.rb +7 -0
  31. data/db/migrate/20200610090650_remove_survey_answer_options.rb +7 -0
  32. data/db/migrate/20200610090725_remove_survey_answers.rb +7 -0
  33. data/db/migrate/20200610090845_remove_survey_questions.rb +7 -0
  34. data/db/migrate/20200610105927_remove_survey_columns.rb +10 -0
  35. data/lib/decidim/surveys/component.rb +13 -0
  36. data/lib/decidim/surveys/version.rb +1 -1
  37. metadata +33 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f920ed00a41af1c6ca47f27976d067c7f569e4c5420a33b3560a32db87ba4fd
4
- data.tar.gz: c5b68eb93b4df1518f1f914e38968a60ad784506ad79476538874683638bcc56
3
+ metadata.gz: 4d14a8aaa5a0ede9d984f77eeac91dbacd3c4e400cd3942555506f3c81c740a3
4
+ data.tar.gz: b6d3a986147764edb8a20ad4e8bf1219860949dac654dc93a4a0367b5d9b1c4a
5
5
  SHA512:
6
- metadata.gz: a51c4bf33bf8e9aa717e81c5ede240b9f6427699c7cd6954435c4687f3ed6df660496427cf54cbf631622d5e810dd52887a78ae3936252fb1f790b8497714c51
7
- data.tar.gz: 541ffb6c00902abc8e37df0cdf70e2602842dafdbb4a9dd36587b5ac3107f7dc58abf873bcd3dfb8fe8dbaa828161518027d99e8852089c33c28c8c0edf8039d
6
+ metadata.gz: 40cc1192e187b3a192516fb90150e76e5a2233d2acf7155f8937728781602e102459dee3ab1a9775b012af9d2d616ed6f379059ee8f11d9b9975dc409b65cf88
7
+ data.tar.gz: cf7ba0b830eb911b88fdfda3d3aec5bcab6cfc187300d73e2563904eeb37f2c707c551cf59ab16eb965591e6fb2ff72eb534957df3490ea0e333efb5f172b290
@@ -1,6 +1,10 @@
1
1
  @import "decidim/forms/forms";
2
2
 
3
- form.answer-questionnaire{
3
+ .answer-questionnaire{
4
+ label{
5
+ font-size: inherit;
6
+ }
7
+
4
8
  .radio-button-collection,
5
9
  .check-box-collection,
6
10
  .sortable-check-box-collection{
@@ -15,8 +19,10 @@ form.answer-questionnaire{
15
19
  }
16
20
  }
17
21
 
18
- label.questionnaire-question{
19
- font-weight: bold;
22
+ .questionnaire-question{
23
+ font-weight: 600;
24
+ line-height: 1.4;
25
+ margin-bottom: .3em;
20
26
  }
21
27
 
22
28
  .help-text{
@@ -30,4 +36,15 @@ form.answer-questionnaire{
30
36
  .last-sorted{
31
37
  margin-bottom: 1rem;
32
38
  }
39
+
40
+ &__steps{
41
+ font-size: .8rem;
42
+ }
43
+
44
+ &__submit{
45
+ display: flex;
46
+ align-items: baseline;
47
+ justify-content: space-between;
48
+ margin-top: 2rem;
49
+ }
33
50
  }
@@ -5,6 +5,7 @@ module Decidim
5
5
  # Exposes the survey resource so users can view and answer them.
6
6
  class SurveysController < Decidim::Surveys::ApplicationController
7
7
  include Decidim::Forms::Concerns::HasQuestionnaire
8
+ include Decidim::ComponentPathHelper
8
9
  helper Decidim::Surveys::SurveyHelper
9
10
 
10
11
  delegate :allow_answers?, :allow_unregistered?, to: :current_settings
@@ -19,6 +20,10 @@ module Decidim
19
20
  survey
20
21
  end
21
22
 
23
+ def form_path
24
+ main_component_path(current_component)
25
+ end
26
+
22
27
  private
23
28
 
24
29
  def i18n_flashes_scope
@@ -9,9 +9,6 @@ module Decidim
9
9
  end
10
10
 
11
11
  def save
12
- return @registry if @registry
13
-
14
- @registry = []
15
12
  query.each do |key, results|
16
13
  cumulative_value = results[:cumulative]
17
14
  next if cumulative_value.zero?
@@ -23,10 +20,8 @@ module Decidim
23
20
  participatory_space_type: space_type, participatory_space_id: space_id,
24
21
  related_object_type: Decidim::Surveys::Survey.name, related_object_id: survey_id)
25
22
  record.assign_attributes(cumulative: cumulative_value, quantity: quantity_value)
26
- @registry << record
23
+ record.save!
27
24
  end
28
- @registry.each(&:save!)
29
- @registry
30
25
  end
31
26
 
32
27
  private
@@ -49,8 +44,7 @@ module Decidim
49
44
  end
50
45
 
51
46
  def retrieve_surveys
52
- components = Decidim::Component.where(participatory_space: retrieve_participatory_spaces).published
53
- Decidim::Surveys::Survey.where(component: components)
47
+ Decidim::Surveys::Survey.where(component: visible_component_ids_from_spaces(retrieve_participatory_spaces))
54
48
  end
55
49
 
56
50
  def retrieve_questionnaires(survey)
@@ -7,7 +7,6 @@ module Decidim
7
7
  description "A survey"
8
8
 
9
9
  field :id, !types.ID, "The internal ID for this survey"
10
- field :publishedAt, Decidim::Core::DateTimeType, "The time this survey was published", property: :published_at
11
10
  field :createdAt, Decidim::Core::DateTimeType, "The time this survey was created", property: :created_at
12
11
  field :updatedAt, Decidim::Core::DateTimeType, "The time this survey was updated", property: :updated_at
13
12
  field :questionnaire, Decidim::Forms::QuestionnaireType, "The questionnaire for this survey"
@@ -0,0 +1,10 @@
1
+ bg:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Анкетата завърши
5
+ decidim/surveys/opened_survey_event: Анкетата започна
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Анкета
10
+ other: Анкети
@@ -0,0 +1 @@
1
+ da:
@@ -22,6 +22,8 @@ de:
22
22
  announcement: Ankündigung
23
23
  step:
24
24
  allow_answers: Erlaube Antworten
25
+ allow_unregistered: Nicht registrierten Benutzern die Beantwortung des Fragebogens erlauben
26
+ allow_unregistered_help: Wenn diese Option aktiviert ist, muss man nicht angemeldet sein, um den Fragebogen zu beantworten. Das kann zu schlechten oder unzuverlässigen Daten führen und ist mehr anfällig für automatisierte Angriffe. Verwenden Sie dies mit Bedacht!
25
27
  announcement: Ankündigung
26
28
  events:
27
29
  surveys:
@@ -53,4 +55,5 @@ de:
53
55
  surveys:
54
56
  answer:
55
57
  invalid: Bei der Beantwortung der Umfrage sind Fehler aufgetreten.
58
+ spam_detected: Bei der Beantwortung des Fragebogens sind Fehler aufgetreten. Möglicherweise waren Sie zu schnell. Versuchen Sie es vielleicht erneut.
56
59
  success: Umfrage erfolgreich beantwortet.
@@ -1 +1,59 @@
1
1
  el:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Η έρευνα έληξε
5
+ decidim/surveys/opened_survey_event: Η έρευνα ξεκίνησε
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Έρευνα
10
+ other: Έρευνες
11
+ decidim/surveys/survey_answer:
12
+ one: Απάντηση
13
+ other: Απαντήσεις
14
+ decidim:
15
+ components:
16
+ surveys:
17
+ actions:
18
+ answer: Απάντηση
19
+ name: Έρευνα
20
+ settings:
21
+ global:
22
+ announcement: Ανακοίνωση
23
+ step:
24
+ allow_answers: Να επιτρέπονται απαντήσεις
25
+ allow_unregistered: Να επιτρέπεται σε μη εγγεγραμμένους χρήστες να απαντήσουν στην έρευνα
26
+ allow_unregistered_help: Εάν είναι ενεργή, δεν απαιτείται σύνδεση για απάντηση στην έρευνα. Αυτό μπορεί να οδηγήσει σε κακής ποιότητας ή αναξιόπιστα δεδομένα και θα είναι πιο ευάλωτη σε αυτοματοποιημένες επιθέσεις. Χρησιμοποιήστε την με προσοχή!
27
+ announcement: Ανακοίνωση
28
+ events:
29
+ surveys:
30
+ survey_closed:
31
+ email_intro: Η έρευνα %{resource_title} στον χώρο συμμετοχής %{participatory_space_title} έκλεισε.
32
+ email_outro: Λάβατε αυτήν την ειδοποίηση επειδή ακολουθείτε τον χώρο συμμετοχής %{participatory_space_title}. Μπορείτε να διακόψετε τη λήψη ειδοποιήσεων ακολουθώντας τον προηγούμενο σύνδεσμο.
33
+ email_subject: Μια έρευνα ολοκληρώθηκε στον χώρο συμμετοχής %{participatory_space_title}
34
+ notification_title: Η έρευνα <a href="%{resource_path}">%{resource_title}</a> στον χώρο συμμετοχής <a href="%{participatory_space_url}">%{participatory_space_title}</a> ολοκληρώθηκε.
35
+ survey_opened:
36
+ email_intro: 'Η έρευνα %{resource_title} στον χώρο συμμετοχής %{participatory_space_title} είναι τώρα ανοιχτή. Μπορείτε να συμμετάσχετε σε αυτήν από αυτήν τη σελίδα:'
37
+ email_outro: Λάβατε αυτήν την ειδοποίηση επειδή ακολουθείτε τον χώρο συμμετοχής %{participatory_space_title}. Μπορείτε να διακόψετε τη λήψη ειδοποιήσεων ακολουθώντας τον προηγούμενο σύνδεσμο.
38
+ email_subject: Μια νέα έρευνα στον χώρο συμμετοχής %{participatory_space_title}
39
+ notification_title: Η έρευνα <a href="%{resource_path}">%{resource_title}</a> στον χώρο συμμετοχής <a href="%{participatory_space_url}">%{participatory_space_title}</a> είναι τώρα ανοιχτή.
40
+ metrics:
41
+ survey_answers:
42
+ description: Αριθμός ερευνών που απαντήθηκαν από συμμετέχοντες
43
+ object: απαντήσεις σε έρευνες
44
+ title: Απαντήσεις σε έρευνες
45
+ surveys:
46
+ admin:
47
+ exports:
48
+ survey_user_answers: Απαντήσεις συμμετεχόντων στην έρευνα
49
+ surveys:
50
+ update:
51
+ invalid: Υπήρξε ένα πρόβλημα κατά την αποθήκευση της έρευνας.
52
+ success: Η έρευνα αποθηκεύτηκε με επιτυχία.
53
+ last_activity:
54
+ new_survey_at_html: "<span>Νέα έρευνα σε %{link}</span>"
55
+ surveys:
56
+ answer:
57
+ invalid: Υπήρξε ένα πρόβλημα κατά την απάντηση στην έρευνα.
58
+ spam_detected: Υπήρξε ένα πρόβλημα κατά την απάντηση της φόρμας. Ίσως απαντήσατε πολύ γρήγορα, μπορείτε να δοκιμάσετε ξανά;
59
+ success: Η έρευνα απαντήθηκε με επιτυχία.
@@ -0,0 +1 @@
1
+ et:
@@ -28,7 +28,7 @@ fi:
28
28
  events:
29
29
  surveys:
30
30
  survey_closed:
31
- email_intro: Kysely %{resource_title} kohteessa %{participatory_space_title} on suljettu.
31
+ email_intro: Kysely %{resource_title} osallistumistilassa %{participatory_space_title} on suljettu.
32
32
  email_outro: Tämä ilmoitus on lähetetty sinulle, koska seuraat kohdetta %{participatory_space_title}. Voit lopettaa ilmoitusten vastaanottamisen edellä esitetyn linkin kautta.
33
33
  email_subject: Kysely on päättynyt kohteessa %{participatory_space_title}
34
34
  notification_title: Kysely <a href="%{resource_path}">%{resource_title}</a> kohteessa <a href="%{participatory_space_url}">%{participatory_space_title}</a> on päättynyt.
@@ -55,5 +55,5 @@ fi:
55
55
  surveys:
56
56
  answer:
57
57
  invalid: Kyselyyn vastaaminen epäonnistui.
58
- spam_detected: Kyselyn vastaamisessa tapahtui virhe. Ehkä olit liian nopea, voisitko yrittää uudestaan?
58
+ spam_detected: Kyselyn vastaaminen epäonnistui. Ehkä olit liian nopea, voisitko yrittää uudestaan?
59
59
  success: Kyselyyn vastaaminen onnistui.
@@ -0,0 +1,59 @@
1
+ fr-CA:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Enquête terminée
5
+ decidim/surveys/opened_survey_event: Enquête commencée
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Enquête
10
+ other: Enquêtes
11
+ decidim/surveys/survey_answer:
12
+ one: Réponse
13
+ other: Réponses
14
+ decidim:
15
+ components:
16
+ surveys:
17
+ actions:
18
+ answer: Réponse
19
+ name: Enquête
20
+ settings:
21
+ global:
22
+ announcement: Annonce
23
+ step:
24
+ allow_answers: Autoriser les réponses
25
+ allow_unregistered: Autoriser les utilisateurs non inscrits à répondre à l'enquête
26
+ allow_unregistered_help: Si activé, aucun login ne sera nécessaire pour répondre à l'enquête. Cela peut conduire à des données pauvres ou non fiables et rend plus vulnérable aux attaques automatiques. A utiliser avec précaution !
27
+ announcement: Annonce
28
+ events:
29
+ surveys:
30
+ survey_closed:
31
+ email_intro: L'enquête %{resource_title} proposée dans %{participatory_space_title} est maintenant terminée.
32
+ email_outro: Vous venez de recevoir une notification venant de %{participatory_space_title}. Vous pouvez à tout moment arrêter de recevoir des notifications en suivant le lien précédent.
33
+ email_subject: L'enquête de l'espace participatif %{participatory_space_title} est terminée
34
+ notification_title: L'enquête <a href="%{resource_path}">%{resource_title}</a> ouverte dans <a href="%{participatory_space_url}">%{participatory_space_title}</a> est terminée.
35
+ survey_opened:
36
+ email_intro: 'L''enquête %{resource_title} est désormais ouverte dans l''espace participatif %{participatory_space_title}. Vous pouvez y participer depuis la page suivante :'
37
+ email_outro: Vous avez reçu cette notification car vous suivez l'espace participatif %{participatory_space_title}. Vous pouvez arrêter de recevoir ces notifications à partir du lien précédent.
38
+ email_subject: Une nouvelle enquête a été créée dans %{participatory_space_title}
39
+ notification_title: 'L''enquête <a href="%{resource_path}">%{resource_title}</a> est ouverte. Vous pouvez y participer en vous rendant sur le lien suivant : <a href="%{participatory_space_url}">%{participatory_space_title}</a>.'
40
+ metrics:
41
+ survey_answers:
42
+ description: Nombre d'enquêtes auxquelles ont répondu les utilisateurs
43
+ object: réponses aux enquêtes
44
+ title: Réponses aux enquêtes
45
+ surveys:
46
+ admin:
47
+ exports:
48
+ survey_user_answers: Réponses des participants à l'enquête
49
+ surveys:
50
+ update:
51
+ invalid: Erreurs lors de la sauvegarde de l'enquête.
52
+ success: Enquête enregistrée avec succès.
53
+ last_activity:
54
+ new_survey_at_html: "<span>Nouvelle enquête à %{link}</span>"
55
+ surveys:
56
+ answer:
57
+ invalid: Votre réponse à l'enquête comporte des erreurs.
58
+ spam_detected: Il y a eu un problème lors de la réponse au questionnaire. Peut-être avez-vous été trop rapide, pouvez-vous réessayer ?
59
+ success: Votre réponse à l'enquête a bien été enregistrée.
@@ -0,0 +1 @@
1
+ ga:
@@ -0,0 +1 @@
1
+ hr:
@@ -45,15 +45,15 @@ it:
45
45
  surveys:
46
46
  admin:
47
47
  exports:
48
- survey_user_answers: Risposte degli utente al questionario
48
+ survey_user_answers: Risposte dei partecipanti al sondaggio
49
49
  surveys:
50
50
  update:
51
- invalid: Ci sono stati degli errori durante il salvataggio dell'indagine.
52
- success: Il questionario è stato salvato correttamente.
51
+ invalid: Ci sono stati degli errori durante il salvataggio del sondaggio.
52
+ success: Sondaggio salvato correttamente.
53
53
  last_activity:
54
54
  new_survey_at_html: "<span>Nuovo sondaggio al %{link}</span>"
55
55
  surveys:
56
56
  answer:
57
- invalid: Ci sono stati degli errori durante il salvataggio dell'indagine.
58
- spam_detected: C'è stato un problema nella risposta al modulo. Forse sei stato troppo veloce, puoi riprovare?
59
- success: Il questionario è stato salvato correttamente.
57
+ invalid: Ci sono stati errori nel rispondere al sondaggio.
58
+ spam_detected: C'è stato un problema nelle risposte ai quesiti. Forse sei stato troppo veloce, puoi riprovare?
59
+ success: Le risposte sono state registrate correttamente.
@@ -0,0 +1,57 @@
1
+ ja:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: アンケートが終了しました
5
+ decidim/surveys/opened_survey_event: アンケートを開始
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ other: 調査
10
+ decidim/surveys/survey_answer:
11
+ other: 回答
12
+ decidim:
13
+ components:
14
+ surveys:
15
+ actions:
16
+ answer: 回答
17
+ name: 調査
18
+ settings:
19
+ global:
20
+ announcement: お知らせ
21
+ step:
22
+ allow_answers: 回答を許可
23
+ allow_unregistered: 未登録ユーザーがアンケートに回答できるようにする
24
+ allow_unregistered_help: 有効な場合、アンケートに回答するためにログインは必要ありません。 これにより、データが貧弱または信頼できない可能性があり、自動攻撃に対してより脆弱になります。注意して使用してください!
25
+ announcement: お知らせ
26
+ events:
27
+ surveys:
28
+ survey_closed:
29
+ email_intro: '%{resource_title} の調査 %{participatory_space_title} はクローズされました。'
30
+ email_outro: '%{participatory_space_title}をフォローしているため、この通知を受け取りました。前のリンクに続く通知の受信を停止することができます。'
31
+ email_subject: '%{participatory_space_title} でアンケートが完了しました'
32
+ notification_title: <a href="%{resource_path}">%{resource_title}の</a> <a href="%{participatory_space_url}">%{participatory_space_title}</a> の調査は終了しました。
33
+ survey_opened:
34
+ email_intro: '%{resource_title} のアンケート %{participatory_space_title} が公開されました。このページから参加できます:'
35
+ email_outro: '%{participatory_space_title}をフォローしているため、この通知を受け取りました。前のリンクに続く通知の受信を停止することができます。'
36
+ email_subject: '%{participatory_space_title} での新しい調査'
37
+ notification_title: <a href="%{resource_path}">%{resource_title}の</a> <a href="%{participatory_space_url}">%{participatory_space_title}の調査</a> が公開されました。
38
+ metrics:
39
+ survey_answers:
40
+ description: 回答したアンケート数
41
+ object: アンケートに対する答えは
42
+ title: アンケートへの回答
43
+ surveys:
44
+ admin:
45
+ exports:
46
+ survey_user_answers: アンケート参加者の回答
47
+ surveys:
48
+ update:
49
+ invalid: 調査の保存中に問題が発生しました。
50
+ success: アンケートを保存しました。
51
+ last_activity:
52
+ new_survey_at_html: "<span>新しい調査 %{link}</span>"
53
+ surveys:
54
+ answer:
55
+ invalid: アンケートの回答に問題がありました。
56
+ spam_detected: フォームに応答する際に問題が発生しました。もう一度試してみてください。
57
+ success: アンケートは正常に回答しました。
@@ -0,0 +1 @@
1
+ lt:
@@ -0,0 +1,61 @@
1
+ lv:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Aptauja beidzās
5
+ decidim/surveys/opened_survey_event: Aptauja sākās
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ zero: Aptaujas
10
+ one: Aptauja
11
+ other: Aptaujas
12
+ decidim/surveys/survey_answer:
13
+ zero: Atbildes
14
+ one: Atbilde
15
+ other: Atbildes
16
+ decidim:
17
+ components:
18
+ surveys:
19
+ actions:
20
+ answer: Atbilde
21
+ name: Aptauja
22
+ settings:
23
+ global:
24
+ announcement: Paziņojums
25
+ step:
26
+ allow_answers: Atļaut atbildes
27
+ allow_unregistered: Ļaujiet nereģistrētiem lietotājiem atbildēt uz jautājumiem aptaujā
28
+ allow_unregistered_help: Ja tā būs iespējota, nevajadzēs pierakstīties, lai atbildētu uz aptaujas jautājumiem. Tas var radīt neprecīzus vai neuzticamus datu, un tā būs jutīgāka pret automatizētiem uzbrukumiem. Lietojiet piesardzīgi!
29
+ announcement: Paziņojums
30
+ events:
31
+ surveys:
32
+ survey_closed:
33
+ email_intro: Aptauja %{resource_title} %{participatory_space_title} ir slēgta.
34
+ email_outro: Jūs saņēmāt šo paziņojumu, jo sekojat %{participatory_space_title}. Jūs varat atteikties no paziņojumu saņemšanas, sekojot iepriekšējai saitei.
35
+ email_subject: Aptauja ir pabeigta telpā %{participatory_space_title}
36
+ notification_title: Aptauja <a href="%{resource_path}">%{resource_title}</a> sadaļā <a href="%{participatory_space_url}">%{activatory_space_title}</a> ir pabeigta.
37
+ survey_opened:
38
+ email_intro: 'Aptauja %{resource_title}, kas atrodas %{participatory_space_title}, tagad ir atvērta. Jūs varat tajā piedalīties, izmantojot šo lapu:'
39
+ email_outro: Jūs saņēmāt šo paziņojumu, jo sekojat %{participatory_space_title}. Jūs varat atteikties no paziņojumu saņemšanas, sekojot iepriekšējai saitei.
40
+ email_subject: Jauna aptauja telpā %{participatory_space_title}
41
+ notification_title: Aptauja <a href="%{resource_path}">%{resource_title}</a> sadaļā <a href="%{participatory_space_url}">%{activatory_space_title}</a> tagad ir atvērta
42
+ metrics:
43
+ survey_answers:
44
+ description: Dalībnieka atbildēto aptaujas jautājumu skaits
45
+ object: atbildes uz aptaujas jautājumiem
46
+ title: Atbildes uz aptaujas jautājumiem
47
+ surveys:
48
+ admin:
49
+ exports:
50
+ survey_user_answers: Aptaujas dalībnieka atbildes
51
+ surveys:
52
+ update:
53
+ invalid: Saglabājot aptauju, radās problēma.
54
+ success: Aptauja ir veiksmīgi saglabāta
55
+ last_activity:
56
+ new_survey_at_html: "<span>Jauna aptauja %{link}</span>"
57
+ surveys:
58
+ answer:
59
+ invalid: Atbildot uz aptauju, radās problēma.
60
+ spam_detected: Atbildot uz aptaujas jautājumiem, radās problēma. Varbūt jūs esat rīkojies pārāk ātri, vai varat mēģināt vēlreiz?
61
+ success: Uz aptaujas jautājumiem ir veiksmīgi atbildēts.
@@ -0,0 +1 @@
1
+ mt:
@@ -26,6 +26,8 @@ pl:
26
26
  announcement: Ogłoszenie
27
27
  step:
28
28
  allow_answers: Pozwól odpowiedzi
29
+ allow_unregistered: Pozwól niezarejestrowanym użytkownikom wypełnić ankietę
30
+ allow_unregistered_help: Jeśli jest aktywny, do wypełnienia ankiety nie będzie wymagane logowanie. Może to dać słabej jakości lub niewiarygodne dane i ankieta będzie bardziej podatna na automatyczne ataki. Zalecamy ostrożność!
29
31
  announcement: Ogłoszenie
30
32
  events:
31
33
  surveys:
@@ -57,4 +59,5 @@ pl:
57
59
  surveys:
58
60
  answer:
59
61
  invalid: Podczas odpowiadania na ankiet pojawiły się błędy.
60
- success: Ankieta odpowiedziała skutecznie.
62
+ spam_detected: Wystąpił błąd podczas udzielania odpowiedzi w formularzu. Spróbuj ponownie.
63
+ success: Twoja ankieta została przesłana.
@@ -1,4 +1,4 @@
1
- pt-BR:
1
+ pt:
2
2
  activemodel:
3
3
  models:
4
4
  decidim/surveys/closed_survey_event: Estudo finalizado
@@ -1,56 +1,59 @@
1
1
  pt:
2
2
  activemodel:
3
3
  models:
4
- decidim/surveys/closed_survey_event: Pesquisa finalizada
4
+ decidim/surveys/closed_survey_event: Inquérito terminado
5
5
  decidim/surveys/opened_survey_event: Inquérito iniciado
6
6
  activerecord:
7
7
  models:
8
8
  decidim/surveys/survey:
9
- one: Pesquisa
10
- other: pesquisas
9
+ one: Inquérito
10
+ other: Inquéritos
11
11
  decidim/surveys/survey_answer:
12
- one: Responda
12
+ one: Resposta
13
13
  other: Respostas
14
14
  decidim:
15
15
  components:
16
16
  surveys:
17
17
  actions:
18
- answer: Responda
19
- name: Pesquisa
18
+ answer: Responder
19
+ name: Inquérito
20
20
  settings:
21
21
  global:
22
22
  announcement: Anúncio
23
23
  step:
24
24
  allow_answers: Permitir respostas
25
+ allow_unregistered: Permitir que utilizadores não registados respondam ao inquérito
26
+ allow_unregistered_help: Caso esta opção esteja ativa, não será necessário iniciar sessão para responder ao inquérito. Isto poderá resultar em dados pouco fidedignos ou fiáveis e aumentará a vulnerabilidade a ataques automatizados. Utilizar com precaução!
25
27
  announcement: Anúncio
26
28
  events:
27
29
  surveys:
28
30
  survey_closed:
29
- email_intro: A pesquisa %{resource_title} em %{participatory_space_title} foi fechada.
30
- email_outro: Você recebeu esta notificação porque está seguindo %{participatory_space_title}. Você pode parar de receber notificações após o link anterior.
31
- email_subject: Uma pesquisa terminou em %{participatory_space_title}
32
- notification_title: A pesquisa <a href="%{resource_path}">%{resource_title}</a> em <a href="%{participatory_space_url}">%{participatory_space_title}</a> terminou.
31
+ email_intro: O inquérito %{resource_title} em %{participatory_space_title} foi encerrado.
32
+ email_outro: Recebeu esta notificação porque segue %{participatory_space_title}. Pode parar de receber notificações seguindo a hiperligação anterior.
33
+ email_subject: Um inquérito terminou em %{participatory_space_title}
34
+ notification_title: O inquérito <a href="%{resource_path}">%{resource_title}</a> em <a href="%{participatory_space_url}">%{participatory_space_title}</a> terminou.
33
35
  survey_opened:
34
- email_intro: 'A pesquisa %{resource_title} em %{participatory_space_title} está agora aberta. Você pode participar desta página:'
35
- email_outro: Você recebeu esta notificação porque está seguindo %{participatory_space_title}. Você pode parar de receber notificações após o link anterior.
36
- email_subject: Uma nova pesquisa em %{participatory_space_title}
37
- notification_title: A pesquisa <a href="%{resource_path}">%{resource_title}</a> em <a href="%{participatory_space_url}">%{participatory_space_title}</a> está agora aberta.
36
+ email_intro: 'O inquérito %{resource_title} em %{participatory_space_title} está agora aberto. Pode participar a partir desta página:'
37
+ email_outro: Recebeu esta notificação porque segue %{participatory_space_title}. Pode parar de receber notificações seguindo a hiperligação anterior.
38
+ email_subject: Um novo inquérito em %{participatory_space_title}
39
+ notification_title: O inquérito <a href="%{resource_path}">%{resource_title}</a> em <a href="%{participatory_space_url}">%{participatory_space_title}</a> está agora aberto.
38
40
  metrics:
39
41
  survey_answers:
40
- description: Número de pesquisas respondidas por usuários
41
- object: respostas para pesquisas
42
- title: Respostas para pesquisas
42
+ description: Número de inquéritos respondidos por participantes
43
+ object: respostas aos questionários
44
+ title: Respostas aos questionários
43
45
  surveys:
44
46
  admin:
45
47
  exports:
46
- survey_user_answers: Avalie as respostas dos usuários
48
+ survey_user_answers: Respostas dos participantes aos inquéritos
47
49
  surveys:
48
50
  update:
49
- invalid: Houve erros ao salvar a pesquisa.
50
- success: Pesquisa salva com sucesso.
51
+ invalid: Ocorreu um problema ao guardar o inquérito.
52
+ success: Inquérito guardado corretamente.
51
53
  last_activity:
52
- new_survey_at_html: "<span>Nova pesquisa em %{link}</span>"
54
+ new_survey_at_html: "<span>Novo inquérito em %{link}</span>"
53
55
  surveys:
54
56
  answer:
55
- invalid: Houve erros ao responder a pesquisa.
56
- success: Pesquisa respondida com sucesso.
57
+ invalid: Ocorreu um problema ao responder ao inquérito.
58
+ spam_detected: Ocorreu um problema ao responder ao formulário. Talvez tenha sido demasiado rápido, pode tentar novamente?
59
+ success: Inquérito respondido corretamente.
@@ -0,0 +1,61 @@
1
+ ro:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Sondaj terminat
5
+ decidim/surveys/opened_survey_event: Sondaj început
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Sondaj
10
+ few: Chestionare
11
+ other: Chestionare
12
+ decidim/surveys/survey_answer:
13
+ one: Răspuns
14
+ few: Răspunsuri
15
+ other: Răspunsuri
16
+ decidim:
17
+ components:
18
+ surveys:
19
+ actions:
20
+ answer: Răspuns
21
+ name: Sondaj
22
+ settings:
23
+ global:
24
+ announcement: Anunţ
25
+ step:
26
+ allow_answers: Permite răspunsuri
27
+ allow_unregistered: Permite utilizatorilor neînregistrați să răspundă la chestionar
28
+ allow_unregistered_help: Dacă este activ, nu va fi necesară nicio autentificare pentru a răspunde la chestionar. Acest lucru poate duce la date slabe sau nefiabile și va fi mai vulnerabil la atacuri automate. Utilizați cu prudență!
29
+ announcement: Anunţ
30
+ events:
31
+ surveys:
32
+ survey_closed:
33
+ email_intro: Sondajul %{resource_title} din %{participatory_space_title} a fost închis.
34
+ email_outro: Ați primit această notificare deoarece urmăriți %{participatory_space_title}. Puteți înceta să primiți notificări urmând linkul anterior.
35
+ email_subject: Un chestionar s-a terminat în %{participatory_space_title}
36
+ notification_title: Sondajul <a href="%{resource_path}">%{resource_title}</a> în <a href="%{participatory_space_url}">%{participatory_space_title}</a> s-a încheiat.
37
+ survey_opened:
38
+ email_intro: 'Sondajul %{resource_title} în %{participatory_space_title} este acum deschis. Puteți participa la acesta din această pagină:'
39
+ email_outro: Ați primit această notificare deoarece urmăriți %{participatory_space_title}. Puteți înceta să primiți notificări urmând linkul anterior.
40
+ email_subject: Un nou chestionar în %{participatory_space_title}
41
+ notification_title: Sondajul <a href="%{resource_path}">%{resource_title}</a> în <a href="%{participatory_space_url}">%{participatory_space_title}</a> este acum deschis.
42
+ metrics:
43
+ survey_answers:
44
+ description: Numărul de sondaje la care au răspuns participanții
45
+ object: răspunsuri la sondaje
46
+ title: Răspunsuri la chestionare
47
+ surveys:
48
+ admin:
49
+ exports:
50
+ survey_user_answers: Răspunsurile participanților la sondaj
51
+ surveys:
52
+ update:
53
+ invalid: A apărut o eroare la salvarea sondajului.
54
+ success: Chestionar salvat cu succes.
55
+ last_activity:
56
+ new_survey_at_html: "<span>Nou chestionar la %{link}</span>"
57
+ surveys:
58
+ answer:
59
+ invalid: A apărut o problemă în răspunsul la sondaj.
60
+ spam_detected: A apărut o problemă la răspunsul la formular. Poate aţi fost prea rapid, puteţi încerca din nou?
61
+ success: Sondaj răspuns cu succes.
@@ -0,0 +1,63 @@
1
+ sk:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Prieskum ukončený
5
+ decidim/surveys/opened_survey_event: Prieskum začal
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Prieskum
10
+ few: Prieskumy
11
+ many: Prieskumy
12
+ other: Prieskumy
13
+ decidim/surveys/survey_answer:
14
+ one: Odpoveď
15
+ few: Odpovede
16
+ many: Odpovede
17
+ other: Odpovede
18
+ decidim:
19
+ components:
20
+ surveys:
21
+ actions:
22
+ answer: Odpovedať
23
+ name: Prieskum
24
+ settings:
25
+ global:
26
+ announcement: Oznámenie
27
+ step:
28
+ allow_answers: Povoliť odpovede
29
+ allow_unregistered: Povoliť neregistrovaným užívateľom odpovedať na prieskum
30
+ allow_unregistered_help: Ak aktívne, pre hlasovanie v prieskume nebude potrebná registrácia na platforme. To môže viesť ku nespoľahlivým výsledkom a vyššej zraniteľnosti voči automatizovaným útokom. Opatrne!
31
+ announcement: Oznámenie
32
+ events:
33
+ surveys:
34
+ survey_closed:
35
+ email_intro: Prieskum %{resource_title} v %{participatory_space_title} bol uzatvorený.
36
+ email_outro: Túto notifikáciu ste dostali, pretože sledujete %{participatory_space_title}. Notifikácie môžete zrušiť po kliknutí na predchádzajúci odkaz.
37
+ email_subject: Prieskum bol ukončený v %{participatory_space_title}
38
+ notification_title: Prieskum <a href="%{resource_path}">%{resource_title}</a> v <a href="%{participatory_space_url}">%{participatory_space_title}</a> bol ukončený.
39
+ survey_opened:
40
+ email_intro: 'Prieskum %{resource_title} v %{participatory_space_title} bol práve otvorený. Môžete sa na ňom podieľať na tejto stránke:'
41
+ email_outro: Túto notifikáciu ste dostali, pretože sledujete %{participatory_space_title}. Notifikácie môžete zrušiť po kliknutí na predchádzajúci odkaz.
42
+ email_subject: Nový prieskum v %{participatory_space_title}
43
+ notification_title: Prieskum <a href="%{resource_path}">%{resource_title}</a> v <a href="%{participatory_space_url}">%{participatory_space_title}</a> bol práve otvorený.
44
+ metrics:
45
+ survey_answers:
46
+ description: Počet prieskumov, na ktoré odpovedali účastníci
47
+ object: odpovede na prieskumy
48
+ title: Odpovede na prieskumy
49
+ surveys:
50
+ admin:
51
+ exports:
52
+ survey_user_answers: Odpovede účastníkov prieskumu
53
+ surveys:
54
+ update:
55
+ invalid: Vyskytol sa problém s ukladaním prieskumu.
56
+ success: Prieskum úspešne uložený.
57
+ last_activity:
58
+ new_survey_at_html: "<span>Nový prieskum na %{link}</span>"
59
+ surveys:
60
+ answer:
61
+ invalid: Vyskytol sa problém s odpovedaním na prieskum.
62
+ spam_detected: Vyskytol sa problém s odpovedaním na formulár. Možno ste boli príliš rýchli, skúste prosíme znovu.
63
+ success: Odpoveď úspešne zaznamenaná.
@@ -0,0 +1,63 @@
1
+ sk:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Prieskum ukončený
5
+ decidim/surveys/opened_survey_event: Prieskum začal
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Prieskum
10
+ few: Prieskumy
11
+ many: Prieskumy
12
+ other: Prieskumy
13
+ decidim/surveys/survey_answer:
14
+ one: Odpoveď
15
+ few: Odpovede
16
+ many: Odpovede
17
+ other: Odpovede
18
+ decidim:
19
+ components:
20
+ surveys:
21
+ actions:
22
+ answer: Odpovedať
23
+ name: Prieskum
24
+ settings:
25
+ global:
26
+ announcement: Oznámenie
27
+ step:
28
+ allow_answers: Povoliť odpovede
29
+ allow_unregistered: Povoliť neregistrovaným užívateľom odpovedať na prieskum
30
+ allow_unregistered_help: Ak aktívne, pre hlasovanie v prieskume nebude potrebná registrácia na platforme. To môže viesť ku nespoľahlivým výsledkom a vyššej zraniteľnosti voči automatizovaným útokom. Opatrne!
31
+ announcement: Oznámenie
32
+ events:
33
+ surveys:
34
+ survey_closed:
35
+ email_intro: Prieskum %{resource_title} v %{participatory_space_title} bol uzatvorený.
36
+ email_outro: Túto notifikáciu ste dostali, pretože sledujete %{participatory_space_title}. Notifikácie môžete zrušiť po kliknutí na predchádzajúci odkaz.
37
+ email_subject: Prieskum bol ukončený v %{participatory_space_title}
38
+ notification_title: Prieskum <a href="%{resource_path}">%{resource_title}</a> v <a href="%{participatory_space_url}">%{participatory_space_title}</a> bol ukončený.
39
+ survey_opened:
40
+ email_intro: 'Prieskum %{resource_title} v %{participatory_space_title} bol práve otvorený. Môžete sa na ňom podieľať na tejto stránke:'
41
+ email_outro: Túto notifikáciu ste dostali, pretože sledujete %{participatory_space_title}. Notifikácie môžete zrušiť po kliknutí na predchádzajúci odkaz.
42
+ email_subject: Nový prieskum v %{participatory_space_title}
43
+ notification_title: Prieskum <a href="%{resource_path}">%{resource_title}</a> v <a href="%{participatory_space_url}">%{participatory_space_title}</a> bol práve otvorený.
44
+ metrics:
45
+ survey_answers:
46
+ description: Počet prieskumov, na ktoré odpovedali účastníci
47
+ object: odpovede na prieskumy
48
+ title: Odpovede na prieskumy
49
+ surveys:
50
+ admin:
51
+ exports:
52
+ survey_user_answers: Odpovede účastníkov prieskumu
53
+ surveys:
54
+ update:
55
+ invalid: Vyskytol sa problém s ukladaním prieskumu.
56
+ success: Prieskum úspešne uložený.
57
+ last_activity:
58
+ new_survey_at_html: "<span>Nový prieskum na %{link}</span>"
59
+ surveys:
60
+ answer:
61
+ invalid: Vyskytol sa problém s odpovedaním na prieskum.
62
+ spam_detected: Vyskytol sa problém s odpovedaním na formulár. Možno ste boli príliš rýchli, skúste prosíme znovu.
63
+ success: Odpoveď úspešne zaznamenaná.
@@ -0,0 +1,8 @@
1
+ sl:
2
+ activerecord:
3
+ models:
4
+ decidim/surveys/survey_answer:
5
+ one: Odgovor
6
+ two: Odgovora
7
+ few: Odgovorov
8
+ other: Odgovorov
@@ -0,0 +1 @@
1
+ sr:
@@ -15,13 +15,15 @@ sv:
15
15
  components:
16
16
  surveys:
17
17
  actions:
18
- answer: Svara
18
+ answer: Svar
19
19
  name: Enkät
20
20
  settings:
21
21
  global:
22
22
  announcement: Meddelande
23
23
  step:
24
24
  allow_answers: Tillåt svar
25
+ allow_unregistered: Tillåt ej registrerade användare att besvara enkäten
26
+ allow_unregistered_help: Om valt krävs det ingen inloggning för att besvara enkäten. Detta kan leda till dåliga eller opålitliga data och det kommer att vara mer sårbart för automatiserade attacker. Använd med försiktighet!
25
27
  announcement: Meddelande
26
28
  events:
27
29
  surveys:
@@ -53,4 +55,5 @@ sv:
53
55
  surveys:
54
56
  answer:
55
57
  invalid: Det gick inte att besvara enkäten.
58
+ spam_detected: Det gick inte att svara på formuläret. Du hade kanske för bråttom, kan du försöka igen?
56
59
  success: Enkäten har besvarats.
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Rails/Output
4
+ # rubocop:disable Style/GuardClause
5
+ class CheckLegacyTables < ActiveRecord::Migration[5.2]
6
+ class Answer < ApplicationRecord
7
+ self.table_name = :decidim_surveys_survey_answers
8
+ end
9
+
10
+ class AnswerChoice < ApplicationRecord
11
+ self.table_name = :decidim_surveys_survey_answer_choices
12
+ end
13
+
14
+ class AnswerOption < ApplicationRecord
15
+ self.table_name = :decidim_surveys_survey_answer_options
16
+ end
17
+
18
+ class Question < ApplicationRecord
19
+ self.table_name = :decidim_surveys_survey_questions
20
+ end
21
+
22
+ def up
23
+ if tables_exists.any?
24
+ if tables_exists.all?
25
+ migrate_legacy_data if Question.any?
26
+ else
27
+ puts "Some legacy surveys tables exist but not all. Have you migrated all the data?"
28
+ puts "Migrate or backup your data and then remove the following raise statement to continue with the migrations (that will remove surveys legacy tables)"
29
+ puts "For migrating your data you can do that with the command:"
30
+ puts "bundle exec rake decidim_surveys:migrate_data_to_decidim_forms"
31
+ raise "ERROR: there's the risk to loose legacy information from old surveys!"
32
+ end
33
+ end
34
+ end
35
+
36
+ def tables_exists
37
+ @tables_exists ||= [Answer, AnswerChoice, AnswerOption, Question].collect { |model| ActiveRecord::Base.connection.table_exists? model.table_name }
38
+ end
39
+
40
+ def migrate_legacy_data
41
+ puts "Migrating data from decidim_surveys tables to decidim_forms tables..."
42
+ ActiveRecord::Base.transaction do
43
+ Decidim::Surveys::Survey.find_each do |survey|
44
+ puts "Migrating survey #{survey.id}..."
45
+ if survey.questionnaire.present?
46
+ puts("already migrated at questionnaire #{survey.questionnaire.id}")
47
+ next
48
+ end
49
+
50
+ questionnaire = ::Decidim::Forms::Questionnaire.create!(
51
+ questionnaire_for: survey,
52
+ title: survey.title,
53
+ description: survey.description,
54
+ tos: survey.tos,
55
+ published_at: survey.published_at,
56
+ created_at: survey.created_at,
57
+ updated_at: survey.updated_at
58
+ )
59
+
60
+ Question.where(decidim_survey_id: survey.id).find_each do |survey_question|
61
+ puts "Migrating question #{survey_question.id}..."
62
+
63
+ question = ::Decidim::Forms::Question.create!(
64
+ questionnaire: questionnaire,
65
+ position: survey_question.position,
66
+ question_type: survey_question.question_type,
67
+ mandatory: survey_question.mandatory,
68
+ body: survey_question.body,
69
+ description: survey_question.description,
70
+ max_choices: survey_question.max_choices,
71
+ created_at: survey_question.created_at,
72
+ updated_at: survey_question.updated_at
73
+ )
74
+
75
+ # A hash with the old answer_option id as key, and the new form answer option as value
76
+ answer_option_mapping = {}
77
+
78
+ AnswerOption.where(decidim_survey_question_id: survey_question.id).find_each do |survey_answer_option|
79
+ answer_option_mapping[survey_answer_option.id] = ::Decidim::Forms::AnswerOption.create!(
80
+ question: question,
81
+ body: survey_answer_option.body,
82
+ free_text: survey_answer_option.free_text
83
+ )
84
+ end
85
+
86
+ Answer.where(decidim_survey_id: survey.id, decidim_survey_question_id: survey_question.id).find_each do |survey_answer|
87
+ answer = ::Decidim::Forms::Answer.new(
88
+ questionnaire: questionnaire,
89
+ question: question,
90
+ decidim_user_id: survey_answer.decidim_user_id,
91
+ body: survey_answer.body,
92
+ created_at: survey_answer.created_at,
93
+ updated_at: survey_answer.updated_at
94
+ )
95
+
96
+ AnswerChoice.where(decidim_survey_answer_id: survey_answer.id).find_each do |survey_answer_choice|
97
+ answer.choices.build(
98
+ answer_option: answer_option_mapping[survey_answer_choice.decidim_survey_answer_option_id],
99
+ body: survey_answer_choice.body,
100
+ custom_body: survey_answer_choice.custom_body,
101
+ position: survey_answer_choice.position
102
+ )
103
+ end
104
+
105
+ answer.save!
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
112
+ # rubocop:enable Style/GuardClause
113
+ # rubocop:enable Rails/Output
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveSurveyAnswerChoices < ActiveRecord::Migration[5.2]
4
+ def change
5
+ drop_table :decidim_surveys_survey_answer_choices, if_exists: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveSurveyAnswerOptions < ActiveRecord::Migration[5.2]
4
+ def change
5
+ drop_table :decidim_surveys_survey_answer_options, if_exists: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveSurveyAnswers < ActiveRecord::Migration[5.2]
4
+ def change
5
+ drop_table :decidim_surveys_survey_answers, if_exists: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveSurveyQuestions < ActiveRecord::Migration[5.2]
4
+ def change
5
+ drop_table :decidim_surveys_survey_questions, if_exists: true
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveSurveyColumns < ActiveRecord::Migration[5.2]
4
+ def change
5
+ remove_column :decidim_surveys_surveys, :title if ActiveRecord::Base.connection.column_exists?(:decidim_surveys_surveys, :title)
6
+ remove_column :decidim_surveys_surveys, :description if ActiveRecord::Base.connection.column_exists?(:decidim_surveys_surveys, :description)
7
+ remove_column :decidim_surveys_surveys, :tos if ActiveRecord::Base.connection.column_exists?(:decidim_surveys_surveys, :tos)
8
+ remove_column :decidim_surveys_surveys, :published_at if ActiveRecord::Base.connection.column_exists?(:decidim_surveys_surveys, :published_at)
9
+ end
10
+ end
@@ -136,5 +136,18 @@ Decidim.register_component(:surveys) do |component|
136
136
  question.answer_options.create!(body: Decidim::Faker::Localized.sentence)
137
137
  end
138
138
  end
139
+
140
+ %w(matrix_single matrix_multiple).each do |matrix_question_type|
141
+ question = Decidim::Forms::Question.create!(
142
+ questionnaire: questionnaire,
143
+ body: Decidim::Faker::Localized.paragraph,
144
+ question_type: matrix_question_type
145
+ )
146
+
147
+ 3.times do
148
+ question.answer_options.create!(body: Decidim::Faker::Localized.sentence)
149
+ question.matrix_rows.create!(body: Decidim::Faker::Localized.sentence)
150
+ end
151
+ end
139
152
  end
140
153
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-surveys version.
5
5
  module Surveys
6
6
  def self.version
7
- "0.21.0"
7
+ "0.22.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-surveys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
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: 2020-04-08 00:00:00.000000000 Z
13
+ date: 2020-09-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,70 +18,70 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.21.0
21
+ version: 0.22.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.21.0
28
+ version: 0.22.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-forms
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.21.0
35
+ version: 0.22.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.21.0
42
+ version: 0.22.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: decidim-admin
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.21.0
49
+ version: 0.22.0
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.21.0
56
+ version: 0.22.0
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: decidim-dev
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.21.0
63
+ version: 0.22.0
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.21.0
70
+ version: 0.22.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-participatory_processes
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.21.0
77
+ version: 0.22.0
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.21.0
84
+ version: 0.22.0
85
85
  description: A surveys component for decidim's participatory spaces.
86
86
  email:
87
87
  - josepjaume@gmail.com
@@ -117,9 +117,11 @@ files:
117
117
  - app/views/decidim/surveys/surveys/no_permission.html.erb
118
118
  - config/locales/ar-SA.yml
119
119
  - config/locales/ar.yml
120
+ - config/locales/bg-BG.yml
120
121
  - config/locales/ca.yml
121
122
  - config/locales/cs-CZ.yml
122
123
  - config/locales/cs.yml
124
+ - config/locales/da-DK.yml
123
125
  - config/locales/de.yml
124
126
  - config/locales/el-GR.yml
125
127
  - config/locales/el.yml
@@ -128,22 +130,35 @@ files:
128
130
  - config/locales/es-MX.yml
129
131
  - config/locales/es-PY.yml
130
132
  - config/locales/es.yml
133
+ - config/locales/et-EE.yml
131
134
  - config/locales/eu.yml
132
135
  - config/locales/fi-pl.yml
133
136
  - config/locales/fi-plain.yml
134
137
  - config/locales/fi.yml
138
+ - config/locales/fr-CA.yml
135
139
  - config/locales/fr.yml
140
+ - config/locales/ga-IE.yml
136
141
  - config/locales/gl.yml
142
+ - config/locales/hr-HR.yml
137
143
  - config/locales/hu.yml
138
144
  - config/locales/id-ID.yml
139
145
  - config/locales/is-IS.yml
140
146
  - config/locales/it.yml
147
+ - config/locales/ja-JP.yml
148
+ - config/locales/lt-LT.yml
149
+ - config/locales/lv-LV.yml
150
+ - config/locales/mt-MT.yml
141
151
  - config/locales/nl.yml
142
152
  - config/locales/no.yml
143
153
  - config/locales/pl.yml
144
154
  - config/locales/pt-BR.yml
145
155
  - config/locales/pt.yml
156
+ - config/locales/ro-RO.yml
146
157
  - config/locales/ru.yml
158
+ - config/locales/sk-SK.yml
159
+ - config/locales/sk.yml
160
+ - config/locales/sl.yml
161
+ - config/locales/sr-CS.yml
147
162
  - config/locales/sv.yml
148
163
  - config/locales/tr-TR.yml
149
164
  - config/locales/uk.yml
@@ -163,6 +178,12 @@ files:
163
178
  - db/migrate/20180405015258_add_free_text_to_survey_answer_options.rb
164
179
  - db/migrate/20180405015314_add_custom_body_to_survey_answer_choices.rb
165
180
  - db/migrate/20180406201818_add_position_to_decidim_survey_answer_choices.rb
181
+ - db/migrate/20200609090533_check_legacy_tables.rb
182
+ - db/migrate/20200610090533_remove_survey_answer_choices.rb
183
+ - db/migrate/20200610090650_remove_survey_answer_options.rb
184
+ - db/migrate/20200610090725_remove_survey_answers.rb
185
+ - db/migrate/20200610090845_remove_survey_questions.rb
186
+ - db/migrate/20200610105927_remove_survey_columns.rb
166
187
  - lib/decidim/surveys.rb
167
188
  - lib/decidim/surveys/admin.rb
168
189
  - lib/decidim/surveys/admin_engine.rb