decidim-surveys 0.16.1 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 654744db91db13ebf823d944de5c343602128335b20dcd193e0d60677de89e28
4
- data.tar.gz: c7e7b12d682fbeaef543148e1ec4cdc00298a03f62b6864bd46b78e2b6375494
3
+ metadata.gz: d7cc832dcf83b09bc9be7282728c0af249382c3b8b0b006e395a9435459f85a8
4
+ data.tar.gz: 7486b9258c6108d548c0fc56228bb8823f5e962a385fa0bb499441af8b0c6e54
5
5
  SHA512:
6
- metadata.gz: d37976b9d7ae48597b01c312a73fc16730e42122eeb93a27ba8009b3933f837a623660d26c653b40d2db6d6b1f8ed8da054bfc85b1c4666cc818e751b122267a
7
- data.tar.gz: 16433eb8ca2ee77828d2918e4513469c3705c017688d1ba9b42c62f0ec64571cc6168514e7d56accf72f3cb6c2ad663a20285c43055c8d1f54402d765f99805a
6
+ metadata.gz: 537eb06aef595787ae34f53b316f1d9aecc38d933996c0b445cdc2a492d5c2c77d90426c88d249b316964eb1a8c42d5f764ea3c5941ff9fd2678f0fcf2b9c56b
7
+ data.tar.gz: 79e9c8422d0338c117abe9636b73d1037704f0d5133b8f9857c37d5c37fdcb694d521415782a753357742a5db9a09e5a9b5bbef010d140541d861a9801fc6bc0
@@ -1,3 +1,5 @@
1
+ @import "decidim/forms/forms";
2
+
1
3
  form.answer-questionnaire{
2
4
  .radio-button-collection,
3
5
  .check-box-collection,
@@ -5,9 +5,16 @@ 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
+ helper Decidim::Surveys::SurveyHelper
8
9
 
9
10
  delegate :allow_answers?, to: :current_settings
10
11
 
12
+ before_action :check_permissions
13
+
14
+ def check_permissions
15
+ render :no_permission unless action_authorized_to(:answer, resource: survey).ok?
16
+ end
17
+
11
18
  def questionnaire_for
12
19
  survey
13
20
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Surveys
5
+ module SurveyHelper
6
+ def no_permission
7
+ render(
8
+ partial: "decidim/authorization_modals/content"
9
+ )
10
+ end
11
+
12
+ def resource
13
+ questionnaire_for
14
+ end
15
+
16
+ def current_component
17
+ @current_component ||= Decidim::Component.find(params[:component_id])
18
+ end
19
+
20
+ def authorization_action
21
+ @authorization_action ||= params[:authorization_action]
22
+ end
23
+
24
+ def authorize_action_path(handler_name)
25
+ authorizations.status_for(handler_name).current_path
26
+ end
27
+
28
+ def authorizations
29
+ @authorizations ||= action_authorized_to(:answer, resource: questionnaire_for)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -4,6 +4,7 @@ module Decidim
4
4
  module Surveys
5
5
  # The data store for a Survey in the Decidim::Surveys component.
6
6
  class Survey < Surveys::ApplicationRecord
7
+ include Decidim::Resourceable
7
8
  include Decidim::Forms::HasQuestionnaire
8
9
  include Decidim::HasComponent
9
10
 
@@ -0,0 +1,9 @@
1
+ <div class="row">
2
+ <div class="columns large-6 medium-centered">
3
+ <div class="card">
4
+ <div class="card__content">
5
+ <%= render partial: "decidim/authorization_modals/content" %>
6
+ </div>
7
+ </div>
8
+ </div>
9
+ </div>
@@ -45,8 +45,20 @@ ar:
45
45
  notification_title: المسح <a href="%{resource_path}">%{resource_title}</a> في <a href="%{participatory_space_url}">%{participatory_space_title}</a> مفتوح الآن.
46
46
  metrics:
47
47
  survey_answers:
48
+ description: عدد الاستطلاعات التي أجاب عليها المشاركون
48
49
  object: إجابات على الدراسات الاستقصائية
49
50
  title: إجابات للمسوحات
50
51
  surveys:
52
+ admin:
53
+ exports:
54
+ survey_user_answers: إجابات المشاركين في الاستطلاع
55
+ surveys:
56
+ update:
57
+ invalid: كانت هناك مشكلة في إنقاذ المسح.
58
+ success: تم حفظ الاستطلاع بنجاح.
51
59
  last_activity:
52
60
  new_survey_at_html: "<span>استطلاع جديد في %{link}</span>"
61
+ surveys:
62
+ answer:
63
+ invalid: كانت هناك مشكلة في الإجابة على الاستبيان.
64
+ success: مسح أجاب بنجاح.
@@ -37,20 +37,20 @@ ca:
37
37
  notification_title: L'enquesta <a href="%{resource_path}">%{resource_title}</a> en <a href="%{participatory_space_url}">%{participatory_space_title}</a> ja està oberta.
38
38
  metrics:
39
39
  survey_answers:
40
- description: Nombre d'enquestes contestades pels usuaris
40
+ description: Nombre d'enquestes contestades per les participants
41
41
  object: respostes a enquestes
42
42
  title: Respostes a enquestes
43
43
  surveys:
44
44
  admin:
45
45
  exports:
46
- survey_user_answers: Respostes dels usuaris
46
+ survey_user_answers: Respostes de les participants
47
47
  surveys:
48
48
  update:
49
- invalid: Hi ha hagut errors en desar l'enquesta.
49
+ invalid: S'ha produït un error en desar l'enquesta.
50
50
  success: Enquesta desada correctament.
51
51
  last_activity:
52
52
  new_survey_at_html: "<span>Nova enquesta a %{link}</span>"
53
53
  surveys:
54
54
  answer:
55
- invalid: Hi ha hagut errors en respondre a l'enquesta.
55
+ invalid: S'ha produït un error en respondre a l'enquesta.
56
56
  success: Enquesta resposta correctament.
@@ -0,0 +1,60 @@
1
+ cs:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Průzkum skončil
5
+ decidim/surveys/opened_survey_event: Průzkum začal
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Průzkum
10
+ few: Průzkumy
11
+ many: Průzkumy
12
+ other: Průzkumy
13
+ decidim/surveys/survey_answer:
14
+ one: Odpovědět
15
+ few: Odpovědi
16
+ many: Odpovědi
17
+ other: Odpovědi
18
+ decidim:
19
+ components:
20
+ surveys:
21
+ actions:
22
+ answer: Odpovědět
23
+ name: Průzkum
24
+ settings:
25
+ global:
26
+ announcement: Oznámení
27
+ step:
28
+ allow_answers: Povolte odpovědi
29
+ announcement: Oznámení
30
+ events:
31
+ surveys:
32
+ survey_closed:
33
+ email_intro: Průzkum %{resource_title} v %{participatory_space_title} byl uzavřen.
34
+ email_outro: Toto oznámení jste obdrželi, protože jste sledovali %{participatory_space_title}. Po předchozím propojení můžete přestat přijímat oznámení.
35
+ email_subject: Průzkum skončil v roce %{participatory_space_title}
36
+ notification_title: Průzkum <a href="%{resource_path}">%{resource_title}</a> v <a href="%{participatory_space_url}">%{participatory_space_title}</a> skončil.
37
+ survey_opened:
38
+ email_intro: 'Průzkum %{resource_title} v %{participatory_space_title} je nyní otevřený. Můžete se na ní podílet:'
39
+ email_outro: Toto oznámení jste obdrželi, protože jste sledovali %{participatory_space_title}. Po předchozím propojení můžete přestat přijímat oznámení.
40
+ email_subject: Nový průzkum v %{participatory_space_title}
41
+ notification_title: Průzkum <a href="%{resource_path}">%{resource_title}</a> v <a href="%{participatory_space_url}">%{participatory_space_title}</a> je nyní otevřený.
42
+ metrics:
43
+ survey_answers:
44
+ description: Počet průzkumů, které uživatelé zodpověděli
45
+ object: odpovědi na průzkumy
46
+ title: Odpovědi na průzkumy
47
+ surveys:
48
+ admin:
49
+ exports:
50
+ survey_user_answers: Zjištění uživatelských odpovědí
51
+ surveys:
52
+ update:
53
+ invalid: Při ukládání průzkumu došlo k chybám.
54
+ success: Průzkum byl úspěšně uložen.
55
+ last_activity:
56
+ new_survey_at_html: "<span>Nový průzkum na %{link}</span>"
57
+ surveys:
58
+ answer:
59
+ invalid: Při odpovědi na průzkum došlo k chybám.
60
+ success: Průzkum úspěšně odpověděl.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  en:
2
3
  activemodel:
3
4
  models:
@@ -37,20 +38,20 @@ en:
37
38
  notification_title: The survey <a href="%{resource_path}">%{resource_title}</a> in <a href="%{participatory_space_url}">%{participatory_space_title}</a> is now open.
38
39
  metrics:
39
40
  survey_answers:
40
- description: Number of surveys answered by users
41
+ description: Number of surveys answered by participants
41
42
  object: answers to surveys
42
43
  title: Answers to surveys
43
44
  surveys:
44
45
  admin:
45
46
  exports:
46
- survey_user_answers: Survey user answers
47
+ survey_user_answers: Survey participant answers
47
48
  surveys:
48
49
  update:
49
- invalid: There's been errors when saving the survey.
50
- success: Survey saved successfully.
50
+ invalid: There was a problem saving the survey.
51
+ success: Survey successfully saved.
51
52
  last_activity:
52
53
  new_survey_at_html: "<span>New survey at %{link}</span>"
53
54
  surveys:
54
55
  answer:
55
- invalid: There's been errors when answering the survey.
56
- success: Survey answered successfully.
56
+ invalid: There was a problem answering the survey.
57
+ success: Survey successfully answered.
@@ -37,20 +37,20 @@ es:
37
37
  notification_title: Ya está abierta la encuesta <a href="%{resource_path}">%{resource_title}</a> en <a href="%{participatory_space_url}">%{participatory_space_title}</a>.
38
38
  metrics:
39
39
  survey_answers:
40
- description: Número de encuestas respondidas por los usuarios
40
+ description: Número de encuestas respondidas por las participantes
41
41
  object: respuestas a encuestas
42
42
  title: Respuestas a encuestas
43
43
  surveys:
44
44
  admin:
45
45
  exports:
46
- survey_user_answers: Respuestas de los usuarios de la encuesta
46
+ survey_user_answers: Respuestas de las participantes de la encuesta
47
47
  surveys:
48
48
  update:
49
- invalid: Se han producido errores al guardar la encuesta.
49
+ invalid: Se ha producido un error al guardar la encuesta.
50
50
  success: Encuesta guardada correctamente.
51
51
  last_activity:
52
52
  new_survey_at_html: "<span>Nueva encuesta en %{link}</span>"
53
53
  surveys:
54
54
  answer:
55
- invalid: Se han producido errores al responder a la encuesta.
56
- success: La encuesta ha sido respondida con éxito.
55
+ invalid: Se ha producido un error al responder a la encuesta.
56
+ success: La encuesta se ha respondido correctamente.
@@ -0,0 +1,56 @@
1
+ fi-pl:
2
+ activemodel:
3
+ models:
4
+ decidim/surveys/closed_survey_event: Kysely päättyi
5
+ decidim/surveys/opened_survey_event: Kysely alkoi
6
+ activerecord:
7
+ models:
8
+ decidim/surveys/survey:
9
+ one: Kysely
10
+ other: Kyselyt
11
+ decidim/surveys/survey_answer:
12
+ one: Vastaus
13
+ other: Vastaukset
14
+ decidim:
15
+ components:
16
+ surveys:
17
+ actions:
18
+ answer: Vastaus
19
+ name: Kysely
20
+ settings:
21
+ global:
22
+ announcement: Ilmoitus
23
+ step:
24
+ allow_answers: Salli vastaukset
25
+ announcement: Ilmoitus
26
+ events:
27
+ surveys:
28
+ survey_closed:
29
+ email_intro: Kysely %{resource_title} kohteessa %{participatory_space_title} on suljettu.
30
+ email_outro: Tämä ilmoitus on lähetetty sinulle, koska seuraat kohdetta %{participatory_space_title}. Voit lopettaa ilmoitusten vastaanottamisen edellä esitetyn linkin kautta.
31
+ email_subject: Kysely on päättynyt kohteessa %{participatory_space_title}
32
+ notification_title: Kysely <a href="%{resource_path}">%{resource_title}</a> kohteessa <a href="%{participatory_space_url}">%{participatory_space_title}</a> on päättynyt.
33
+ survey_opened:
34
+ email_intro: 'Kysely %{resource_title} kohteessa %{participatory_space_title} on nyt auki. Voit osallistua siihen tällä sivulla:'
35
+ email_outro: Tämä ilmoitus on lähetetty sinulle, koska seuraat kohdetta %{participatory_space_title}. Voit lopettaa ilmoitusten vastaanottamisen edellä esitetyn linkin kautta.
36
+ email_subject: Uusi kysely kohteessa %{participatory_space_title}
37
+ notification_title: Kysely <a href="%{resource_path}">%{resource_title}</a> kohteessa <a href="%{participatory_space_url}">%{participatory_space_title}</a> on nyt auki.
38
+ metrics:
39
+ survey_answers:
40
+ description: Kyselyvastausten määrä
41
+ object: kyselyvastaukset
42
+ title: Kyselyvastaukset
43
+ surveys:
44
+ admin:
45
+ exports:
46
+ survey_user_answers: Kyselyn vastaukset
47
+ surveys:
48
+ update:
49
+ invalid: Kyselyn tallennus epäonnistui.
50
+ success: Kysely tallennettu onnistuneesti.
51
+ last_activity:
52
+ new_survey_at_html: "<span>Uusi kysely osoitteessa %{link}</span>"
53
+ surveys:
54
+ answer:
55
+ invalid: Kyselyyn vastaaminen epäonnistui.
56
+ success: Kyselyyn vastattu onnistuneesti.
@@ -43,14 +43,14 @@ fi:
43
43
  surveys:
44
44
  admin:
45
45
  exports:
46
- survey_user_answers: Kyselyn vastaukset
46
+ survey_user_answers: Kyselyiden vastaukset
47
47
  surveys:
48
48
  update:
49
49
  invalid: Kyselyn tallennus epäonnistui.
50
- success: Kysely tallennettu onnistuneesti.
50
+ success: Kyselyn tallennus onnistui.
51
51
  last_activity:
52
52
  new_survey_at_html: "<span>Uusi kysely osoitteessa %{link}</span>"
53
53
  surveys:
54
54
  answer:
55
55
  invalid: Kyselyyn vastaaminen epäonnistui.
56
- success: Kyselyyn vastattu onnistuneesti.
56
+ success: Kyselyyn vastaaminen onnistui.
@@ -35,8 +35,20 @@ id:
35
35
  notification_title: Survei <a href="%{resource_path}">%{resource_title}</a> di <a href="%{participatory_space_url}">%{participatory_space_title}</a> sekarang terbuka.
36
36
  metrics:
37
37
  survey_answers:
38
+ description: Jumlah survei dijawab oleh peserta
38
39
  object: jawaban untuk survei
39
40
  title: Jawaban untuk survei
40
41
  surveys:
42
+ admin:
43
+ exports:
44
+ survey_user_answers: Jawaban peserta survei
45
+ surveys:
46
+ update:
47
+ invalid: Terjadi masalah saat menyimpan survei.
48
+ success: Survei berhasil disimpan.
41
49
  last_activity:
42
50
  new_survey_at_html: "<span>Survei baru di %{link}</span>"
51
+ surveys:
52
+ answer:
53
+ invalid: Ada masalah saat menjawab survei.
54
+ success: Survei berhasil dijawab.
@@ -37,20 +37,20 @@ tr:
37
37
  notification_title: Anket <a href="%{resource_path}">%{resource_title}</a> <a href="%{participatory_space_url}">%{participatory_space_title}</a> açıktır.
38
38
  metrics:
39
39
  survey_answers:
40
- description: Kullanıcılar tarafından yanıtlanan anket sayısı
40
+ description: Katılımcılar tarafından cevaplanan anket sayısı
41
41
  object: anketlerin cevapları
42
42
  title: Anketlere verilen cevaplar
43
43
  surveys:
44
44
  admin:
45
45
  exports:
46
- survey_user_answers: Kullanıcı anket cevapları
46
+ survey_user_answers: Ankete katılanların cevapları
47
47
  surveys:
48
48
  update:
49
- invalid: Anketi kaydederken hatalar oluştu.
49
+ invalid: Anketi kaydederken bir sorun oluştu.
50
50
  success: Anket başarıyla kaydedildi.
51
51
  last_activity:
52
52
  new_survey_at_html: "<span> %{link}</span>yeni anket"
53
53
  surveys:
54
54
  answer:
55
- invalid: Anketi cevaplarken hatalar oldu.
56
- success: Anket başarıyla yanıtlandı.
55
+ invalid: Anketi cevaplarken bir sorun oluştu.
56
+ success: Anket başarıyla cevaplandı.
@@ -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.16.1"
7
+ "0.17.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.16.1
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -18,70 +18,70 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.16.1
21
+ version: 0.17.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.16.1
28
+ version: 0.17.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.16.1
35
+ version: 0.17.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.16.1
42
+ version: 0.17.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.16.1
49
+ version: 0.17.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.16.1
56
+ version: 0.17.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.16.1
63
+ version: 0.17.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.16.1
70
+ version: 0.17.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.16.1
77
+ version: 0.17.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.16.1
84
+ version: 0.17.0
85
85
  description: A surveys component for decidim's participatory spaces.
86
86
  email:
87
87
  - josepjaume@gmail.com
@@ -102,6 +102,7 @@ files:
102
102
  - app/controllers/decidim/surveys/surveys_controller.rb
103
103
  - app/events/decidim/surveys/closed_survey_event.rb
104
104
  - app/events/decidim/surveys/opened_survey_event.rb
105
+ - app/helpers/decidim/surveys/survey_helper.rb
105
106
  - app/jobs/decidim/surveys/settings_change_job.rb
106
107
  - app/models/decidim/surveys/application_record.rb
107
108
  - app/models/decidim/surveys/survey.rb
@@ -109,9 +110,11 @@ files:
109
110
  - app/permissions/decidim/surveys/permissions.rb
110
111
  - app/queries/decidim/surveys/metrics/answers_metric_manage.rb
111
112
  - app/queries/decidim/surveys/metrics/survey_participants_metric_measure.rb
113
+ - app/views/decidim/surveys/surveys/no_permission.html.erb
112
114
  - config/locales/ar-SA.yml
113
115
  - config/locales/ca.yml
114
116
  - config/locales/cs-CZ.yml
117
+ - config/locales/cs.yml
115
118
  - config/locales/de.yml
116
119
  - config/locales/en.yml
117
120
  - config/locales/es-MX.yml
@@ -119,6 +122,7 @@ files:
119
122
  - config/locales/es.yml
120
123
  - config/locales/eu.yml
121
124
  - config/locales/fi-pl.yml
125
+ - config/locales/fi-plain.yml
122
126
  - config/locales/fi.yml
123
127
  - config/locales/fr.yml
124
128
  - config/locales/gl.yml
@@ -169,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
173
  requirements:
170
174
  - - ">="
171
175
  - !ruby/object:Gem::Version
172
- version: '2.3'
176
+ version: '2.5'
173
177
  required_rubygems_version: !ruby/object:Gem::Requirement
174
178
  requirements:
175
179
  - - ">="