decidim-budgets 0.29.1 → 0.30.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/budgets/budget_list_item/vote_action.erb +2 -2
- 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 +7 -10
- 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 +1 -18
- data/app/forms/decidim/budgets/admin/project_form.rb +8 -34
- 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 +0 -2
- data/app/permissions/decidim/budgets/admin/permissions.rb +4 -4
- data/app/permissions/decidim/budgets/permissions.rb +2 -0
- 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 +6 -1
- 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_progress_summary_content.html.erb +3 -3
- data/app/views/decidim/budgets/projects/index.html.erb +10 -17
- data/app/views/decidim/budgets/projects/index.js.erb +10 -0
- data/app/views/decidim/budgets/projects/show.html.erb +19 -11
- data/config/locales/ar.yml +4 -13
- data/config/locales/bg.yml +3 -44
- data/config/locales/bn-BD.yml +1 -0
- data/config/locales/bs-BA.yml +22 -0
- data/config/locales/ca.yml +95 -42
- data/config/locales/cs.yml +101 -42
- data/config/locales/de.yml +95 -42
- data/config/locales/el.yml +3 -40
- 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 +176 -114
- data/config/locales/fi-plain.yml +107 -54
- data/config/locales/fi.yml +148 -95
- data/config/locales/fr-CA.yml +38 -44
- data/config/locales/fr.yml +38 -44
- data/config/locales/ga-IE.yml +0 -7
- data/config/locales/gl.yml +3 -14
- data/config/locales/hu.yml +3 -41
- data/config/locales/id-ID.yml +3 -6
- data/config/locales/is-IS.yml +0 -6
- data/config/locales/it.yml +3 -10
- data/config/locales/ja.yml +92 -42
- data/config/locales/kaa.yml +0 -1
- data/config/locales/ko.yml +0 -12
- data/config/locales/lb.yml +3 -9
- data/config/locales/lt.yml +3 -42
- data/config/locales/lv.yml +3 -6
- data/config/locales/nl.yml +3 -25
- data/config/locales/no.yml +3 -15
- data/config/locales/pl.yml +5 -44
- data/config/locales/pt-BR.yml +4 -44
- data/config/locales/pt.yml +3 -10
- data/config/locales/ro-RO.yml +3 -18
- data/config/locales/ru.yml +3 -6
- data/config/locales/sk.yml +3 -6
- data/config/locales/sq-AL.yml +0 -9
- data/config/locales/sv.yml +96 -43
- data/config/locales/tr-TR.yml +3 -10
- data/config/locales/uk.yml +3 -6
- data/config/locales/zh-CN.yml +3 -9
- data/config/locales/zh-TW.yml +3 -40
- 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 +2 -2
- data/lib/decidim/api/budget_type.rb +8 -5
- data/lib/decidim/api/budgets_type.rb +5 -8
- data/lib/decidim/api/project_type.rb +19 -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 +30 -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/decidim-budgets.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.version = Decidim::Budgets.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-or-later"
|
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.3.0"
|
23
23
|
|
24
24
|
s.name = "decidim-budgets"
|
25
25
|
s.summary = "Decidim budgets module"
|
@@ -3,19 +3,22 @@
|
|
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
16
|
|
18
|
-
|
17
|
+
def self.authorized?(object, context)
|
18
|
+
super && object.visible?
|
19
|
+
rescue Decidim::PermissionAction::PermissionNotSetError
|
20
|
+
false
|
21
|
+
end
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
@@ -2,22 +2,19 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Budgets
|
5
|
-
class BudgetsType < Decidim::
|
6
|
-
implements Decidim::Core::ComponentInterface
|
7
|
-
|
5
|
+
class BudgetsType < Decidim::Core::ComponentType
|
8
6
|
graphql_name "Budgets"
|
9
7
|
description "A budget component of a participatory space."
|
10
8
|
|
11
|
-
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
|
12
13
|
|
13
14
|
def budgets
|
14
15
|
Budget.where(component: object).includes(:component)
|
15
16
|
end
|
16
17
|
|
17
|
-
field :budget, Decidim::Budgets::BudgetType, null: true do
|
18
|
-
argument :id, GraphQL::Types::ID, required: true
|
19
|
-
end
|
20
|
-
|
21
18
|
def budget(**args)
|
22
19
|
Budget.where(component: object).find_by(id: args[:id])
|
23
20
|
end
|
@@ -3,21 +3,32 @@
|
|
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
|
19
|
+
|
20
|
+
def self.authorized?(object, context)
|
21
|
+
context[:project] = object
|
22
|
+
|
23
|
+
chain = [
|
24
|
+
allowed_to?(:read, :project, object, context),
|
25
|
+
object.visible?
|
26
|
+
].all?
|
27
|
+
|
28
|
+
super && chain
|
29
|
+
rescue Decidim::PermissionAction::PermissionNotSetError
|
30
|
+
false
|
31
|
+
end
|
21
32
|
end
|
22
33
|
end
|
23
34
|
end
|
@@ -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:
|
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
|
@@ -239,6 +242,8 @@ files:
|
|
239
242
|
- config/locales/ar.yml
|
240
243
|
- config/locales/bg-BG.yml
|
241
244
|
- config/locales/bg.yml
|
245
|
+
- config/locales/bn-BD.yml
|
246
|
+
- config/locales/bs-BA.yml
|
242
247
|
- config/locales/ca.yml
|
243
248
|
- config/locales/cs-CZ.yml
|
244
249
|
- config/locales/cs.yml
|
@@ -334,6 +339,8 @@ files:
|
|
334
339
|
- db/migrate/20200827154129_add_commentable_counter_cache_to_projects.rb
|
335
340
|
- db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
|
336
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
|
337
344
|
- decidim-budgets.gemspec
|
338
345
|
- lib/decidim/api/budget_type.rb
|
339
346
|
- lib/decidim/api/budgets_type.rb
|
@@ -355,7 +362,7 @@ files:
|
|
355
362
|
- lib/decidim/budgets/workflows/one.rb
|
356
363
|
homepage: https://decidim.org
|
357
364
|
licenses:
|
358
|
-
- AGPL-3.0
|
365
|
+
- AGPL-3.0-or-later
|
359
366
|
metadata:
|
360
367
|
bug_tracker_uri: https://github.com/decidim/decidim/issues
|
361
368
|
documentation_uri: https://docs.decidim.org/
|
@@ -370,14 +377,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
370
377
|
requirements:
|
371
378
|
- - "~>"
|
372
379
|
- !ruby/object:Gem::Version
|
373
|
-
version: 3.
|
380
|
+
version: 3.3.0
|
374
381
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
375
382
|
requirements:
|
376
383
|
- - ">="
|
377
384
|
- !ruby/object:Gem::Version
|
378
385
|
version: '0'
|
379
386
|
requirements: []
|
380
|
-
rubygems_version: 3.
|
387
|
+
rubygems_version: 3.5.11
|
381
388
|
signing_key:
|
382
389
|
specification_version: 4
|
383
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
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Budgets
|
5
|
-
module Admin
|
6
|
-
class UpdateProjectCategory < Decidim::Command
|
7
|
-
include TranslatableAttributes
|
8
|
-
|
9
|
-
# Public: Initializes the command.
|
10
|
-
#
|
11
|
-
# category_id - the category id to update
|
12
|
-
# project_ids - the project ids to update.
|
13
|
-
def initialize(category_id, project_ids)
|
14
|
-
@category = Decidim::Category.find_by id: category_id
|
15
|
-
@project_ids = project_ids
|
16
|
-
@response = { category_name: "", successful: [], errored: [] }
|
17
|
-
end
|
18
|
-
|
19
|
-
def call
|
20
|
-
return broadcast(:invalid_category) if @category.blank?
|
21
|
-
return broadcast(:invalid_project_ids) if @project_ids.blank?
|
22
|
-
|
23
|
-
@response[:category_name] = @category.translated_name
|
24
|
-
Project.where(id: @project_ids).find_each do |project|
|
25
|
-
if @category == project.category
|
26
|
-
@response[:errored] << translated_attribute(project.title)
|
27
|
-
else
|
28
|
-
transaction do
|
29
|
-
update_project_category project
|
30
|
-
end
|
31
|
-
@response[:successful] << translated_attribute(project.title)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
broadcast(:update_projects_category, @response)
|
36
|
-
end
|
37
|
-
|
38
|
-
private
|
39
|
-
|
40
|
-
def update_project_category(project)
|
41
|
-
project.update!(
|
42
|
-
category: @category
|
43
|
-
)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Budgets
|
5
|
-
module Admin
|
6
|
-
class UpdateProjectScope < Decidim::Command
|
7
|
-
include TranslatableAttributes
|
8
|
-
|
9
|
-
# Public: Initializes the command.
|
10
|
-
#
|
11
|
-
# scope_id - the scope id to update
|
12
|
-
# project_ids - the project ids to update.
|
13
|
-
def initialize(scope_id, project_ids)
|
14
|
-
@scope = ::Decidim::Scope.find_by id: scope_id
|
15
|
-
@project_ids = project_ids
|
16
|
-
@response = { scope_name: "", successful: [], errored: [] }
|
17
|
-
end
|
18
|
-
|
19
|
-
def call
|
20
|
-
return broadcast(:invalid_scope) if @scope.blank?
|
21
|
-
return broadcast(:invalid_project_ids) if @project_ids.blank?
|
22
|
-
|
23
|
-
update_projects_scope
|
24
|
-
|
25
|
-
broadcast(:update_projects_scope, @response)
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
attr_reader :scope, :project_ids
|
31
|
-
|
32
|
-
def update_projects_scope
|
33
|
-
@response[:scope_name] = translated_attribute(scope.name, scope.organization)
|
34
|
-
::Decidim::Budgets::Project.where(id: project_ids).find_each do |project|
|
35
|
-
if scope == project.scope
|
36
|
-
@response[:errored] << translated_attribute(project.title)
|
37
|
-
else
|
38
|
-
transaction do
|
39
|
-
update_project_scope project
|
40
|
-
end
|
41
|
-
@response[:successful] << translated_attribute(project.title)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def update_project_scope(project)
|
47
|
-
project.update!(
|
48
|
-
scope:
|
49
|
-
)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|