decidim-budgets 0.28.5 → 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.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/budgets/base_cell.rb +0 -2
  3. data/app/cells/decidim/budgets/budget_list_item_cell.rb +0 -3
  4. data/app/cells/decidim/budgets/order_activity_cell.rb +1 -1
  5. data/app/cells/decidim/budgets/project_l_cell.rb +0 -1
  6. data/app/cells/decidim/budgets/project_vote_button_cell.rb +0 -1
  7. data/app/cells/decidim/budgets/project_voted_hint_cell.rb +0 -2
  8. data/app/cells/decidim/budgets/project_votes_count_cell.rb +0 -2
  9. data/app/commands/decidim/budgets/admin/create_budget.rb +4 -33
  10. data/app/commands/decidim/budgets/admin/create_order_reminders.rb +5 -19
  11. data/app/commands/decidim/budgets/admin/create_project.rb +19 -45
  12. data/app/commands/decidim/budgets/admin/destroy_budget.rb +3 -28
  13. data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +2 -7
  14. data/app/commands/decidim/budgets/admin/update_budget.rb +4 -35
  15. data/app/commands/decidim/budgets/admin/update_project.rb +17 -43
  16. data/app/controllers/decidim/budgets/admin/application_controller.rb +5 -1
  17. data/app/controllers/decidim/budgets/admin/projects_controller.rb +1 -1
  18. data/app/forms/decidim/budgets/admin/budget_form.rb +2 -2
  19. data/app/forms/decidim/budgets/admin/project_form.rb +1 -1
  20. data/app/forms/decidim/budgets/admin/project_import_proposals_form.rb +1 -1
  21. data/app/helpers/decidim/budgets/projects_helper.rb +2 -2
  22. data/app/packs/src/decidim/budgets/admin/projects.js +1 -1
  23. data/app/packs/stylesheets/budgets.scss +30 -18
  24. data/app/permissions/decidim/budgets/permissions.rb +0 -2
  25. data/app/views/decidim/budgets/admin/budgets/index.html.erb +1 -1
  26. data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +3 -5
  27. data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +5 -0
  28. data/app/views/decidim/budgets/admin/projects/bulk_actions/_budget-change.html.erb +2 -2
  29. data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +2 -2
  30. data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +2 -2
  31. data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +2 -2
  32. data/app/views/decidim/budgets/admin/projects/index.html.erb +5 -2
  33. data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +3 -3
  34. data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +3 -3
  35. data/app/views/decidim/budgets/projects/_order_progress_progressbar_marks_right.html.erb +1 -1
  36. data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +21 -12
  37. data/app/views/decidim/budgets/projects/_projects.html.erb +1 -1
  38. data/app/views/decidim/budgets/projects/index.js.erb +1 -1
  39. data/config/locales/ar.yml +3 -2
  40. data/config/locales/bg.yml +4 -2
  41. data/config/locales/ca.yml +2 -1
  42. data/config/locales/cs.yml +3 -2
  43. data/config/locales/de.yml +6 -5
  44. data/config/locales/el.yml +1 -1
  45. data/config/locales/en.yml +2 -1
  46. data/config/locales/es-MX.yml +3 -2
  47. data/config/locales/es-PY.yml +3 -2
  48. data/config/locales/es.yml +2 -1
  49. data/config/locales/eu.yml +85 -93
  50. data/config/locales/fi-plain.yml +17 -16
  51. data/config/locales/fi.yml +71 -70
  52. data/config/locales/fr-CA.yml +6 -5
  53. data/config/locales/fr.yml +5 -4
  54. data/config/locales/ga-IE.yml +4 -0
  55. data/config/locales/gl.yml +7 -1
  56. data/config/locales/hu.yml +4 -3
  57. data/config/locales/id-ID.yml +3 -0
  58. data/config/locales/is-IS.yml +3 -0
  59. data/config/locales/it.yml +5 -1
  60. data/config/locales/ja.yml +2 -1
  61. data/config/locales/ko.yml +0 -8
  62. data/config/locales/lb.yml +4 -1
  63. data/config/locales/lt.yml +1 -1
  64. data/config/locales/lv.yml +3 -0
  65. data/config/locales/nl.yml +3 -3
  66. data/config/locales/no.yml +7 -1
  67. data/config/locales/pl.yml +3 -1
  68. data/config/locales/pt-BR.yml +3 -70
  69. data/config/locales/pt.yml +5 -1
  70. data/config/locales/ro-RO.yml +2 -2
  71. data/config/locales/ru.yml +3 -0
  72. data/config/locales/sk.yml +3 -0
  73. data/config/locales/sq-AL.yml +3 -10
  74. data/config/locales/sv.yml +57 -171
  75. data/config/locales/tr-TR.yml +5 -1
  76. data/config/locales/uk.yml +3 -0
  77. data/config/locales/zh-CN.yml +5 -1
  78. data/config/locales/zh-TW.yml +1 -1
  79. data/decidim-budgets.gemspec +2 -2
  80. data/lib/decidim/api/budget_type.rb +0 -6
  81. data/lib/decidim/api/budgets_type.rb +3 -1
  82. data/lib/decidim/api/project_type.rb +0 -13
  83. data/lib/decidim/budgets/project_serializer.rb +1 -0
  84. data/lib/decidim/budgets/seeds.rb +62 -21
  85. data/lib/decidim/budgets/version.rb +1 -1
  86. data/lib/decidim/budgets/workflows/base.rb +1 -1
  87. metadata +17 -20
  88. data/app/commands/decidim/budgets/admin/destroy_project.rb +0 -42
  89. data/config/locales/bn-BD.yml +0 -1
  90. data/config/locales/bs-BA.yml +0 -22
