decidim-accountability 0.1.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -21
  3. data/app/assets/javascripts/decidim/accountability/accountability.js.es6 +3 -3
  4. data/app/assets/javascripts/decidim/accountability/admin/accountability_admin.js +3 -2
  5. data/app/assets/stylesheets/decidim/accountability/accountability/_categories.scss +13 -13
  6. data/app/assets/stylesheets/decidim/accountability/accountability/_lines_breadcrumb.scss +5 -5
  7. data/app/assets/stylesheets/decidim/accountability/accountability/_results.scss +5 -5
  8. data/app/commands/decidim/accountability/admin/create_result.rb +0 -1
  9. data/app/commands/decidim/accountability/admin/update_result.rb +0 -5
  10. data/app/controllers/decidim/accountability/application_controller.rb +1 -1
  11. data/app/controllers/decidim/accountability/results_controller.rb +1 -12
  12. data/app/forms/decidim/accountability/admin/result_form.rb +0 -11
  13. data/app/helpers/decidim/accountability/application_helper.rb +8 -6
  14. data/app/models/decidim/accountability/result.rb +3 -10
  15. data/app/services/decidim/accountability/result_search.rb +6 -3
  16. data/app/services/decidim/accountability/result_stats_calculator.rb +2 -6
  17. data/app/services/decidim/accountability/results_calculator.rb +1 -1
  18. data/app/views/decidim/accountability/admin/results/_form.html.erb +0 -4
  19. data/app/views/decidim/accountability/admin/results/index.html.erb +5 -2
  20. data/app/views/decidim/accountability/admin/shared/_extra.html.erb +1 -0
  21. data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -3
  22. data/app/views/decidim/accountability/results/_home_categories.html.erb +15 -9
  23. data/app/views/decidim/accountability/results/_home_header.html.erb +12 -13
  24. data/app/views/decidim/accountability/results/_linked_results.html.erb +1 -1
  25. data/app/views/decidim/accountability/results/_results_leaf.html.erb +5 -3
  26. data/app/views/decidim/accountability/results/_results_parent.html.erb +5 -3
  27. data/app/views/decidim/accountability/results/_show_leaf.html.erb +14 -14
  28. data/app/views/decidim/accountability/results/_show_parent.html.erb +1 -1
  29. data/config/locales/ca.yml +9 -41
  30. data/config/locales/en.yml +8 -40
  31. data/config/locales/es.yml +9 -41
  32. data/config/locales/eu.yml +99 -21
  33. data/config/locales/fi.yml +101 -21
  34. data/config/locales/fr.yml +157 -0
  35. data/config/locales/it.yml +157 -0
  36. data/config/locales/nl.yml +157 -0
  37. data/config/locales/pl.yml +158 -0
  38. data/config/locales/ru.yml +159 -0
  39. data/config/locales/uk.yml +159 -0
  40. data/db/migrate/20170426104125_create_accountability_results.rb +0 -1
  41. data/db/migrate/20170508104902_add_description_and_progress_to_statuses.rb +2 -0
  42. data/db/migrate/20170623094200_migrate_accountability_results_category.rb +2 -0
  43. data/db/migrate/20170623144902_add_children_counter_cache_to_results.rb +2 -0
  44. data/db/migrate/20170928073905_migrate_old_results.rb +53 -0
  45. data/lib/decidim/accountability.rb +2 -1
  46. data/lib/decidim/accountability/admin_engine.rb +0 -2
  47. data/lib/decidim/accountability/{list_engine.rb → engine.rb} +1 -2
  48. data/lib/decidim/accountability/feature.rb +53 -19
  49. data/lib/decidim/accountability/result_serializer.rb +66 -0
  50. data/lib/decidim/accountability/test/factories.rb +16 -16
  51. data/lib/decidim/accountability/version.rb +10 -0
  52. metadata +111 -53
  53. data/app/commands/decidim/accountability/admin/update_template_texts.rb +0 -47
  54. data/app/controllers/decidim/accountability/admin/imports_controller.rb +0 -30
  55. data/app/controllers/decidim/accountability/admin/template_texts_controller.rb +0 -38
  56. data/app/forms/decidim/accountability/admin/template_texts_form.rb +0 -19
  57. data/app/models/decidim/accountability/template_texts.rb +0 -17
  58. data/app/services/decidim/accountability/csv_exporter.rb +0 -77
  59. data/app/services/decidim/accountability/csv_importer.rb +0 -106
  60. data/app/views/decidim/accountability/admin/imports/new.html.erb +0 -47
  61. data/app/views/decidim/accountability/admin/template_texts/_form.html.erb +0 -30
  62. data/app/views/decidim/accountability/admin/template_texts/edit.html.erb +0 -8
  63. data/app/views/decidim/accountability/results/_tags.html.erb +0 -10
  64. data/config/i18n-tasks.yml +0 -10
  65. data/db/migrate/20170508161109_create_template_texts.rb +0 -14
  66. data/db/migrate/20170606102902_add_index_to_accountability_results_on_external_id.rb +0 -5
