decidim-accountability 0.28.6 → 0.29.0.rc1
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.
- checksums.yaml +4 -4
- data/app/cells/decidim/accountability/highlighted_results_for_component_cell.rb +0 -3
- data/app/cells/decidim/accountability/project_cell.rb +1 -6
- data/app/cells/decidim/accountability/result_l_cell.rb +1 -2
- data/app/cells/decidim/accountability/result_metadata_cell.rb +0 -6
- data/app/cells/decidim/accountability/results_cell.rb +0 -2
- data/app/cells/decidim/accountability/status_cell.rb +11 -8
- data/app/commands/decidim/accountability/admin/create_imported_result.rb +18 -85
- data/app/commands/decidim/accountability/admin/create_result.rb +12 -86
- data/app/commands/decidim/accountability/admin/create_status.rb +3 -31
- data/app/commands/decidim/accountability/admin/create_timeline_entry.rb +3 -30
- data/app/commands/decidim/accountability/admin/has_result_command.rb +54 -0
- data/app/commands/decidim/accountability/admin/update_imported_result.rb +16 -70
- data/app/commands/decidim/accountability/admin/update_result.rb +10 -72
- data/app/commands/decidim/accountability/admin/update_status.rb +3 -39
- data/app/commands/decidim/accountability/admin/update_timeline_entry.rb +3 -38
- data/app/controllers/decidim/accountability/admin/results_controller.rb +1 -1
- data/app/controllers/decidim/accountability/admin/statuses_controller.rb +7 -8
- data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +8 -8
- data/app/controllers/decidim/accountability/results_controller.rb +1 -21
- data/app/forms/decidim/accountability/admin/result_form.rb +1 -1
- data/app/forms/decidim/accountability/admin/timeline_entry_form.rb +1 -1
- data/app/helpers/decidim/accountability/application_helper.rb +0 -34
- data/app/helpers/decidim/accountability/breadcrumb_helper.rb +0 -4
- data/app/mailers/decidim/accountability/import_projects_mailer.rb +0 -3
- data/app/models/decidim/accountability/result.rb +1 -1
- data/app/models/decidim/accountability/status.rb +1 -1
- data/app/packs/src/decidim/accountability/index.js +1 -1
- data/app/services/decidim/accountability/results_csv_importer.rb +1 -1
- data/app/views/decidim/accountability/admin/results/index.html.erb +7 -15
- data/app/views/decidim/accountability/admin/statuses/index.html.erb +2 -2
- data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +1 -1
- data/app/views/decidim/accountability/import_projects_mailer/import.html.erb +1 -1
- data/app/views/decidim/accountability/results/_home_categories.html.erb +2 -2
- data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +8 -8
- data/app/views/decidim/accountability/results/_project.html.erb +1 -1
- data/app/views/decidim/accountability/results/_scope_filters.html.erb +3 -3
- data/app/views/decidim/participatory_spaces/_result.html.erb +3 -3
- data/config/locales/ar.yml +13 -90
- data/config/locales/bg.yml +10 -15
- data/config/locales/ca.yml +0 -12
- data/config/locales/cs.yml +0 -13
- data/config/locales/da.yml +4 -27
- data/config/locales/de.yml +3 -15
- data/config/locales/el.yml +8 -12
- data/config/locales/en.yml +0 -12
- data/config/locales/es-MX.yml +0 -12
- data/config/locales/es-PY.yml +0 -12
- data/config/locales/es.yml +0 -12
- data/config/locales/eu.yml +34 -46
- data/config/locales/fi-plain.yml +4 -16
- data/config/locales/fi.yml +15 -27
- data/config/locales/fr-CA.yml +8 -21
- data/config/locales/fr.yml +5 -18
- data/config/locales/ga-IE.yml +3 -11
- data/config/locales/gl.yml +6 -18
- data/config/locales/gn-PY.yml +0 -11
- data/config/locales/he-IL.yml +8 -14
- data/config/locales/hu.yml +11 -16
- data/config/locales/id-ID.yml +3 -21
- data/config/locales/is-IS.yml +6 -18
- data/config/locales/it.yml +3 -72
- data/config/locales/ja.yml +1 -13
- data/config/locales/kaa.yml +2 -2
- data/config/locales/ko.yml +6 -12
- data/config/locales/lb.yml +7 -19
- data/config/locales/lt.yml +10 -12
- data/config/locales/lv.yml +3 -24
- data/config/locales/nl.yml +3 -15
- data/config/locales/no.yml +3 -15
- data/config/locales/pl.yml +9 -12
- data/config/locales/pt-BR.yml +10 -16
- data/config/locales/pt.yml +0 -18
- data/config/locales/ro-RO.yml +16 -22
- data/config/locales/ru.yml +4 -22
- data/config/locales/si-LK.yml +0 -19
- data/config/locales/sk.yml +3 -24
- data/config/locales/sl.yml +3 -17
- data/config/locales/sq-AL.yml +7 -12
- data/config/locales/sr-CS.yml +3 -21
- data/config/locales/sv.yml +29 -80
- data/config/locales/th-TH.yml +6 -6
- data/config/locales/tr-TR.yml +6 -19
- data/config/locales/uk.yml +3 -24
- data/config/locales/zh-CN.yml +3 -23
- data/config/locales/zh-TW.yml +7 -12
- data/decidim-accountability.gemspec +2 -2
- data/lib/decidim/accountability/component.rb +0 -4
- data/lib/decidim/accountability/seeds.rb +76 -67
- data/lib/decidim/accountability/test/factories.rb +0 -4
- data/lib/decidim/accountability/version.rb +1 -1
- data/lib/decidim/api/accountability_type.rb +3 -1
- data/lib/decidim/api/result_type.rb +1 -1
- metadata +26 -31
- data/app/commands/decidim/accountability/admin/destroy_result.rb +0 -43
- data/app/services/decidim/accountability/result_stats_calculator.rb +0 -49
- data/app/views/decidim/accountability/results/_stats_box.html.erb +0 -79
- data/config/locales/bn-BD.yml +0 -1
- data/config/locales/bs-BA.yml +0 -175
- data/config/locales/ca-IT.yml +0 -304
data/config/locales/zh-TW.yml
CHANGED
@@ -85,7 +85,11 @@ zh-TW:
|
|
85
85
|
new:
|
86
86
|
create: 匯入
|
87
87
|
import_all_selected_projects: 匯入所有選擇的專案來實現
|
88
|
+
new_items:
|
89
|
+
other: "%{count} 個專案將匯入"
|
88
90
|
no_components: 在這個參與空間沒有預算元件來匯入專案到結果
|
91
|
+
origin_component_id: 原始元件
|
92
|
+
select_component: 選擇一個元件
|
89
93
|
success:
|
90
94
|
other: "%{count} 個專案已經排程匯入,完成後會寄送 email 通知."
|
91
95
|
results:
|
@@ -204,6 +208,9 @@ zh-TW:
|
|
204
208
|
other: "%{count} 個結果"
|
205
209
|
filters:
|
206
210
|
all: 全部
|
211
|
+
home:
|
212
|
+
categories_label: 類別
|
213
|
+
subcategories_label: 子類別
|
207
214
|
home_header:
|
208
215
|
global_status: 全域執行狀態
|
209
216
|
nav_breadcrumb:
|
@@ -212,15 +219,7 @@ zh-TW:
|
|
212
219
|
search: 搜尋操作
|
213
220
|
show:
|
214
221
|
stats:
|
215
|
-
attendees: 與會者
|
216
222
|
back_to_resource: 返回至結果
|
217
|
-
comments: 評論
|
218
|
-
contributions: 貢獻
|
219
|
-
last_edited_by: 最後編輯者
|
220
|
-
last_updated_at: 更新時間
|
221
|
-
meetings: 會議
|
222
|
-
proposals: 提案
|
223
|
-
votes: 支援
|
224
223
|
timeline:
|
225
224
|
title: 專案評估
|
226
225
|
admin:
|
@@ -239,16 +238,12 @@ zh-TW:
|
|
239
238
|
name: 問責
|
240
239
|
settings:
|
241
240
|
global:
|
242
|
-
categories_label: 類別名稱
|
243
241
|
comments_enabled: 已啟用留言
|
244
242
|
comments_max_length: 留言字數上限 (0 表示使用預設)
|
245
243
|
display_progress_enabled: 顯示進度
|
246
|
-
heading_leaf_level_results: 專案名稱
|
247
|
-
heading_parent_level_results: 結果名稱
|
248
244
|
intro: 介紹
|
249
245
|
scope_id: 範圍
|
250
246
|
scopes_enabled: 啟用的範圍
|
251
|
-
subcategories_label: 子類別名稱
|
252
247
|
step:
|
253
248
|
comments_blocked: 留言已封鎖
|
254
249
|
events:
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.version = Decidim::Accountability.version
|
11
11
|
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
|
12
12
|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
|
13
|
-
s.license = "AGPL-3.0
|
13
|
+
s.license = "AGPL-3.0"
|
14
14
|
s.homepage = "https://decidim.org"
|
15
15
|
s.metadata = {
|
16
16
|
"bug_tracker_uri" => "https://github.com/decidim/decidim/issues",
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
"homepage_uri" => "https://decidim.org",
|
20
20
|
"source_code_uri" => "https://github.com/decidim/decidim"
|
21
21
|
}
|
22
|
-
s.required_ruby_version = "~> 3.
|
22
|
+
s.required_ruby_version = "~> 3.2.0"
|
23
23
|
|
24
24
|
s.name = "decidim-accountability"
|
25
25
|
s.summary = "Decidim accountability module"
|
@@ -30,10 +30,6 @@ Decidim.register_component(:accountability) do |component|
|
|
30
30
|
settings.attribute :comments_enabled, type: :boolean, default: true
|
31
31
|
settings.attribute :comments_max_length, type: :integer, required: true
|
32
32
|
settings.attribute :intro, type: :text, translated: true, editor: true
|
33
|
-
settings.attribute :categories_label, type: :string, translated: true, editor: true
|
34
|
-
settings.attribute :subcategories_label, type: :string, translated: true, editor: true
|
35
|
-
settings.attribute :heading_parent_level_results, type: :string, translated: true, editor: true
|
36
|
-
settings.attribute :heading_leaf_level_results, type: :string, translated: true, editor: true
|
37
33
|
settings.attribute :display_progress_enabled, type: :boolean, default: true
|
38
34
|
end
|
39
35
|
|
@@ -4,7 +4,7 @@ require "decidim/components/namer"
|
|
4
4
|
|
5
5
|
module Decidim
|
6
6
|
module Accountability
|
7
|
-
class Seeds
|
7
|
+
class Seeds < Decidim::Seeds
|
8
8
|
attr_reader :participatory_space
|
9
9
|
|
10
10
|
def initialize(participatory_space:)
|
@@ -12,11 +12,20 @@ module Decidim
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
component = create_component!
|
16
|
+
|
17
|
+
create_statuses!(component:)
|
18
|
+
|
19
|
+
3.times do
|
20
|
+
categories = create_categories!
|
21
|
+
|
22
|
+
categories.each do |category|
|
23
|
+
create_result!(component:, category:)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
19
27
|
|
28
|
+
def create_component!
|
20
29
|
params = {
|
21
30
|
name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :accountability).i18n_name,
|
22
31
|
manifest_name: :accountability,
|
@@ -24,19 +33,17 @@ module Decidim
|
|
24
33
|
participatory_space:,
|
25
34
|
settings: {
|
26
35
|
intro: Decidim::Faker::Localized.wrapped("<p>", "</p>") { Decidim::Faker::Localized.sentence(word_count: 4) },
|
27
|
-
categories_label: Decidim::Faker::Localized.word,
|
28
|
-
subcategories_label: Decidim::Faker::Localized.word,
|
29
|
-
heading_parent_level_results: Decidim::Faker::Localized.word,
|
30
|
-
heading_leaf_level_results: Decidim::Faker::Localized.word,
|
31
36
|
scopes_enabled: true,
|
32
37
|
scope_id: participatory_space.scope&.id
|
33
38
|
}
|
34
39
|
}
|
35
40
|
|
36
|
-
|
41
|
+
Decidim.traceability.perform_action!("publish", Decidim::Component, admin_user, visibility: "all") do
|
37
42
|
Decidim::Component.create!(params)
|
38
43
|
end
|
44
|
+
end
|
39
45
|
|
46
|
+
def create_statuses!(component:)
|
40
47
|
5.times do |i|
|
41
48
|
Decidim::Accountability::Status.create!(
|
42
49
|
component:,
|
@@ -44,70 +51,72 @@ module Decidim
|
|
44
51
|
key: "status_#{i}"
|
45
52
|
)
|
46
53
|
end
|
54
|
+
end
|
47
55
|
|
48
|
-
|
49
|
-
|
50
|
-
|
56
|
+
def create_categories!
|
57
|
+
parent_category = participatory_space.categories.sample
|
58
|
+
categories = [parent_category]
|
51
59
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
2.times do
|
61
|
+
categories << Decidim::Category.create!(
|
62
|
+
name: Decidim::Faker::Localized.sentence(word_count: 5),
|
63
|
+
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
64
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
65
|
+
end,
|
66
|
+
parent: parent_category,
|
67
|
+
participatory_space:
|
68
|
+
)
|
69
|
+
end
|
62
70
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
categories
|
72
|
+
end
|
73
|
+
|
74
|
+
def create_result!(component:, category:)
|
75
|
+
result = Decidim.traceability.create!(
|
76
|
+
Decidim::Accountability::Result,
|
77
|
+
admin_user,
|
78
|
+
{
|
79
|
+
component:,
|
80
|
+
scope: participatory_space.organization.scopes.sample,
|
81
|
+
category:,
|
82
|
+
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
83
|
+
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
84
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
85
|
+
end
|
86
|
+
},
|
87
|
+
visibility: "all"
|
88
|
+
)
|
78
89
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
end
|
96
|
-
},
|
97
|
-
visibility: "all"
|
98
|
-
)
|
99
|
-
|
100
|
-
rand(0..5).times do |i|
|
101
|
-
child_result.timeline_entries.create!(
|
102
|
-
entry_date: child_result.start_date + i.days,
|
103
|
-
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
104
|
-
description: Decidim::Faker::Localized.paragraph(sentence_count: 1)
|
105
|
-
)
|
90
|
+
Decidim::Comments::Seed.comments_for(result)
|
91
|
+
|
92
|
+
3.times do
|
93
|
+
child_result = Decidim.traceability.create!(
|
94
|
+
Decidim::Accountability::Result,
|
95
|
+
admin_user,
|
96
|
+
{
|
97
|
+
component:,
|
98
|
+
parent: result,
|
99
|
+
start_date: Time.zone.today,
|
100
|
+
end_date: Time.zone.today + 10,
|
101
|
+
status: Decidim::Accountability::Status.all.sample,
|
102
|
+
progress: rand(1..100),
|
103
|
+
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
104
|
+
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
105
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
106
106
|
end
|
107
|
+
},
|
108
|
+
visibility: "all"
|
109
|
+
)
|
107
110
|
|
108
|
-
|
109
|
-
|
111
|
+
rand(0..5).times do |i|
|
112
|
+
child_result.timeline_entries.create!(
|
113
|
+
entry_date: child_result.start_date + i.days,
|
114
|
+
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
115
|
+
description: Decidim::Faker::Localized.paragraph(sentence_count: 1)
|
116
|
+
)
|
110
117
|
end
|
118
|
+
|
119
|
+
Decidim::Comments::Seed.comments_for(child_result)
|
111
120
|
end
|
112
121
|
end
|
113
122
|
end
|
@@ -18,10 +18,6 @@ FactoryBot.define do
|
|
18
18
|
settings do
|
19
19
|
{
|
20
20
|
intro: generate_localized_description(:accountability_component_intro, skip_injection:),
|
21
|
-
categories_label: generate_localized_word(:accountability_component_categories_label, skip_injection:),
|
22
|
-
subcategories_label: generate_localized_word(:accountability_component_subcategories_label, skip_injection:),
|
23
|
-
heading_parent_level_results: generate_localized_word(:accountability_component_heading_parent_level_results, skip_injection:),
|
24
|
-
heading_leaf_level_results: generate_localized_word(:accountability_component_heading_leaf_level_results, skip_injection:),
|
25
21
|
scopes_enabled: true,
|
26
22
|
scope_id: participatory_space.scope&.id
|
27
23
|
}
|
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
|
-
class AccountabilityType < Decidim::
|
5
|
+
class AccountabilityType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::ComponentInterface
|
7
|
+
|
6
8
|
graphql_name "Accountability"
|
7
9
|
description "An accountability component of a participatory space."
|
8
10
|
|
@@ -22,7 +22,7 @@ module Decidim
|
|
22
22
|
field :weight, GraphQL::Types::Int, "The order of this result", null: false
|
23
23
|
field :external_id, GraphQL::Types::String, "The external ID for this result", null: true
|
24
24
|
|
25
|
-
field :children, [Decidim::Accountability::ResultType, { null: true }], "The
|
25
|
+
field :children, [Decidim::Accountability::ResultType, { null: true }], "The children's results", null: true
|
26
26
|
field :parent, Decidim::Accountability::ResultType, "The parent result", null: true
|
27
27
|
field :status, Decidim::Accountability::StatusType, "The status for this result", null: true
|
28
28
|
field :timeline_entries, [Decidim::Accountability::TimelineEntryType, { null: true }], "The timeline entries for this result", null: true
|
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.
|
4
|
+
version: 0.29.0.rc1
|
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:
|
13
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-comments
|
@@ -18,126 +18,126 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.29.0.rc1
|
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.
|
28
|
+
version: 0.29.0.rc1
|
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.
|
35
|
+
version: 0.29.0.rc1
|
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.
|
42
|
+
version: 0.29.0.rc1
|
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.
|
49
|
+
version: 0.29.0.rc1
|
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.
|
56
|
+
version: 0.29.0.rc1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: decidim-assemblies
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.
|
63
|
+
version: 0.29.0.rc1
|
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.
|
70
|
+
version: 0.29.0.rc1
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: decidim-comments
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
77
|
+
version: 0.29.0.rc1
|
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.
|
84
|
+
version: 0.29.0.rc1
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: decidim-dev
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - '='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.
|
91
|
+
version: 0.29.0.rc1
|
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.
|
98
|
+
version: 0.29.0.rc1
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: decidim-meetings
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
103
|
- - '='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.
|
105
|
+
version: 0.29.0.rc1
|
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.
|
112
|
+
version: 0.29.0.rc1
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: decidim-participatory_processes
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
117
|
- - '='
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.
|
119
|
+
version: 0.29.0.rc1
|
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.
|
126
|
+
version: 0.29.0.rc1
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
128
|
name: decidim-proposals
|
129
129
|
requirement: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
131
|
- - '='
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
133
|
+
version: 0.29.0.rc1
|
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.
|
140
|
+
version: 0.29.0.rc1
|
141
141
|
description: An accountability component for decidim's participatory spaces.
|
142
142
|
email:
|
143
143
|
- josepjaume@gmail.com
|
@@ -175,7 +175,7 @@ files:
|
|
175
175
|
- app/commands/decidim/accountability/admin/create_result.rb
|
176
176
|
- app/commands/decidim/accountability/admin/create_status.rb
|
177
177
|
- app/commands/decidim/accountability/admin/create_timeline_entry.rb
|
178
|
-
- app/commands/decidim/accountability/admin/
|
178
|
+
- app/commands/decidim/accountability/admin/has_result_command.rb
|
179
179
|
- app/commands/decidim/accountability/admin/import_projects_to_accountability.rb
|
180
180
|
- app/commands/decidim/accountability/admin/update_imported_result.rb
|
181
181
|
- app/commands/decidim/accountability/admin/update_result.rb
|
@@ -232,7 +232,6 @@ files:
|
|
232
232
|
- app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb
|
233
233
|
- app/queries/decidim/accountability/metrics/results_metric_manage.rb
|
234
234
|
- app/services/decidim/accountability/diff_renderer.rb
|
235
|
-
- app/services/decidim/accountability/result_stats_calculator.rb
|
236
235
|
- app/services/decidim/accountability/results_calculator.rb
|
237
236
|
- app/services/decidim/accountability/results_csv_importer.rb
|
238
237
|
- app/views/decidim/accountability/admin/import_results/new.html.erb
|
@@ -259,7 +258,6 @@ files:
|
|
259
258
|
- app/views/decidim/accountability/results/_projects_aside.html.erb
|
260
259
|
- app/views/decidim/accountability/results/_scope_filters.html.erb
|
261
260
|
- app/views/decidim/accountability/results/_search.html.erb
|
262
|
-
- app/views/decidim/accountability/results/_stats_box.html.erb
|
263
261
|
- app/views/decidim/accountability/results/home.html.erb
|
264
262
|
- app/views/decidim/accountability/results/index.html.erb
|
265
263
|
- app/views/decidim/accountability/results/index.js.erb
|
@@ -272,9 +270,6 @@ files:
|
|
272
270
|
- config/locales/ar.yml
|
273
271
|
- config/locales/bg-BG.yml
|
274
272
|
- config/locales/bg.yml
|
275
|
-
- config/locales/bn-BD.yml
|
276
|
-
- config/locales/bs-BA.yml
|
277
|
-
- config/locales/ca-IT.yml
|
278
273
|
- config/locales/ca.yml
|
279
274
|
- config/locales/cs-CZ.yml
|
280
275
|
- config/locales/cs.yml
|
@@ -381,7 +376,7 @@ files:
|
|
381
376
|
- lib/decidim/api/timeline_entry_type.rb
|
382
377
|
homepage: https://decidim.org
|
383
378
|
licenses:
|
384
|
-
- AGPL-3.0
|
379
|
+
- AGPL-3.0
|
385
380
|
metadata:
|
386
381
|
bug_tracker_uri: https://github.com/decidim/decidim/issues
|
387
382
|
documentation_uri: https://docs.decidim.org/
|
@@ -396,14 +391,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
396
391
|
requirements:
|
397
392
|
- - "~>"
|
398
393
|
- !ruby/object:Gem::Version
|
399
|
-
version: 3.
|
394
|
+
version: 3.2.0
|
400
395
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
401
396
|
requirements:
|
402
|
-
- - "
|
397
|
+
- - ">"
|
403
398
|
- !ruby/object:Gem::Version
|
404
|
-
version:
|
399
|
+
version: 1.3.1
|
405
400
|
requirements: []
|
406
|
-
rubygems_version: 3.
|
401
|
+
rubygems_version: 3.4.10
|
407
402
|
signing_key:
|
408
403
|
specification_version: 4
|
409
404
|
summary: Decidim accountability module
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Accountability
|
5
|
-
module Admin
|
6
|
-
# This command is executed when the user destroys a Result from the admin
|
7
|
-
# panel.
|
8
|
-
class DestroyResult < Decidim::Command
|
9
|
-
# Initializes an UpdateResult Command.
|
10
|
-
#
|
11
|
-
# result - The current instance of the result to be destroyed.
|
12
|
-
# current_user - the user performing the action
|
13
|
-
def initialize(result, current_user)
|
14
|
-
@result = result
|
15
|
-
@current_user = current_user
|
16
|
-
end
|
17
|
-
|
18
|
-
# Destroys the result.
|
19
|
-
#
|
20
|
-
# Broadcasts :ok if successful, :invalid otherwise.
|
21
|
-
def call
|
22
|
-
destroy_result
|
23
|
-
|
24
|
-
broadcast(:ok)
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
attr_reader :result, :current_user
|
30
|
-
|
31
|
-
def destroy_result
|
32
|
-
Decidim.traceability.perform_action!(
|
33
|
-
:delete,
|
34
|
-
result,
|
35
|
-
current_user
|
36
|
-
) do
|
37
|
-
result.destroy!
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Accountability
|
5
|
-
# This class handles statistics of results. Needs a `result` in
|
6
|
-
# order to find the stats.
|
7
|
-
class ResultStatsCalculator
|
8
|
-
# Public: Initializes the service.
|
9
|
-
# result - The result from which to calculate the stats.
|
10
|
-
def initialize(result)
|
11
|
-
@result = result
|
12
|
-
end
|
13
|
-
|
14
|
-
delegate :count, to: :proposals, prefix: true
|
15
|
-
|
16
|
-
def votes_count
|
17
|
-
return 0 unless proposals
|
18
|
-
|
19
|
-
proposals.sum { |proposal| proposal.votes.size }
|
20
|
-
end
|
21
|
-
|
22
|
-
def comments_count
|
23
|
-
proposals.sum(:comments_count)
|
24
|
-
end
|
25
|
-
|
26
|
-
def attendees_count
|
27
|
-
meetings.where("attendees_count > 0").sum(:attendees_count)
|
28
|
-
end
|
29
|
-
|
30
|
-
def contributions_count
|
31
|
-
meetings.where("contributions_count > 0").sum(:contributions_count)
|
32
|
-
end
|
33
|
-
|
34
|
-
delegate :count, to: :meetings, prefix: true
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
attr_reader :result
|
39
|
-
|
40
|
-
def proposals
|
41
|
-
@proposals ||= result.linked_resources(:proposals, "included_proposals")
|
42
|
-
end
|
43
|
-
|
44
|
-
def meetings
|
45
|
-
@meetings ||= result.linked_resources(:meetings, "meetings_through_proposals")
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|