decidim-accountability 0.9.3 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6 +46 -0
  3. data/app/assets/javascripts/decidim/accountability/version_diff.js.es6 +2 -6
  4. data/app/commands/decidim/accountability/admin/create_result.rb +15 -0
  5. data/app/commands/decidim/accountability/admin/update_status.rb +1 -1
  6. data/app/commands/decidim/accountability/admin/update_timeline_entry.rb +1 -1
  7. data/app/controllers/decidim/accountability/admin/results_controller.rb +20 -0
  8. data/app/events/decidim/accountability/proposal_linked_event.rb +21 -0
  9. data/app/forms/decidim/accountability/admin/result_form.rb +13 -3
  10. data/app/models/decidim/accountability/result.rb +8 -1
  11. data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +44 -0
  12. data/app/views/decidim/accountability/admin/results/_form.html.erb +3 -5
  13. data/app/views/decidim/accountability/admin/results/_proposals.html.erb +12 -0
  14. data/app/views/decidim/accountability/results/_home_categories.html.erb +3 -3
  15. data/app/views/decidim/accountability/results/_home_header.html.erb +1 -1
  16. data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +12 -4
  17. data/app/views/decidim/accountability/results/_results_leaf.html.erb +1 -1
  18. data/app/views/decidim/accountability/results/_results_parent.html.erb +1 -1
  19. data/app/views/decidim/accountability/results/_show_leaf.html.erb +1 -1
  20. data/app/views/decidim/accountability/results/_show_parent.html.erb +1 -1
  21. data/app/views/decidim/accountability/results/_stats_box.html.erb +20 -2
  22. data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_results.html.erb +12 -0
  23. data/app/views/decidim/participatory_processes/participatory_process_groups/_result.html.erb +32 -0
  24. data/app/views/decidim/participatory_spaces/_highlighted_results.html.erb +14 -0
  25. data/app/views/decidim/participatory_spaces/_result.html.erb +32 -0
  26. data/config/locales/ca.yml +28 -1
  27. data/config/locales/en.yml +28 -1
  28. data/config/locales/es.yml +28 -1
  29. data/config/locales/eu.yml +28 -1
  30. data/config/locales/fi.yml +28 -1
  31. data/config/locales/fr.yml +28 -1
  32. data/config/locales/gl.yml +28 -1
  33. data/config/locales/it.yml +28 -1
  34. data/config/locales/nl.yml +28 -1
  35. data/config/locales/pl.yml +28 -6
  36. data/config/locales/pt-BR.yml +28 -1
  37. data/config/locales/pt.yml +28 -1
  38. data/config/locales/ru.yml +0 -1
  39. data/config/locales/sv.yml +28 -1
  40. data/config/locales/uk.yml +3 -3
  41. data/lib/decidim/accountability/admin_engine.rb +3 -0
  42. data/lib/decidim/accountability/engine.rb +34 -0
  43. data/lib/decidim/accountability/feature.rb +1 -0
  44. data/lib/decidim/accountability/version.rb +1 -1
  45. metadata +29 -22
  46. data/app/assets/javascripts/decidim/accountability/admin/accountability_admin.js +0 -9
@@ -9,9 +9,10 @@ pt:
9
9
  end_date: Data final
10
10
  progress: Progresso
11
11
  project_ids: Projetos incluídos
12
- proposal_ids: Propostas incluídas
12
+ proposals: Propostas incluídas
13
13
  start_date: Data de início
14
14
  title: Título
15
+ updated_at: Atualizado em
15
16
  status:
16
17
  description: Descrição
17
18
  key: Chave
@@ -49,11 +50,17 @@ pt:
49
50
  edit:
50
51
  title: Editar resultado
51
52
  update: Atualizar resultado
53
+ form:
54
+ add_proposal: Adicionar proposta
52
55
  index:
53
56
  title: Resultados
54
57
  new:
55
58
  create: Criar resultado
56
59
  title: Novo resultado
60
+ proposals:
61
+ close: Fechar
62
+ current_selection: Seleção atual
63
+ select: Selecione
57
64
  update:
58
65
  invalid: Ocorreu um problema ao atualizar este resultado
59
66
  success: Resultado atualizado com sucesso
@@ -94,6 +101,10 @@ pt:
94
101
  update:
95
102
  invalid: Ocorreu um problema ao atualizar esta entrada
96
103
  success: Entrada atualizada com sucesso
104
+ admin_log:
105
+ result:
106
+ create: "%{user_name} resultado criado %{resource_name} em %{space_name}"
107
+ update: "%{user_name} resultado atualizado %{resource_name} em %{space_name}"
97
108
  models:
98
109
  result:
99
110
  fields:
