decidim-budgets 0.29.4 → 0.30.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/budgets/budget_list_item/vote_action.erb +2 -2
- data/app/cells/decidim/budgets/budgets_list/main_list.erb +1 -1
- data/app/cells/decidim/budgets/budgets_list/show.erb +1 -1
- data/app/cells/decidim/budgets/project_history_cell.rb +48 -0
- data/app/cells/decidim/budgets/project_metadata_cell.rb +3 -3
- data/app/cells/decidim/budgets/project_vote_button/show.erb +4 -2
- data/app/cells/decidim/budgets/project_vote_button_cell.rb +4 -0
- data/app/commands/decidim/budgets/admin/create_budget.rb +1 -1
- data/app/commands/decidim/budgets/admin/create_project.rb +1 -1
- data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +1 -8
- data/app/commands/decidim/budgets/admin/update_budget.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_project.rb +2 -2
- data/app/commands/decidim/budgets/admin/update_project_selection.rb +1 -1
- data/app/controllers/concerns/decidim/budgets/admin/filterable.rb +7 -11
- data/app/controllers/decidim/budgets/admin/budgets_controller.rb +12 -15
- data/app/controllers/decidim/budgets/admin/projects_controller.rb +61 -85
- data/app/controllers/decidim/budgets/orders_controller.rb +7 -3
- data/app/controllers/decidim/budgets/projects_controller.rb +7 -16
- data/app/forms/decidim/budgets/admin/budget_form.rb +0 -17
- data/app/forms/decidim/budgets/admin/order_reminder_form.rb +1 -2
- data/app/forms/decidim/budgets/admin/project_form.rb +7 -33
- data/app/forms/decidim/budgets/admin/project_import_proposals_form.rb +0 -11
- data/app/helpers/decidim/budgets/projects_helper.rb +6 -31
- data/app/models/decidim/budgets/budget.rb +2 -0
- data/app/models/decidim/budgets/project.rb +21 -1
- data/app/packs/stylesheets/budgets.scss +2 -8
- data/app/permissions/decidim/budgets/admin/permissions.rb +4 -4
- data/app/presenters/decidim/budgets/admin_log/budget_presenter.rb +1 -1
- data/app/presenters/decidim/budgets/admin_log/project_presenter.rb +1 -1
- data/app/presenters/decidim/budgets/project_presenter.rb +28 -0
- data/app/queries/decidim/budgets/filtered_projects.rb +2 -2
- data/app/queries/decidim/budgets/metrics/budget_followers_metric_measure.rb +2 -2
- data/app/queries/decidim/budgets/metrics/budget_participants_metric_measure.rb +2 -2
- data/app/serializers/decidim/budgets/download_your_data_budgets_order_serializer.rb +2 -2
- data/app/views/decidim/budgets/admin/budgets/_actions.html.erb +21 -0
- data/app/views/decidim/budgets/admin/budgets/_budget-tr.html.erb +18 -0
- data/app/views/decidim/budgets/admin/budgets/_budgets-thead.html.erb +8 -0
- data/app/views/decidim/budgets/admin/budgets/_form.html.erb +0 -6
- data/app/views/decidim/budgets/admin/budgets/index.html.erb +16 -48
- data/app/views/decidim/budgets/admin/budgets/manage_trash.html.erb +19 -0
- data/app/views/decidim/budgets/admin/projects/_actions.html.erb +27 -0
- data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +0 -2
- data/app/views/decidim/budgets/admin/projects/_form.html.erb +6 -8
- data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +2 -27
- data/app/views/decidim/budgets/admin/projects/_projects-thead.html.erb +14 -0
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +7 -10
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_taxonomy_change.html.erb +23 -0
- data/app/views/decidim/budgets/admin/projects/index.html.erb +19 -21
- data/app/views/decidim/budgets/admin/projects/manage_trash.html.erb +26 -0
- data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +1 -1
- data/app/views/decidim/budgets/admin/proposals_imports/new.html.erb +0 -5
- data/app/views/decidim/budgets/budgets/index.html.erb +7 -2
- data/app/views/decidim/budgets/order_summary_mailer/order_summary.html.erb +0 -10
- data/app/views/decidim/budgets/orders/status.html.erb +52 -0
- data/app/views/decidim/budgets/projects/_order.html.erb +1 -1
- data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +4 -4
- data/app/views/decidim/budgets/projects/index.html.erb +2 -17
- data/app/views/decidim/budgets/projects/index.js.erb +1 -1
- data/app/views/decidim/budgets/projects/show.html.erb +23 -20
- data/config/locales/ar.yml +4 -11
- data/config/locales/bg.yml +3 -43
- data/config/locales/ca.yml +96 -43
- data/config/locales/cs.yml +101 -42
- data/config/locales/de.yml +95 -42
- data/config/locales/el.yml +3 -39
- data/config/locales/en.yml +95 -42
- data/config/locales/es-MX.yml +95 -42
- data/config/locales/es-PY.yml +95 -42
- data/config/locales/es.yml +95 -42
- data/config/locales/eu.yml +95 -42
- data/config/locales/fi-plain.yml +96 -43
- data/config/locales/fi.yml +95 -42
- data/config/locales/fr-CA.yml +38 -44
- data/config/locales/fr.yml +38 -44
- data/config/locales/ga-IE.yml +0 -3
- data/config/locales/gl.yml +3 -7
- data/config/locales/hu.yml +3 -40
- data/config/locales/id-ID.yml +3 -5
- data/config/locales/is-IS.yml +0 -5
- data/config/locales/it.yml +3 -28
- data/config/locales/ja.yml +92 -42
- data/config/locales/kaa.yml +0 -1
- data/config/locales/ko.yml +0 -22
- data/config/locales/lb.yml +3 -5
- data/config/locales/lt.yml +3 -41
- data/config/locales/lv.yml +3 -5
- data/config/locales/nl.yml +3 -24
- data/config/locales/no.yml +3 -8
- data/config/locales/pl.yml +5 -43
- data/config/locales/pt-BR.yml +4 -43
- data/config/locales/pt.yml +4 -6
- data/config/locales/ro-RO.yml +3 -17
- data/config/locales/ru.yml +3 -5
- data/config/locales/sk.yml +3 -5
- data/config/locales/sq-AL.yml +0 -16
- data/config/locales/sv.yml +99 -46
- data/config/locales/tr-TR.yml +3 -7
- data/config/locales/uk.yml +3 -5
- data/config/locales/zh-CN.yml +3 -6
- data/config/locales/zh-TW.yml +3 -39
- data/db/migrate/20200827154129_add_commentable_counter_cache_to_projects.rb +1 -1
- data/db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb +1 -1
- data/db/migrate/20240828103724_add_deleted_at_to_decidim_budgets_budgets.rb +8 -0
- data/db/migrate/20240916135141_add_deleted_at_to_decidim_budgets_projects.rb +8 -0
- data/decidim-budgets.gemspec +1 -1
- data/lib/decidim/api/budget_type.rb +3 -6
- data/lib/decidim/api/budgets_type.rb +4 -5
- data/lib/decidim/api/project_type.rb +6 -8
- data/lib/decidim/budgets/admin_engine.rb +16 -2
- data/lib/decidim/budgets/component.rb +4 -5
- data/lib/decidim/budgets/engine.rb +1 -0
- data/lib/decidim/budgets/project_serializer.rb +16 -14
- data/lib/decidim/budgets/seeds.rb +0 -2
- data/lib/decidim/budgets/version.rb +1 -1
- metadata +27 -23
- data/app/cells/decidim/budgets/project_tags/show.erb +0 -5
- data/app/cells/decidim/budgets/project_tags_cell.rb +0 -18
- data/app/commands/decidim/budgets/admin/destroy_budget.rb +0 -17
- data/app/commands/decidim/budgets/admin/update_project_category.rb +0 -48
- data/app/commands/decidim/budgets/admin/update_project_scope.rb +0 -54
- data/app/helpers/decidim/budgets/admin/application_helper.rb +0 -13
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +0 -15
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +0 -22
- data/config/locales/ca-IT.yml +0 -388
data/config/locales/zh-TW.yml
CHANGED
@@ -3,15 +3,12 @@ zh-TW:
|
|
3
3
|
activemodel:
|
4
4
|
attributes:
|
5
5
|
budget:
|
6
|
-
decidim_scope_id: 範圍
|
7
6
|
description: 說明
|
8
7
|
title: 標題
|
9
8
|
total_budget: 總預算
|
10
9
|
weight: 排序位置
|
11
10
|
project:
|
12
11
|
budget_amount: 預算金額
|
13
|
-
decidim_category_id: 類別
|
14
|
-
decidim_scope_id: 範圍
|
15
12
|
description: 說明
|
16
13
|
proposal_ids: 相關提案
|
17
14
|
proposals: 提案
|
@@ -27,10 +24,6 @@ zh-TW:
|
|
27
24
|
admin:
|
28
25
|
filters:
|
29
26
|
projects:
|
30
|
-
category_id_eq:
|
31
|
-
label: 類別
|
32
|
-
scope_id_eq:
|
33
|
-
label: 範圍
|
34
27
|
selected_at_null:
|
35
28
|
label: 已選取
|
36
29
|
values:
|
@@ -40,7 +33,6 @@ zh-TW:
|
|
40
33
|
actions:
|
41
34
|
attachment_collections: 資料夾
|
42
35
|
attachments: 附件
|
43
|
-
destroy: 刪除
|
44
36
|
edit: 編輯
|
45
37
|
edit_projects: 管理專案
|
46
38
|
import: 將提案匯入專案
|
@@ -52,9 +44,6 @@ zh-TW:
|
|
52
44
|
create:
|
53
45
|
invalid: 建立預算時發生問題。
|
54
46
|
success: 預算已成功建立
|
55
|
-
destroy:
|
56
|
-
invalid: 刪除此預算時出現問題
|
57
|
-
success: 預算已成功刪除
|
58
47
|
edit:
|
59
48
|
title: 編輯預算
|
60
49
|
update: 更新預算
|
@@ -81,16 +70,12 @@ zh-TW:
|
|
81
70
|
create:
|
82
71
|
invalid: 這個專案創建時出了問題
|
83
72
|
success: 專案建立成功
|
84
|
-
destroy:
|
85
|
-
success: 專案刪除成功
|
86
73
|
edit:
|
87
74
|
title: 編輯專案
|
88
75
|
update: 更新
|
89
76
|
index:
|
90
77
|
actions: 操作
|
91
78
|
cancel: 撤銷
|
92
|
-
change_category: 變更類別
|
93
|
-
change_scope: 變更範圍
|
94
79
|
change_selected: 更改所選狀態
|
95
80
|
deselect_implementation: 從實施中取消選擇
|
96
81
|
finished_orders: 已完成投票
|
@@ -99,32 +84,15 @@ zh-TW:
|
|
99
84
|
selected: 已選取
|
100
85
|
title: 專案
|
101
86
|
update: 更新
|
102
|
-
update_scope_button: 更新範圍
|
103
87
|
new:
|
104
88
|
create: 建立
|
105
89
|
title: 新專案
|
106
90
|
update:
|
107
91
|
invalid: 更新此專案時出現問題
|
108
92
|
success: 專案更新成功。
|
109
|
-
update_category:
|
110
|
-
invalid: '這些專案已經擁有了 %{subject_name} 類別: %{projects}'
|
111
|
-
select_a_category: 請選擇一個類別。
|
112
|
-
select_a_project: 請選擇一個專案
|
113
|
-
success: '已成功將以下專案更新至 %{subject_name} 類別: %{projects}。'
|
114
|
-
update_scope:
|
115
|
-
invalid: '這些專案已經有了 %{subject_name} 的範圍: %{projects}。'
|
116
|
-
select_a_project: 請選擇一個專案
|
117
|
-
select_a_scope: 請選擇一個範圍。
|
118
|
-
success: '已成功將以下專案更新至 %{subject_name} 範圍: %{projects}。'
|
119
93
|
update_selected:
|
120
|
-
invalid:
|
121
|
-
selected: '這些專案已被選擇以實施:%{projects}。'
|
122
|
-
unselected: '這些專案已從實施中取消選擇: %{projects}。'
|
123
94
|
select_a_project: 請選擇一個專案
|
124
95
|
select_a_selection: 請選擇實施狀態。
|
125
|
-
success:
|
126
|
-
selected: '這些專案已成功選擇實施:%{projects}。'
|
127
|
-
unselected: '這些專案已經成功從實施中取消選擇: %{projects}。'
|
128
96
|
proposals_imports:
|
129
97
|
create:
|
130
98
|
invalid: 將提案匯入專案時出現問題。
|
@@ -178,15 +146,16 @@ zh-TW:
|
|
178
146
|
total_budget: 總預算
|
179
147
|
project:
|
180
148
|
fields:
|
181
|
-
category: 類別
|
182
149
|
id: ID
|
183
150
|
title: 標題
|
151
|
+
order:
|
152
|
+
status:
|
153
|
+
title: 您的投票已成功接受
|
184
154
|
order_summary_mailer:
|
185
155
|
order_summary:
|
186
156
|
selected_projects: '你選擇的專案如下:'
|
187
157
|
subject: 您已經在 %{space_name} 參與空間投票
|
188
158
|
voted_on_space: 您已對「%{space_name}」參與空間的「%{budget_name}」預算進行投票。
|
189
|
-
voted_on_space_with_scope: 您已在%{scope_type} 的%{scope_name} 中,對%{space_name} 參與空間的%{budget_name} 預算進行了投票。
|
190
159
|
projects:
|
191
160
|
budget_confirm:
|
192
161
|
are_you_sure: 如果您改變了主意,稍後可以更改您的選票。
|
@@ -218,8 +187,6 @@ zh-TW:
|
|
218
187
|
message: 您的投票尚未被註冊,因為您尚未完成投票程序。您確定要退出投票嗎?
|
219
188
|
title: 您尚未投票
|
220
189
|
filters:
|
221
|
-
category: 類別
|
222
|
-
scope: 範圍
|
223
190
|
search: 搜尋
|
224
191
|
status: 狀態
|
225
192
|
status_values:
|
@@ -271,13 +238,10 @@ zh-TW:
|
|
271
238
|
errors:
|
272
239
|
budget_voting_rule_only_one: 僅能啟用一個投票規則。
|
273
240
|
budget_voting_rule_required: 必須啟用一種投票規則
|
274
|
-
geocoding_enabled: 地理編碼已啟用
|
275
241
|
landing_page_content: 預算網頁首頁
|
276
242
|
more_information_modal: 更多資訊彈出式視窗
|
277
243
|
projects_per_page: 每頁顯示專案
|
278
244
|
resources_permissions_enabled: 可為每個專案設定動作權限
|
279
|
-
scope_id: 範圍
|
280
|
-
scopes_enabled: 啟用範圍
|
281
245
|
title: 標題
|
282
246
|
total_budget: 總預算
|
283
247
|
vote_minimum_budget_projects_number: 最少需要投票的專案數量
|
@@ -4,6 +4,6 @@ class AddCommentableCounterCacheToProjects < ActiveRecord::Migration[5.2]
|
|
4
4
|
def change
|
5
5
|
add_column :decidim_budgets_projects, :comments_count, :integer, null: false, default: 0, index: true
|
6
6
|
Decidim::Budgets::Project.reset_column_information
|
7
|
-
Decidim::Budgets::Project.find_each(&:update_comments_count)
|
7
|
+
Decidim::Budgets::Project.unscoped.find_each(&:update_comments_count)
|
8
8
|
end
|
9
9
|
end
|
@@ -7,7 +7,7 @@ class AddFollowableCounterCacheToBudgets < ActiveRecord::Migration[5.2]
|
|
7
7
|
reversible do |dir|
|
8
8
|
dir.up do
|
9
9
|
Decidim::Budgets::Project.reset_column_information
|
10
|
-
Decidim::Budgets::Project.find_each do |record|
|
10
|
+
Decidim::Budgets::Project.unscoped.find_each do |record|
|
11
11
|
record.class.reset_counters(record.id, :follows)
|
12
12
|
end
|
13
13
|
end
|
data/decidim-budgets.gemspec
CHANGED
@@ -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.3.0"
|
23
23
|
|
24
24
|
s.name = "decidim-budgets"
|
25
25
|
s.summary = "Decidim budgets module"
|
@@ -3,19 +3,16 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Budgets
|
5
5
|
class BudgetType < Decidim::Api::Types::BaseObject
|
6
|
-
implements Decidim::Core::
|
6
|
+
implements Decidim::Core::TimestampsInterface
|
7
7
|
implements Decidim::Core::TraceableInterface
|
8
8
|
|
9
9
|
description "A budget"
|
10
10
|
|
11
|
+
field :description, Decidim::Core::TranslatedFieldType, "The description for this budget", null: false
|
11
12
|
field :id, GraphQL::Types::ID, "The internal ID of this budget", null: false
|
13
|
+
field :projects, [Decidim::Budgets::ProjectType, { null: true }], "The projects for this budget", null: false
|
12
14
|
field :title, Decidim::Core::TranslatedFieldType, "The title for this budget", null: false
|
13
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description for this budget", null: false
|
14
15
|
field :total_budget, GraphQL::Types::Int, "The total budget", null: false, camelize: false
|
15
|
-
field :created_at, Decidim::Core::DateTimeType, "When this budget was created", null: true
|
16
|
-
field :updated_at, Decidim::Core::DateTimeType, "When this budget was updated", null: true
|
17
|
-
|
18
|
-
field :projects, [Decidim::Budgets::ProjectType, { null: true }], "The projects for this budget", null: false
|
19
16
|
|
20
17
|
def self.authorized?(object, context)
|
21
18
|
super && object.visible?
|
@@ -6,16 +6,15 @@ module Decidim
|
|
6
6
|
graphql_name "Budgets"
|
7
7
|
description "A budget component of a participatory space."
|
8
8
|
|
9
|
-
field :
|
9
|
+
field :budget, Decidim::Budgets::BudgetType, "A single Budget object", null: true do
|
10
|
+
argument :id, GraphQL::Types::ID, "The id of the Budget requested", required: true
|
11
|
+
end
|
12
|
+
field :budgets, Decidim::Budgets::BudgetType.connection_type, "A collection of Budgets", null: true, connection: true
|
10
13
|
|
11
14
|
def budgets
|
12
15
|
Budget.where(component: object).includes(:component)
|
13
16
|
end
|
14
17
|
|
15
|
-
field :budget, Decidim::Budgets::BudgetType, null: true do
|
16
|
-
argument :id, GraphQL::Types::ID, required: true
|
17
|
-
end
|
18
|
-
|
19
18
|
def budget(**args)
|
20
19
|
Budget.where(component: object).find_by(id: args[:id])
|
21
20
|
end
|
@@ -3,21 +3,19 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Budgets
|
5
5
|
class ProjectType < Decidim::Api::Types::BaseObject
|
6
|
-
implements Decidim::Core::
|
6
|
+
implements Decidim::Core::TimestampsInterface
|
7
|
+
implements Decidim::Core::TaxonomizableInterface
|
7
8
|
implements Decidim::Core::AttachableInterface
|
8
9
|
implements Decidim::Comments::CommentableInterface
|
9
|
-
implements Decidim::Core::CategorizableInterface
|
10
10
|
|
11
11
|
description "A project"
|
12
12
|
|
13
|
-
field :id, GraphQL::Types::ID, "The internal ID for this project", null: false
|
14
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title for this project", null: true
|
15
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description for this project", null: true
|
16
13
|
field :budget_amount, GraphQL::Types::Int, "The budget amount for this project", null: true, camelize: false
|
17
|
-
field :
|
18
|
-
field :
|
19
|
-
field :updated_at, Decidim::Core::DateTimeType, "When this project was updated", null: true
|
14
|
+
field :description, Decidim::Core::TranslatedFieldType, "The description for this project", null: true
|
15
|
+
field :id, GraphQL::Types::ID, "The internal ID for this project", null: false
|
20
16
|
field :reference, GraphQL::Types::String, "The reference for this project", null: true
|
17
|
+
field :selected, GraphQL::Types::Boolean, "Whether this proposal is selected or not", method: :selected?, null: true
|
18
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title for this project", null: true
|
21
19
|
|
22
20
|
def self.authorized?(object, context)
|
23
21
|
context[:project] = object
|
@@ -13,13 +13,27 @@ module Decidim
|
|
13
13
|
|
14
14
|
routes do
|
15
15
|
resources :budgets do
|
16
|
+
collection do
|
17
|
+
get :manage_trash
|
18
|
+
end
|
19
|
+
|
20
|
+
member do
|
21
|
+
patch :soft_delete
|
22
|
+
patch :restore
|
23
|
+
end
|
24
|
+
|
16
25
|
resources :projects do
|
17
26
|
collection do
|
18
|
-
post :
|
19
|
-
post :update_scope
|
27
|
+
post :update_taxonomies
|
20
28
|
post :update_selected
|
21
29
|
post :update_budget
|
22
30
|
resource :proposals_import, only: [:new, :create]
|
31
|
+
get :manage_trash
|
32
|
+
end
|
33
|
+
|
34
|
+
member do
|
35
|
+
patch :soft_delete
|
36
|
+
patch :restore
|
23
37
|
end
|
24
38
|
end
|
25
39
|
end
|
@@ -46,8 +46,8 @@ Decidim.register_component(:budgets) do |component|
|
|
46
46
|
component.register_stat :orders_count do |components, start_at, end_at|
|
47
47
|
budgets = Decidim::Budgets::Budget.where(component: components)
|
48
48
|
orders = Decidim::Budgets::Order.where(budget: budgets)
|
49
|
-
orders = orders.where(
|
50
|
-
orders = orders.where(
|
49
|
+
orders = orders.where(created_at: start_at..) if start_at.present?
|
50
|
+
orders = orders.where(created_at: ..end_at) if end_at.present?
|
51
51
|
orders.count
|
52
52
|
end
|
53
53
|
|
@@ -66,7 +66,7 @@ Decidim.register_component(:budgets) do |component|
|
|
66
66
|
budgets = resource_id ? Decidim::Budgets::Budget.find(resource_id) : Decidim::Budgets::Budget.where(decidim_component_id: component_instance)
|
67
67
|
Decidim::Budgets::Project
|
68
68
|
.where(decidim_budgets_budget_id: budgets)
|
69
|
-
.includes(:
|
69
|
+
.includes(:taxonomies, :component)
|
70
70
|
end
|
71
71
|
|
72
72
|
exports.include_in_open_data = true
|
@@ -75,8 +75,7 @@ Decidim.register_component(:budgets) do |component|
|
|
75
75
|
end
|
76
76
|
|
77
77
|
component.settings(:global) do |settings|
|
78
|
-
settings.attribute :
|
79
|
-
settings.attribute :scope_id, type: :scope
|
78
|
+
settings.attribute :taxonomy_filters, type: :taxonomy_filters
|
80
79
|
settings.attribute :workflow, type: :enum, default: "one", choices: -> { Decidim::Budgets.workflows.keys.map(&:to_s) }
|
81
80
|
settings.attribute :projects_per_page, type: :integer, default: 12
|
82
81
|
settings.attribute :vote_rule_threshold_percent_enabled, type: :boolean, default: true
|
@@ -16,14 +16,7 @@ module Decidim
|
|
16
16
|
def serialize
|
17
17
|
{
|
18
18
|
id: project.id,
|
19
|
-
|
20
|
-
id: project.category.try(:id),
|
21
|
-
name: project.category.try(:name) || empty_translatable
|
22
|
-
},
|
23
|
-
scope: {
|
24
|
-
id: project.scope.try(:id),
|
25
|
-
name: project.scope.try(:name) || empty_translatable
|
26
|
-
},
|
19
|
+
taxonomies:,
|
27
20
|
participatory_space: {
|
28
21
|
id: project.participatory_space.id,
|
29
22
|
url: Decidim::ResourceLocatorPresenter.new(project.participatory_space).url
|
@@ -31,13 +24,22 @@ module Decidim
|
|
31
24
|
component: { id: component.id },
|
32
25
|
title: project.title,
|
33
26
|
description: project.description,
|
34
|
-
budget: { id: project.budget.id
|
27
|
+
budget: { id: project.budget.id,
|
28
|
+
title: project.budget.title,
|
29
|
+
url: budget_url },
|
35
30
|
budget_amount: project.budget_amount,
|
36
|
-
confirmed_votes: project.confirmed_orders_count
|
31
|
+
confirmed_votes: (project.confirmed_orders_count if
|
32
|
+
project.component.current_settings.show_votes?),
|
37
33
|
comments: project.comments_count,
|
38
34
|
created_at: project.created_at,
|
39
35
|
url: project.polymorphic_resource_url({}),
|
40
36
|
address: project.address,
|
37
|
+
updated_at: project.updated_at,
|
38
|
+
selected_at: project.selected_at,
|
39
|
+
reference: project.reference,
|
40
|
+
follows_count: project.follows_count,
|
41
|
+
latitude: project.latitude,
|
42
|
+
longitude: project.longitude,
|
41
43
|
related_proposals:,
|
42
44
|
related_proposal_titles:,
|
43
45
|
related_proposal_urls:
|
@@ -49,10 +51,6 @@ module Decidim
|
|
49
51
|
attr_reader :project
|
50
52
|
alias resource project
|
51
53
|
|
52
|
-
def component
|
53
|
-
project.component
|
54
|
-
end
|
55
|
-
|
56
54
|
def related_proposals
|
57
55
|
project.linked_resources(:proposals, "included_proposals").map(&:id)
|
58
56
|
end
|
@@ -73,6 +71,10 @@ module Decidim
|
|
73
71
|
Decidim::ResourceLocatorPresenter.new(project).url
|
74
72
|
end
|
75
73
|
|
74
|
+
def budget_url
|
75
|
+
Decidim::EngineRouter.main_proxy(component).budget_url(project.budget)
|
76
|
+
end
|
77
|
+
|
76
78
|
def empty_translatable(locales = Decidim.available_locales)
|
77
79
|
locales.each_with_object({}) do |locale, result|
|
78
80
|
result[locale.to_s] = ""
|
@@ -80,8 +80,6 @@ module Decidim
|
|
80
80
|
def create_project!(budget:)
|
81
81
|
params = {
|
82
82
|
budget:,
|
83
|
-
scope: participatory_space.organization.scopes.sample,
|
84
|
-
category: participatory_space.categories.sample,
|
85
83
|
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
86
84
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
87
85
|
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-budgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.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: 2025-
|
13
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-comments
|
@@ -18,70 +18,70 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.30.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.30.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.30.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.30.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.30.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.30.0.rc1
|
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.
|
63
|
+
version: 0.30.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.30.0.rc1
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: decidim-proposals
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
77
|
+
version: 0.30.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.30.0.rc1
|
85
85
|
description: A budgets component for decidim's participatory spaces.
|
86
86
|
email:
|
87
87
|
- josepjaume@gmail.com
|
@@ -115,14 +115,13 @@ files:
|
|
115
115
|
- app/cells/decidim/budgets/limit_announcement_cell.rb
|
116
116
|
- app/cells/decidim/budgets/order_activity_cell.rb
|
117
117
|
- app/cells/decidim/budgets/project_cell.rb
|
118
|
+
- app/cells/decidim/budgets/project_history_cell.rb
|
118
119
|
- app/cells/decidim/budgets/project_l/extra_data.erb
|
119
120
|
- app/cells/decidim/budgets/project_l/metadata.erb
|
120
121
|
- app/cells/decidim/budgets/project_l_cell.rb
|
121
122
|
- app/cells/decidim/budgets/project_metadata_cell.rb
|
122
123
|
- app/cells/decidim/budgets/project_s_cell.rb
|
123
124
|
- app/cells/decidim/budgets/project_selected_status_cell.rb
|
124
|
-
- app/cells/decidim/budgets/project_tags/show.erb
|
125
|
-
- app/cells/decidim/budgets/project_tags_cell.rb
|
126
125
|
- app/cells/decidim/budgets/project_vote_button/show.erb
|
127
126
|
- app/cells/decidim/budgets/project_vote_button_cell.rb
|
128
127
|
- app/cells/decidim/budgets/project_voted_hint_cell.rb
|
@@ -131,12 +130,9 @@ files:
|
|
131
130
|
- app/commands/decidim/budgets/admin/create_budget.rb
|
132
131
|
- app/commands/decidim/budgets/admin/create_order_reminders.rb
|
133
132
|
- app/commands/decidim/budgets/admin/create_project.rb
|
134
|
-
- app/commands/decidim/budgets/admin/destroy_budget.rb
|
135
133
|
- app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb
|
136
134
|
- app/commands/decidim/budgets/admin/update_budget.rb
|
137
135
|
- app/commands/decidim/budgets/admin/update_project.rb
|
138
|
-
- app/commands/decidim/budgets/admin/update_project_category.rb
|
139
|
-
- app/commands/decidim/budgets/admin/update_project_scope.rb
|
140
136
|
- app/commands/decidim/budgets/admin/update_project_selection.rb
|
141
137
|
- app/commands/decidim/budgets/admin/update_projects_budget.rb
|
142
138
|
- app/commands/decidim/budgets/cancel_order.rb
|
@@ -161,7 +157,6 @@ files:
|
|
161
157
|
- app/forms/decidim/budgets/admin/order_reminder_form.rb
|
162
158
|
- app/forms/decidim/budgets/admin/project_form.rb
|
163
159
|
- app/forms/decidim/budgets/admin/project_import_proposals_form.rb
|
164
|
-
- app/helpers/decidim/budgets/admin/application_helper.rb
|
165
160
|
- app/helpers/decidim/budgets/admin/filterable_helper.rb
|
166
161
|
- app/helpers/decidim/budgets/admin/project_bulk_actions_helper.rb
|
167
162
|
- app/helpers/decidim/budgets/application_helper.rb
|
@@ -187,25 +182,32 @@ files:
|
|
187
182
|
- app/permissions/decidim/budgets/permissions.rb
|
188
183
|
- app/presenters/decidim/budgets/admin_log/budget_presenter.rb
|
189
184
|
- app/presenters/decidim/budgets/admin_log/project_presenter.rb
|
185
|
+
- app/presenters/decidim/budgets/project_presenter.rb
|
190
186
|
- app/queries/decidim/budgets/filtered_projects.rb
|
191
187
|
- app/queries/decidim/budgets/metrics/budget_followers_metric_measure.rb
|
192
188
|
- app/queries/decidim/budgets/metrics/budget_participants_metric_measure.rb
|
193
189
|
- app/serializers/decidim/budgets/download_your_data_budgets_order_serializer.rb
|
194
190
|
- app/services/decidim/budgets/order_reminder_generator.rb
|
191
|
+
- app/views/decidim/budgets/admin/budgets/_actions.html.erb
|
192
|
+
- app/views/decidim/budgets/admin/budgets/_budget-tr.html.erb
|
193
|
+
- app/views/decidim/budgets/admin/budgets/_budgets-thead.html.erb
|
195
194
|
- app/views/decidim/budgets/admin/budgets/_form.html.erb
|
196
195
|
- app/views/decidim/budgets/admin/budgets/edit.html.erb
|
197
196
|
- app/views/decidim/budgets/admin/budgets/index.html.erb
|
197
|
+
- app/views/decidim/budgets/admin/budgets/manage_trash.html.erb
|
198
198
|
- app/views/decidim/budgets/admin/budgets/new.html.erb
|
199
|
+
- app/views/decidim/budgets/admin/projects/_actions.html.erb
|
199
200
|
- app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb
|
200
201
|
- app/views/decidim/budgets/admin/projects/_form.html.erb
|
201
202
|
- app/views/decidim/budgets/admin/projects/_project-tr.html.erb
|
203
|
+
- app/views/decidim/budgets/admin/projects/_projects-thead.html.erb
|
202
204
|
- app/views/decidim/budgets/admin/projects/bulk_actions/_budget-change.html.erb
|
203
205
|
- app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb
|
204
206
|
- app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb
|
205
|
-
- app/views/decidim/budgets/admin/projects/bulk_actions/
|
206
|
-
- app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb
|
207
|
+
- app/views/decidim/budgets/admin/projects/bulk_actions/_taxonomy_change.html.erb
|
207
208
|
- app/views/decidim/budgets/admin/projects/edit.html.erb
|
208
209
|
- app/views/decidim/budgets/admin/projects/index.html.erb
|
210
|
+
- app/views/decidim/budgets/admin/projects/manage_trash.html.erb
|
209
211
|
- app/views/decidim/budgets/admin/projects/new.html.erb
|
210
212
|
- app/views/decidim/budgets/admin/projects/update_attribute.js.erb
|
211
213
|
- app/views/decidim/budgets/admin/proposals_imports/new.html.erb
|
@@ -213,6 +215,7 @@ files:
|
|
213
215
|
- app/views/decidim/budgets/budgets/index.js.erb
|
214
216
|
- app/views/decidim/budgets/line_items/update_budget.js.erb
|
215
217
|
- app/views/decidim/budgets/order_summary_mailer/order_summary.html.erb
|
218
|
+
- app/views/decidim/budgets/orders/status.html.erb
|
216
219
|
- app/views/decidim/budgets/projects/_addition_selector.html.erb
|
217
220
|
- app/views/decidim/budgets/projects/_budget_confirm.html.erb
|
218
221
|
- app/views/decidim/budgets/projects/_budget_excess.html.erb
|
@@ -241,7 +244,6 @@ files:
|
|
241
244
|
- config/locales/bg.yml
|
242
245
|
- config/locales/bn-BD.yml
|
243
246
|
- config/locales/bs-BA.yml
|
244
|
-
- config/locales/ca-IT.yml
|
245
247
|
- config/locales/ca.yml
|
246
248
|
- config/locales/cs-CZ.yml
|
247
249
|
- config/locales/cs.yml
|
@@ -337,6 +339,8 @@ files:
|
|
337
339
|
- db/migrate/20200827154129_add_commentable_counter_cache_to_projects.rb
|
338
340
|
- db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
|
339
341
|
- db/migrate/20220428072638_add_geolocalization_fields_to_projects.rb
|
342
|
+
- db/migrate/20240828103724_add_deleted_at_to_decidim_budgets_budgets.rb
|
343
|
+
- db/migrate/20240916135141_add_deleted_at_to_decidim_budgets_projects.rb
|
340
344
|
- decidim-budgets.gemspec
|
341
345
|
- lib/decidim/api/budget_type.rb
|
342
346
|
- lib/decidim/api/budgets_type.rb
|
@@ -373,14 +377,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
373
377
|
requirements:
|
374
378
|
- - "~>"
|
375
379
|
- !ruby/object:Gem::Version
|
376
|
-
version: 3.
|
380
|
+
version: 3.3.0
|
377
381
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
378
382
|
requirements:
|
379
383
|
- - ">="
|
380
384
|
- !ruby/object:Gem::Version
|
381
385
|
version: '0'
|
382
386
|
requirements: []
|
383
|
-
rubygems_version: 3.
|
387
|
+
rubygems_version: 3.5.11
|
384
388
|
signing_key:
|
385
389
|
specification_version: 4
|
386
390
|
summary: Decidim budgets module
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Budgets
|
5
|
-
# This cell overrides *_path methods from Decidim::TagsCell for project tags
|
6
|
-
class ProjectTagsCell < Decidim::TagsCell
|
7
|
-
private
|
8
|
-
|
9
|
-
def category_path
|
10
|
-
resource_locator([model.budget, model]).index(filter: { with_any_category: [model.category.id.to_s] })
|
11
|
-
end
|
12
|
-
|
13
|
-
def scope_path
|
14
|
-
resource_locator([model.budget, model]).index(filter: { with_any_scope: [model.scope.id] })
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Budgets
|
5
|
-
module Admin
|
6
|
-
# This command is executed when the user destroys a Budget
|
7
|
-
# from the admin panel.
|
8
|
-
class DestroyBudget < Decidim::Commands::DestroyResource
|
9
|
-
private
|
10
|
-
|
11
|
-
def invalid? = resource.projects.present?
|
12
|
-
|
13
|
-
def extra_params = { visibility: "all" }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|