@@ -0,0 +1,159 @@
1
+ ru:
2
+ activemodel:
3
+ attributes:
4
+ result:
5
+ decidim_accountability_status_id: состояние
6
+ decidim_category_id: Категория
7
+ decidim_scope_id: Охват
8
+ description: Описание
9
+ end_date: Дата завершения
10
+ progress: Продвижение
11
+ proposal_ids: Включенные предложения
12
+ start_date: Дата начала
13
+ title: Название
14
+ status:
15
+ description: Описание
16
+ key: Ключ
17
+ name: Имя
18
+ progress: Продвижение
19
+ timeline_entry:
20
+ description: Описание
21
+ entry_date: Дата
22
+ decidim:
23
+ accountability:
24
+ actions:
25
+ confirm_destroy: Вы действительно хотите удалить %{name}?
26
+ destroy: Удалить
27
+ edit: Редактировать
28
+ new: Добавить %{name}
29
+ preview: Предварительный просмотр
30
+ timeline_entries: Развитие проекта
31
+ title: Действия
32
+ admin:
33
+ exports:
34
+ results: Итоги
35
+ models:
36
+ result:
37
+ name: Итог
38
+ status:
39
+ name: Состояние
40
+ timeline_entry:
41
+ name: Запись на линии времени
42
+ results:
43
+ create:
44
+ invalid: При попытке добавить этот итог возникла проблема
45
+ success: Итог успешно создан
46
+ destroy:
47
+ success: Итог успешно удален
48
+ edit:
49
+ title: Редактировать итог
50
+ update: Обновить итог
51
+ index:
52
+ title: Итоги
53
+ new:
54
+ create: Создать итог
55
+ title: Новый итог
56
+ update:
57
+ invalid: При попытке обновить этот итог возникла проблема
58
+ success: Итог успешно обновлен
59
+ shared:
60
+ subnav:
61
+ statuses: Состояния
62
+ statuses:
63
+ create:
64
+ invalid: При попытке создать это состояние возникла проблема
65
+ success: Состояние успешно создано
66
+ destroy:
67
+ success: Состояние успешно удалено
68
+ edit:
69
+ title: Редактировать состояние
70
+ update: Обновить состояние
71
+ index:
72
+ title: Состояния
73
+ new:
74
+ create: Создать состояние
75
+ title: Новое состояние
76
+ update:
77
+ invalid: При попытке обновить это состояние возникла проблема
78
+ success: Состояние успешно обновлено
79
+ timeline_entries:
80
+ create:
81
+ invalid: При попытке создать эту запись возникла проблема
82
+ success: Запись успешно создана
83
+ destroy:
84
+ success: Запись успешно удалена
85
+ edit:
86
+ title: Редактировать запись
87
+ update: Обновить запись
88
+ index:
89
+ title: Записи на линии времени проекта
90
+ new:
91
+ create: Создать запись
92
+ title: Новая запись
93
+ update:
94
+ invalid: При попытке обновить эту запись возникла проблема
95
+ success: Запись успешно обновлена
96
+ models:
97
+ result:
98
+ fields:
99
+ end_date: Дата завершения
100
+ progress: Продвижение
101
+ start_date: Дата начала
102
+ status: Состояние
103
+ title: Название
104
+ status:
105
+ fields:
106
+ description: Описание
107
+ key: Ключ
108
+ name: Имя
109
+ progress: Продвижение
110
+ timeline_entry:
111
+ fields:
112
+ description: Описание
113
+ entry_date: Дата
114
+ results:
115
+ count:
116
+ results_count:
117
+ one: 1 итог
118
+ few: "%{count} итога"
119
+ many: "%{count} итогов"
120
+ other: "%{count} итога"
121
+ filters:
122
+ all: Все
123
+ global: Всеобщий
124
+ scopes: Охваты
125
+ home:
126
+ categories_label: Категории
127
+ subcategories_label: Подкатегории
128
+ home_header:
129
+ global_status: Состояние общего исполнения
130
+ nav_breadcrumb:
131
+ global: Всеобщее исполнение
132
+ search:
133
+ search: Поиск действий
134
+ show:
135
+ stats:
136
+ attendees: Участники
137
+ comments: Комментарии
138
+ contributions: Внесенные предложения
139
+ meetings: Встречи
140
+ proposals: Предложения
141
+ votes: Поддерживает
142
+ timeline:
143
+ title: Развитие проекта
144
+ features:
145
+ accountability:
146
+ name: Отчетность
147
+ settings:
148
+ global:
149
+ categories_label: Название для "Категории"
150
+ comments_enabled: Комментарии включены
151
+ heading_leaf_level_results: Название для "Проекты"
152
+ heading_parent_level_results: Название для "Результаты"
153
+ intro: Вступление
154
+ subcategories_label: Название для "Подкатегории"
155
+ step:
156
+ comments_blocked: Комментарии выключены
157
+ resource_links:
158
+ included_proposals:
159
+ result_proposals: Предложения, включенные в этот итог
@@ -0,0 +1,159 @@
1
+ uk:
2
+ activemodel:
3
+ attributes:
4
+ result:
5
+ decidim_accountability_status_id: стан
6
+ decidim_category_id: Розділ
7
+ decidim_scope_id: Обсяг
8
+ description: Опис
9
+ end_date: Дата закінчення
10
+ progress: Перебіг
11
+ proposal_ids: Включені пропозиції
12
+ start_date: Дата початку
13
+ title: Назва
14
+ status:
15
+ description: Опис
16
+ key: Ключ
17
+ name: Назва
18
+ progress: Перебіг
19
+ timeline_entry:
20
+ description: Опис
21
+ entry_date: Дата
22
+ decidim:
23
+ accountability:
24
+ actions:
25
+ confirm_destroy: Ви впевнені, що хочете видалити %{name}?
26
+ destroy: Видалити
27
+ edit: Редагувати
28
+ new: Додати %{name}
29
+ preview: Попередній перегляд
30
+ timeline_entries: Розвиток проекту
31
+ title: Дії
32
+ admin:
33
+ exports:
34
+ results: Підсумки
35
+ models:
36
+ result:
37
+ name: Підсумки
38
+ status:
39
+ name: Стан
40
+ timeline_entry:
41
+ name: Запис на лінії часу
42
+ results:
43
+ create:
44
+ invalid: При спробі створити ці підсумки виникла проблема
45
+ success: Підсумки успішно створено
46
+ destroy:
47
+ success: Підсумки успішно видалено
48
+ edit:
49
+ title: Редагувати підсумки
50
+ update: Оновити підсумки
51
+ index:
52
+ title: Підсумки
53
+ new:
54
+ create: Створити підсумки
55
+ title: Нові підсумки
56
+ update:
57
+ invalid: При спробі оновити ці підсумки виникла проблема
58
+ success: Підсумки успішно оновлено
59
+ shared:
60
+ subnav:
61
+ statuses: Стани
62
+ statuses:
63
+ create:
64
+ invalid: При спробі створити цей стан виникла проблема
65
+ success: Стан успішно створено
66
+ destroy:
67
+ success: Стан успішно видалено
68
+ edit:
69
+ title: Редагувати стан
70
+ update: Оновити стан
71
+ index:
72
+ title: Стани
73
+ new:
74
+ create: Створити стан
75
+ title: Новий стан
76
+ update:
77
+ invalid: При спробі оновити цей стан виникла проблема
78
+ success: Стан успішно оновлено
79
+ timeline_entries:
80
+ create:
81
+ invalid: Виникла проблема зі створенням цього запису
82
+ success: Запис успішно створено
83
+ destroy:
84
+ success: Запис успішно видалено
85
+ edit:
86
+ title: Редагувати запис
87
+ update: Оновити запис
88
+ index:
89
+ title: Записи на лінії часу проекту
90
+ new:
91
+ create: Створити запис
92
+ title: Новий запис
93
+ update:
94
+ invalid: Під час оновлення цього запису виникла проблема
95
+ success: Запис успішно оновлено
96
+ models:
97
+ result:
98
+ fields:
99
+ end_date: Дата закінчення
100
+ progress: Перебіг
101
+ start_date: Дата початку
102
+ status: Стан
103
+ title: Назва
104
+ status:
105
+ fields:
106
+ description: Опис
107
+ key: Ключ
108
+ name: Назва
109
+ progress: Перебіг
110
+ timeline_entry:
111
+ fields:
112
+ description: Опис
113
+ entry_date: Дата
114
+ results:
115
+ count:
116
+ results_count:
117
+ one: 1 підсумок
118
+ few: "%{count} підсумків"
119
+ many: "%{count} підсумків"
120
+ other: "%{count} підсумків"
121
+ filters:
122
+ all: Усі
123
+ global: Загальний
124
+ scopes: Обсяги
125
+ home:
126
+ categories_label: Розділи
127
+ subcategories_label: Підрозділи
128
+ home_header:
129
+ global_status: Загальний стан виконання
130
+ nav_breadcrumb:
131
+ global: Загальне виконання
132
+ search:
133
+ search: Пошук дій
134
+ show:
135
+ stats:
136
+ attendees: Учасники
137
+ comments: Коментарі
138
+ contributions: Внесені пропозиції
139
+ meetings: Зустрічі
140
+ proposals: Пропозиції
141
+ votes: Підтримує
142
+ timeline:
143
+ title: Розвиток проекту
144
+ features:
145
+ accountability:
146
+ name: Звітність
147
+ settings:
148
+ global:
149
+ categories_label: Назва для "Розділи"
150
+ comments_enabled: Коментарі ввімкнено
151
+ heading_leaf_level_results: Назва для "Проекти"
152
+ heading_parent_level_results: Назва для "Підсумки"
153
+ intro: Вступ
154
+ subcategories_label: Назва для «Підрозділи»
155
+ step:
156
+ comments_blocked: Коментарі вимкнено
157
+ resource_links:
158
+ included_proposals:
159
+ result_proposals: Пропозиції, включені до цих підсумків
@@ -9,7 +9,6 @@ class CreateAccountabilityResults < ActiveRecord::Migration[5.0]
9
9
  t.date :start_date