@@ -13,25 +13,59 @@ module Decidim
13
13
  end
14
14
 
15
15
  def call
16
+ component = create_component!
17
+
18
+ rand(1...3).times do
19
+ create_budget!(component:)
20
+ end
21
+
22
+ Decidim::Budgets::Budget.where(component:).each do |budget|
23
+ rand(2...4).times do
24
+ project = create_project!(budget:)
25
+
26
+ create_attachments!(attached_to: project)
27
+
28
+ Decidim::Comments::Seed.comments_for(project)
29
+ end
30
+ end
31
+ end
32
+
33
+ def create_component!
16
34
  landing_page_content = Decidim::Faker::Localized.localized do
17
35
  "<h2>#{::Faker::Lorem.sentence}</h2>" \
18
36
  "<p>#{::Faker::Lorem.paragraph}</p>" \
19
37
  "<p>#{::Faker::Lorem.paragraph}</p>"
20
38
  end
21
39
 
22
- component = Decidim::Component.create!(
40
+ params = {
23
41
  name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :budgets).i18n_name,
24
42
  manifest_name: :budgets,
25
43
  published_at: Time.current,
26
44
  participatory_space:,
27
45
  settings: {
46
+ geocoding_enabled: [true, false].sample,
28
47
  landing_page_content:,
29
48
  more_information_modal: Decidim::Faker::Localized.paragraph(sentence_count: 4),
30
49
  workflow: Decidim::Budgets.workflows.keys.sample
31
50
  }
32
- )
51
+ }
33
52
 
34
- rand(1...3).times do
53
+ Decidim.traceability.perform_action!(
54
+ "publish",
55
+ Decidim::Component,
56
+ admin_user,
57
+ visibility: "all"
58
+ ) do
59
+ Decidim::Component.create!(params)
60
+ end
61
+ end
62
+
63
+ def create_budget!(component:)
64
+ Decidim.traceability.perform_action!(
65
+ "create",
66
+ Decidim::Budgets::Budget,
67
+ admin_user
68
+ ) do
35
69
  Decidim::Budgets::Budget.create!(
36
70
  component:,
37
71
  title: Decidim::Faker::Localized.sentence(word_count: 2),
@@ -41,27 +75,34 @@ module Decidim
41
75
  total_budget: ::Faker::Number.number(digits: 8)
42
76
  )
43
77
  end
78
+ end
44
79
 
45
- Decidim::Budgets::Budget.where(component:).each do |budget|
46
- rand(2...4).times do
47
- project = Decidim::Budgets::Project.create!(
48
- budget:,
49
- scope: participatory_space.organization.scopes.sample,
50
- category: participatory_space.categories.sample,
51
- title: Decidim::Faker::Localized.sentence(word_count: 2),
52
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
53
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
54
- end,
55
- budget_amount: ::Faker::Number.between(from: Integer(budget.total_budget * 0.7), to: budget.total_budget)
56
- )
80
+ def create_project!(budget:)
81
+ params = {
82
+ budget:,
83
+ scope: participatory_space.organization.scopes.sample,
84
+ category: participatory_space.categories.sample,
85
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
86
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
87
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
88
+ end,
89
+ budget_amount: ::Faker::Number.between(from: Integer(budget.total_budget * 0.7), to: budget.total_budget)
90
+ }
57
91
 
58
- attachment_collection = create_attachment_collection(collection_for: project)
59
- create_attachment(attached_to: project, filename: "Exampledocument.pdf", attachment_collection:)
60
- create_attachment(attached_to: project, filename: "city.jpeg")
61
- create_attachment(attached_to: project, filename: "Exampledocument.pdf")
92
+ if budget.component.settings.geocoding_enabled?
93
+ params = params.merge(
94
+ address: "#{::Faker::Address.street_address} #{::Faker::Address.zip} #{::Faker::Address.city}",
95
+ latitude: ::Faker::Address.latitude,
96
+ longitude: ::Faker::Address.longitude
97
+ )
98
+ end
62
99
 
63
- Decidim::Comments::Seed.comments_for(project)
64
- end
100
+ Decidim.traceability.perform_action!(
101
+ "create",
102
+ Decidim::Budgets::Project,
103
+ admin_user
104
+ ) do
105
+ Decidim::Budgets::Project.create!(params)
65
106
  end