@@ -156,6 +167,13 @@ pt:
156
167
  changes_at_title: Alterações em "%{title}"
157
168
  version:
158
169
  version_index: Versão %{index}
170
+ events:
171
+ accountability:
172
+ proposal_linked:
173
+ email_intro: 'A proposta "%{proposal_title}" foi incluída em um resultado. Você pode vê-lo a partir desta página:'
174
+ email_outro: Você recebeu esta notificação porque está seguindo "%{proposal_title}". Você pode parar de receber notificações após o link anterior.
175
+ email_subject: Uma atualização para %{proposal_title}
176
+ notification_title: A proposta <a href="%{proposal_path}">%{proposal_title}</a> foi incluída no resultado <a href="%{resource_path}">%{resource_title}</a>.
159
177
  features:
160
178
  accountability:
161
179
  name: Prestação de contas
@@ -163,12 +181,21 @@ pt:
163
181
  global:
164
182
  categories_label: Nome para "Categorias"
165
183
  comments_enabled: Comentários ativados
184
+ display_progress_enabled: Mostrar progresso
166
185
  heading_leaf_level_results: Nome para "Projetos"
167
186
  heading_parent_level_results: Nome para "Resultados"
168
187
  intro: Introdução
169
188
  subcategories_label: Nome para "Subcategorias"
170
189
  step:
171
190
  comments_blocked: Comentários bloqueados
191
+ participatory_processes:
192
+ participatory_process_groups:
193
+ highlighted_results:
194
+ results: Resultados
195
+ participatory_spaces:
196
+ highlighted_results:
197
+ results: Resultados
198
+ see_all_results: Ver todos os resultados
172
199
  resource_links:
173
200
  included_projects:
174
201
  result_projects: Projetos incluídos neste resultado
@@ -9,7 +9,6 @@ ru:
9
9
  end_date: Дата завершения
10
10
  progress: Продвижение
11
11
  project_ids: Включенные проекты
12
- proposal_ids: Включенные предложения
13
12
  start_date: Дата начала
14
13
  title: Название
15
14
  status:
@@ -9,9 +9,10 @@ sv:
9
9
  end_date: Slutdatum
10
10
  progress: Framsteg
11
11
  project_ids: Inkluderade projekt
12
- proposal_ids: Ingår förslag
12
+ proposals: Ingår förslag
13
13
  start_date: Start datum
14
14
  title: Titel
15
+ updated_at: Uppdaterad på
15
16
  status:
16
17
  description: Beskrivning
17
18
  key: Nyckel
@@ -49,11 +50,17 @@ sv:
49
50
  edit:
50
51
  title: Ändra resultat
51
52
  update: Uppdateringsresultat
53
+ form:
54
+ add_proposal: Lägg till förslag
52
55
  index:
53
56
  title: Resultat
54
57
  new:
55
58
  create: Skapa resultat
56
59
  title: Nytt resultat
60
+ proposals:
61
+ close: Stänga
62
+ current_selection: Aktuellt urval
63
+ select: Välj
57
64
  update:
58
65
  invalid: Det har varit ett problem att uppdatera resultatet
59
66
  success: Resultatet uppdaterades med framgång
@@ -94,6 +101,10 @@ sv:
94
101
  update:
95
102
  invalid: Det har varit ett problem att uppdatera den här posten
96
103
  success: Inmatning uppdaterad
104
+ admin_log:
105
+ result:
106
+ create: "%{user_name} skapat resultat %{resource_name} i %{space_name}"
107
+ update: "%{user_name} uppdaterat resultat %{resource_name} i %{space_name}"
97
108
  models:
98
109
  result:
99
110
  fields:
@@ -156,6 +167,13 @@ sv:
156
167
  changes_at_title: Ändringar vid "%{title}"
157
168
  version:
158
169
  version_index: Version %{index}
170
+ events:
171
+ accountability:
172
+ proposal_linked:
173
+ email_intro: 'Förslaget "%{proposal_title}" har inkluderats i ett resultat. Du kan se den från den här sidan:'
174
+ email_outro: Du har fått den här meddelandet eftersom du följer "%{proposal_title}". Du kan sluta ta emot meddelanden efter föregående länk.
175
+ email_subject: En uppdatering till %{proposal_title}
176
+ notification_title: Förslaget <a href="%{proposal_path}">%{proposal_title}</a> har inkluderats i <a href="%{resource_path}">%{resource_title}</a> resultat.
159
177
  features:
160
178
  accountability:
161
179
  name: Ansvarighet
@@ -163,12 +181,21 @@ sv:
163
181
  global:
164
182
  categories_label: Namn för "kategorier"
165
183
  comments_enabled: Kommentarer aktiverade
184
+ display_progress_enabled: Visningsframsteg
166
185
  heading_leaf_level_results: Namn på "Projekt"