10
10
  t.date :end_date
11
11
  t.decimal :progress, precision: 5, scale: 2
12
- t.string :external_id, index: true
13
12
  t.references :parent, index: { name: :decidim_accountability_results_on_parent_id }
14
13
  t.references :decidim_accountability_status, index: { name: :decidim_accountability_results_on_status_id }
15
14
  t.references :decidim_feature, index: true
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddDescriptionAndProgressToStatuses < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  add_column :decidim_accountability_statuses, :description, :jsonb
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class MigrateAccountabilityResultsCategory < ActiveRecord::Migration[5.1]
2
4
  def change
3
5
  # Create categorizations ensuring database integrity
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddChildrenCounterCacheToResults < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  add_column :decidim_accountability_results, :children_count, :integer, default: 0
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MigrateOldResults < ActiveRecord::Migration[5.1]
4
+ class OldResult < ApplicationRecord
5
+ self.table_name = :decidim_results_results
6
+ end
7
+
8
+ class Categorization < ApplicationRecord
9
+ self.table_name = :decidim_categorizations
10
+ end
11
+
12
+ class Result < ApplicationRecord
13
+ self.table_name = :decidim_accountability_results
14
+ end
15
+
16
+ class Feature < ApplicationRecord
17
+ self.table_name = :decidim_features
18
+ end
19
+
20
+ class ResourceLink < ApplicationRecord
21
+ self.table_name = :decidim_resource_links
22
+ end
23
+
24
+ def up
25
+ return unless ActiveRecord::Base.connection.data_source_exists? :decidim_results_results
26
+
27
+ # rubocop:disable Rails/SkipsModelValidations
28
+ OldResult.find_each do |old_result|
29
+ Result.create!(
30
+ id: old_result.id,
31
+ decidim_feature_id: old_result.decidim_feature_id,
32
+ decidim_scope_id: old_result.decidim_scope_id,
33
+ title: old_result.title,
34
+ description: old_result.description
35
+ )
36
+
37
+ Categorization.where(
38
+ categorizable_id: old_result.id,
39
+ categorizable_type: "Decidim::Results::Result"
40
+ ).update_all("categorizable_type = 'Decidim::Accountability::Result'")
41
+
42
+ ResourceLink.where(
43
+ from_id: old_result.id,
44
+ from_type: "Decidim::Results::Result"
45
+ ).update_all("from_type = 'Decidim::Accountability::Result'")
46
+ end
47
+
48
+ Feature.where(manifest_name: "results").update_all("manifest_name = 'accountability'")
49
+
50
+ drop_table :decidim_results_results
51
+ end
52
+ # rubocop:enable Rails/SkipsModelValidations
53
+ end
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "decidim/accountability/admin"
4
- require "decidim/accountability/list_engine"
4
+ require "decidim/accountability/engine"
5
5
  require "decidim/accountability/admin_engine"