66
107
  end
67
108
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-budgets version.
5
5
  module Budgets
6
6
  def self.version
7
- "0.28.5"
7
+ "0.29.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -17,7 +17,7 @@ module Decidim
17
17
  budgets.one?
18
18
  end
19
19
 
20
- # Public: Return the lonenly budget resource of the component
20
+ # Public: Return the single budget resource of the component
21
21
  #
22
22
  # Returns an ActiveRecord.
23
23
  def single
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.28.5
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: 2025-02-12 00:00:00.000000000 Z
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,70 +18,70 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.28.5
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.5
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.28.5
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.28.5
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.28.5
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.28.5
56
+ version: 0.29.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.28.5
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.28.5
70
+ version: 0.29.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.28.5
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.28.5
84
+ version: 0.29.0.rc1
85
85
  description: A budgets component for decidim's participatory spaces.
86
86
  email:
87
87
  - josepjaume@gmail.com
@@ -132,7 +132,6 @@ files:
132
132
  - app/commands/decidim/budgets/admin/create_order_reminders.rb
133
133
  - app/commands/decidim/budgets/admin/create_project.rb
134
134
  - app/commands/decidim/budgets/admin/destroy_budget.rb
135
- - app/commands/decidim/budgets/admin/destroy_project.rb
136
135
  - app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb
137
136
  - app/commands/decidim/budgets/admin/update_budget.rb
138
137
  - app/commands/decidim/budgets/admin/update_project.rb
@@ -240,8 +239,6 @@ files:
240
239
  - config/locales/ar.yml
241
240
  - config/locales/bg-BG.yml
242
241
  - config/locales/bg.yml
243
- - config/locales/bn-BD.yml
244
- - config/locales/bs-BA.yml
245
242
  - config/locales/ca.yml
246
243
  - config/locales/cs-CZ.yml
247
244
  - config/locales/cs.yml
@@ -358,7 +355,7 @@ files:
358
355
  - lib/decidim/budgets/workflows/one.rb
359
356
  homepage: https://decidim.org
360
357
  licenses:
361
- - AGPL-3.0-or-later
358
+ - AGPL-3.0
362
359
  metadata:
363
360
  bug_tracker_uri: https://github.com/decidim/decidim/issues
364
361
  documentation_uri: https://docs.decidim.org/
@@ -373,14 +370,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
373
370
  requirements:
374
371
  - - "~>"
375
372
  - !ruby/object:Gem::Version
376
- version: 3.1.0
373
+ version: 3.2.0
377
374
  required_rubygems_version: !ruby/object:Gem::Requirement
378
375
  requirements:
379
- - - ">="
376
+ - - ">"
380
377
  - !ruby/object:Gem::Version
381
- version: '0'
378
+ version: 1.3.1
382
379
  requirements: []
383
- rubygems_version: 3.3.7
380
+ rubygems_version: 3.4.10
384
381
  signing_key:
385
382
  specification_version: 4
386
383
  summary: Decidim budgets module
@@ -1,42 +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 deletes a Project from the admin
7
- # panel.
8
- class DestroyProject < Decidim::Command
9
- # Initializes an UpdateProject Command.
10
- #
11
- # project - The current instance of the project to be destroyed.
12
- # current_user - the user that performs the action
13
- def initialize(project, current_user)
14
- @project = project
15
- @current_user = current_user
16
- end
17
-
18
- # Performs the action.
19
- #
20
- # Broadcasts :ok if successful, :invalid otherwise.
21
- def call
22
- destroy_project
23
- broadcast(:ok)
24
- end
25
-
26
- private
27
-
28
- attr_reader :project, :current_user
29
-
30
- def destroy_project
31
- Decidim.traceability.perform_action!(
32
- :delete,
33
- project,
34
- current_user
35
- ) do
36
- project.destroy!
37
- end
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1 +0,0 @@
1
- bn:
@@ -1,22 +0,0 @@
1
- ---
2
- bs:
3
- decidim:
4
- budgets:
5
- order_summary_mailer:
6
- order_summary:
7
- selected_projects: 'Projekti koje ste izabrali su:'
8
- subject: Glasali ste na prostoru za diskusiju %{space_name}
9
- projects:
10
- orders:
11
- highest_cost: Najveća cena
12
- label: Poređaj projekte po
13
- lowest_cost: Najniža cena
14
- most_voted: Najviše glasova
15
- random: Slučajan redosled
16
- components:
17
- budgets:
18
- settings:
19
- global:
20
- vote_minimum_budget_projects_number: Minimum projekata za glasanje
21
- vote_rule_minimum_budget_projects_enabled: 'Omogući pravilo: Minimalni broj projekata o kojima se glasa'
22
- vote_rule_threshold_percent_enabled: 'Omogući pravilo: Minimalni procenta budžeta'