167
186
  heading_parent_level_results: Namn på "Resultat"
168
187
  intro: Intro
169
188
  subcategories_label: Namn på "Underkategorier"
170
189
  step:
171
190
  comments_blocked: Kommentarer blockerad
191
+ participatory_processes:
192
+ participatory_process_groups:
193
+ highlighted_results:
194
+ results: Resultat
195
+ participatory_spaces:
196
+ highlighted_results:
197
+ results: Resultat
198
+ see_all_results: Se alla resultat
172
199
  resource_links:
173
200
  included_projects:
174
201
  result_projects: Projekt som ingår i detta resultat
@@ -9,9 +9,9 @@ uk:
9
9
  end_date: Дата закінчення
10
10
  progress: Перебіг
11
11
  project_ids: Включені проекти
12
- proposal_ids: Включені пропозиції
13
12
  start_date: Дата початку
14
- title: Назва
13
+ title: Заголовок
14
+ updated_at: 'Оновлено:'
15
15
  status:
16
16
  description: Опис
17
17
  key: Ключ
@@ -101,7 +101,7 @@ uk:
101
101
  progress: Перебіг
102
102
  start_date: Дата початку
103
103
  status: Стан
104
- title: Назва
104
+ title: Заголовок
105
105
  status:
106
106
  fields:
107
107
  description: Опис
@@ -14,6 +14,9 @@ module Decidim
14
14
  resources :statuses
15
15
  resources :results, except: [:show] do
16
16
  resources :timeline_entries, except: [:show]
17
+ member do
18
+ get :proposals
19
+ end
17
20
  end
18
21
  root to: "results#index"
19
22
  end
@@ -22,6 +22,40 @@ module Decidim
22
22
  initializer "decidim_accountability.assets" do |app|
23
23
  app.config.assets.precompile += %w(decidim_accountability_manifest.js)
24
24
  end
25
+
26
+ initializer "decidim_accountability.view_hooks" do
27
+ Decidim.view_hooks.register(:participatory_space_highlighted_elements, priority: Decidim::ViewHooks::LOW_PRIORITY) do |view_context|
28
+ published_features = Decidim::Feature.where(participatory_space: view_context.current_participatory_space).published
29
+ results = Decidim::Accountability::Result.where(feature: published_features).order_randomly(rand * 2 - 1).limit(4)
30
+
31
+ next unless results.any?
32
+
33
+ view_context.extend Decidim::Accountability::ApplicationHelper
34
+ view_context.render(
35
+ partial: "decidim/participatory_spaces/highlighted_results",
36
+ locals: {
37
+ results: results
38
+ }
39
+ )
40
+ end
41
+
42
+ if defined? Decidim::ParticipatoryProcesses
43
+ Decidim::ParticipatoryProcesses.view_hooks.register(:process_group_highlighted_elements, priority: Decidim::ViewHooks::LOW_PRIORITY) do |view_context|
44
+ published_features = Decidim::Feature.where(participatory_space: view_context.participatory_processes).published
45
+ results = Decidim::Accountability::Result.where(feature: published_features).order_randomly(rand * 2 - 1).limit(4)
46
+
47
+ next unless results.any?
48
+
49
+ view_context.extend Decidim::Accountability::ApplicationHelper
50
+ view_context.render(
51
+ partial: "decidim/participatory_processes/participatory_process_groups/highlighted_results",
52
+ locals: {
53
+ results: results
54
+ }
55
+ )
56
+ end
57
+ end
58
+ end
25
59
  end
26
60
  end
27
61
  end
@@ -24,6 +24,7 @@ Decidim.register_feature(:accountability) do |feature|
24
24
  settings.attribute :subcategories_label, type: :string, translated: true, editor: true
25
25
  settings.attribute :heading_parent_level_results, type: :string, translated: true, editor: true
26
26
  settings.attribute :heading_leaf_level_results, type: :string, translated: true, editor: true
27
+ settings.attribute :display_progress_enabled, type: :boolean, default: true
27
28
  end
28
29
 
29
30
  feature.register_stat :results_count, primary: true, priority: Decidim::StatsRegistry::HIGH_PRIORITY do |features, _start_at, _end_at|
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-accountability version.
5
5
  module Accountability
6
6
  def self.version
7
- "0.9.3"
7
+ "0.10.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-accountability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.10.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: 2018-02-27 00:00:00.000000000 Z
13
+ date: 2018-03-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-comments
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.9.3
21
+ version: 0.10.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.9.3
28
+ version: 0.10.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-core
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.9.3
35
+ version: 0.10.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.9.3
42
+ version: 0.10.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: kaminari
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -74,98 +74,98 @@ dependencies:
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.9.3
77
+ version: 0.10.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.9.3
84
+ version: 0.10.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: decidim-assemblies
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.9.3
91
+ version: 0.10.0
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.9.3
98
+ version: 0.10.0
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-comments
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.9.3
105
+ version: 0.10.0
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.9.3
112
+ version: 0.10.0
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: decidim-dev
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - '='
118
118
  - !ruby/object:Gem::Version