6
6
  require "decidim/accountability/feature"
7
7
 
8
8
  module Decidim
9
9
  # Base module for this engine.
10
10
  module Accountability
11
+ autoload :ResultSerializer, "decidim/accountability/result_serializer"
11
12
  end
12
13
  end
@@ -11,12 +11,10 @@ module Decidim
11
11
  paths["db/migrate"] = nil
12
12
 
13
13
  routes do
14
- resource :template_texts
15
14
  resources :statuses
16
15
  resources :results, except: [:show] do
17
16
  resources :timeline_entries, except: [:show]
18
17
  end
19
- resource :import, only: [:new, :create]
20
18
  root to: "results#index"
21
19
  end
22
20
 
@@ -8,14 +8,13 @@ module Decidim
8
8
  # This is the engine that runs on the public interface of `decidim-accountability`.
9
9
  # It mostly handles rendering the created results associated to a participatory
10
10
  # process.
11
- class ListEngine < ::Rails::Engine
11
+ class Engine < ::Rails::Engine
12
12
  isolate_namespace Decidim::Accountability
13
13
 
14
14
  routes do
15
15
  resources :results, only: [:index, :show] do
16
16
  resource :result_widget, only: :show, path: "embed"
17
17
  end
18
- get "csv", to: "results#csv"
19
18
  root to: "results#home"
20
19
  end
21
20