119
- version: 0.9.3
119
+ version: 0.10.0
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - '='
125
125
  - !ruby/object:Gem::Version
126
- version: 0.9.3
126
+ version: 0.10.0
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: decidim-meetings
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - '='
132
132
  - !ruby/object:Gem::Version
133
- version: 0.9.3
133
+ version: 0.10.0
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - '='
139
139
  - !ruby/object:Gem::Version
140
- version: 0.9.3
140
+ version: 0.10.0
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: decidim-participatory_processes
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - '='
146
146
  - !ruby/object:Gem::Version
147
- version: 0.9.3
147
+ version: 0.10.0
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - '='
153
153
  - !ruby/object:Gem::Version
154
- version: 0.9.3
154
+ version: 0.10.0
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: decidim-proposals
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
159
  - - '='
160
160
  - !ruby/object:Gem::Version
161
- version: 0.9.3
161
+ version: 0.10.0
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - '='
167
167
  - !ruby/object:Gem::Version
168
- version: 0.9.3
168
+ version: 0.10.0
169
169
  description: An accountability component for decidim's participatory spaces.
170
170
  email:
171
171
  - josepjaume@gmail.com
@@ -181,7 +181,7 @@ files:
181
181
  - app/assets/config/decidim_accountability_manifest.js
182
182
  - app/assets/images/decidim/accountability/icon.svg
183
183
  - app/assets/javascripts/decidim/accountability/accountability.js.es6
184
- - app/assets/javascripts/decidim/accountability/admin/accountability_admin.js
184
+ - app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
185
185
  - app/assets/javascripts/decidim/accountability/version_diff.js.es6
186
186
  - app/assets/stylesheets/decidim/accountability/_accountability.scss
187
187
  - app/assets/stylesheets/decidim/accountability/accountability/_cards.scss
@@ -203,6 +203,7 @@ files:
203
203
  - app/controllers/decidim/accountability/result_widgets_controller.rb
204
204
  - app/controllers/decidim/accountability/results_controller.rb
205
205
  - app/controllers/decidim/accountability/versions_controller.rb
206
+ - app/events/decidim/accountability/proposal_linked_event.rb
206
207
  - app/forms/decidim/accountability/admin/result_form.rb
207
208
  - app/forms/decidim/accountability/admin/status_form.rb
208
209
  - app/forms/decidim/accountability/admin/timeline_entry_form.rb
@@ -212,11 +213,13 @@ files:
212
213
  - app/models/decidim/accountability/result.rb
213
214
  - app/models/decidim/accountability/status.rb
214
215
  - app/models/decidim/accountability/timeline_entry.rb
216
+ - app/presenters/decidim/accountability/admin_log/result_presenter.rb
215
217
  - app/services/decidim/accountability/diff_renderer.rb
216
218
  - app/services/decidim/accountability/result_search.rb
217
219
  - app/services/decidim/accountability/result_stats_calculator.rb
218
220
  - app/services/decidim/accountability/results_calculator.rb
219
221
  - app/views/decidim/accountability/admin/results/_form.html.erb
222
+ - app/views/decidim/accountability/admin/results/_proposals.html.erb
220
223
  - app/views/decidim/accountability/admin/results/edit.html.erb
221
224
  - app/views/decidim/accountability/admin/results/index.html.erb
222
225
  - app/views/decidim/accountability/admin/results/new.html.erb
@@ -250,6 +253,10 @@ files:
250
253
  - app/views/decidim/accountability/versions/_version.html.erb
251
254
  - app/views/decidim/accountability/versions/index.html.erb
252
255
  - app/views/decidim/accountability/versions/show.html.erb
256
+ - app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_results.html.erb
257
+ - app/views/decidim/participatory_processes/participatory_process_groups/_result.html.erb
258
+ - app/views/decidim/participatory_spaces/_highlighted_results.html.erb
259
+ - app/views/decidim/participatory_spaces/_result.html.erb
253
260
  - config/locales/ca.yml
254
261
  - config/locales/en.yml
255
262
  - config/locales/es.yml
@@ -301,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
308
  version: '0'
302
309
  requirements: []
303
310
  rubyforge_project:
304
- rubygems_version: 2.7.3
311
+ rubygems_version: 2.7.6
305
312
  signing_key:
306
313
  specification_version: 4
307
314
  summary: Decidim accountability module