decidim-budgets 0.27.10 → 0.28.0.rc4

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 (176) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/stylesheets/decidim/budgets/budget/_budget-vote-button.scss +5 -5
  4. data/app/cells/decidim/budgets/base_cell.rb +1 -1
  5. data/app/cells/decidim/budgets/budget_cell.rb +6 -1
  6. data/app/cells/decidim/budgets/budget_information_modal/show.erb +14 -26
  7. data/app/cells/decidim/budgets/budget_list_item/projects_count.erb +6 -0
  8. data/app/cells/decidim/budgets/budget_list_item/show.erb +35 -30
  9. data/app/cells/decidim/budgets/budget_list_item/vote_action.erb +13 -0
  10. data/app/cells/decidim/budgets/budget_list_item_cell.rb +24 -1
  11. data/app/cells/decidim/budgets/budget_metadata_cell.rb +29 -0
  12. data/app/cells/decidim/budgets/budget_s_cell.rb +15 -0
  13. data/app/cells/decidim/budgets/budgets_header/show.erb +2 -6
  14. data/app/cells/decidim/budgets/budgets_list/card_list.erb +8 -13
  15. data/app/cells/decidim/budgets/budgets_list/main_list.erb +5 -0
  16. data/app/cells/decidim/budgets/budgets_list/show.erb +12 -16
  17. data/app/cells/decidim/budgets/budgets_list/voted.erb +8 -44
  18. data/app/cells/decidim/budgets/budgets_list_cell.rb +34 -0
  19. data/app/cells/decidim/budgets/limit_announcement/show.erb +3 -0
  20. data/app/cells/decidim/budgets/limit_announcement_cell.rb +2 -2
  21. data/app/cells/decidim/budgets/order_activity_cell.rb +1 -4
  22. data/app/cells/decidim/budgets/project_cell.rb +6 -1
  23. data/app/cells/decidim/budgets/project_l/extra_data.erb +6 -0
  24. data/app/cells/decidim/budgets/project_l/metadata.erb +4 -0
  25. data/app/cells/decidim/budgets/project_l_cell.rb +38 -0
  26. data/app/cells/decidim/budgets/project_metadata_cell.rb +78 -0
  27. data/app/cells/decidim/budgets/project_s_cell.rb +21 -0
  28. data/app/cells/decidim/budgets/project_tags/show.erb +1 -0
  29. data/app/cells/decidim/budgets/project_vote_button/show.erb +21 -15
  30. data/app/cells/decidim/budgets/project_vote_button_cell.rb +69 -1
  31. data/app/cells/decidim/budgets/project_voted_hint_cell.rb +1 -1
  32. data/app/cells/decidim/budgets/project_votes_count_cell.rb +9 -8
  33. data/app/commands/decidim/budgets/admin/create_project.rb +0 -1
  34. data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +1 -1
  35. data/app/commands/decidim/budgets/admin/update_project.rb +1 -2
  36. data/app/commands/decidim/budgets/admin/update_project_scope.rb +1 -1
  37. data/app/commands/decidim/budgets/admin/update_project_selection.rb +1 -1
  38. data/app/commands/decidim/budgets/admin/update_projects_budget.rb +57 -0
  39. data/app/controllers/concerns/decidim/budgets/admin/filterable.rb +1 -1
  40. data/app/controllers/concerns/decidim/budgets/needs_current_order.rb +2 -2
  41. data/app/controllers/decidim/budgets/admin/budgets_controller.rb +5 -5
  42. data/app/controllers/decidim/budgets/admin/projects_controller.rb +52 -10
  43. data/app/controllers/decidim/budgets/admin/proposals_imports_controller.rb +1 -1
  44. data/app/controllers/decidim/budgets/application_controller.rb +0 -4
  45. data/app/controllers/decidim/budgets/budgets_controller.rb +9 -0
  46. data/app/controllers/decidim/budgets/line_items_controller.rb +10 -16
  47. data/app/controllers/decidim/budgets/orders_controller.rb +7 -2
  48. data/app/controllers/decidim/budgets/projects_controller.rb +51 -4
  49. data/app/forms/decidim/budgets/admin/project_form.rb +1 -1
  50. data/app/helpers/decidim/budgets/application_helper.rb +4 -0
  51. data/app/helpers/decidim/budgets/projects_helper.rb +89 -33
  52. data/app/jobs/decidim/budgets/send_vote_reminder_job.rb +1 -1
  53. data/app/mailers/decidim/budgets/order_summary_mailer.rb +1 -1
  54. data/app/mailers/decidim/budgets/vote_reminder_mailer.rb +1 -1
  55. data/app/models/decidim/budgets/budget.rb +1 -0
  56. data/app/models/decidim/budgets/project.rb +17 -7
  57. data/app/packs/entrypoints/decidim_budgets.js +2 -0
  58. data/app/packs/src/decidim/budgets/exit_handler.js +11 -8
  59. data/app/packs/src/decidim/budgets/progressFixed.js +25 -11
  60. data/app/packs/src/decidim/budgets/projects.js +15 -10
  61. data/app/packs/stylesheets/budgets.scss +273 -0
  62. data/app/presenters/decidim/budgets/admin_log/budget_presenter.rb +2 -2
  63. data/app/presenters/decidim/budgets/admin_log/project_presenter.rb +2 -2
  64. data/app/services/decidim/budgets/order_reminder_generator.rb +4 -4
  65. data/app/views/decidim/budgets/admin/budgets/_form.html.erb +17 -12
  66. data/app/views/decidim/budgets/admin/budgets/edit.html.erb +16 -6
  67. data/app/views/decidim/budgets/admin/budgets/index.html.erb +58 -64
  68. data/app/views/decidim/budgets/admin/budgets/new.html.erb +16 -6
  69. data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +19 -10
  70. data/app/views/decidim/budgets/admin/projects/_form.html.erb +31 -35
  71. data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +15 -13
  72. data/app/views/decidim/budgets/admin/projects/bulk_actions/_budget-change.html.erb +22 -0
  73. data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +3 -3
  74. data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +8 -2
  75. data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +3 -3
  76. data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +5 -8
  77. data/app/views/decidim/budgets/admin/projects/edit.html.erb +16 -6
  78. data/app/views/decidim/budgets/admin/projects/index.html.erb +26 -31
  79. data/app/views/decidim/budgets/admin/projects/new.html.erb +16 -6
  80. data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +8 -4
  81. data/app/views/decidim/budgets/admin/proposals_imports/new.html.erb +40 -28
  82. data/app/views/decidim/budgets/budgets/index.html.erb +21 -3
  83. data/app/views/decidim/budgets/budgets/index.js.erb +6 -0
  84. data/app/views/decidim/budgets/line_items/update_budget.js.erb +21 -11
  85. data/app/views/decidim/budgets/projects/_addition_selector.html.erb +16 -0
  86. data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +42 -31
  87. data/app/views/decidim/budgets/projects/_budget_excess.html.erb +12 -12
  88. data/app/views/decidim/budgets/projects/_budget_summary.html.erb +2 -75
  89. data/app/views/decidim/budgets/projects/_exit_modal.html.erb +15 -18
  90. data/app/views/decidim/budgets/projects/_linked_projects.html.erb +3 -12
  91. data/app/views/decidim/budgets/projects/_order.html.erb +1 -0
  92. data/app/views/decidim/budgets/projects/_order_progress_progressbar_marks_right.html.erb +10 -0
  93. data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +113 -0
  94. data/app/views/decidim/budgets/projects/_order_total_budget.html.erb +6 -7
  95. data/app/views/decidim/budgets/projects/_project.html.erb +2 -1
  96. data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +11 -19
  97. data/app/views/decidim/budgets/projects/_projects.html.erb +8 -6
  98. data/app/views/decidim/budgets/projects/_projects_count.html.erb +5 -0
  99. data/app/views/decidim/budgets/projects/_projects_list.html.erb +3 -0
  100. data/app/views/decidim/budgets/projects/index.html.erb +58 -55
  101. data/app/views/decidim/budgets/projects/index.js.erb +5 -4
  102. data/app/views/decidim/budgets/projects/show.html.erb +78 -51
  103. data/config/assets.rb +0 -1
  104. data/config/locales/ar.yml +0 -50
  105. data/config/locales/bg.yml +0 -381
  106. data/config/locales/ca.yml +75 -84
  107. data/config/locales/cs.yml +73 -82
  108. data/config/locales/de.yml +76 -85
  109. data/config/locales/el.yml +34 -72
  110. data/config/locales/en.yml +79 -88
  111. data/config/locales/es-MX.yml +73 -82
  112. data/config/locales/es-PY.yml +73 -82
  113. data/config/locales/es.yml +75 -84
  114. data/config/locales/eu.yml +74 -86
  115. data/config/locales/fi-plain.yml +75 -84
  116. data/config/locales/fi.yml +79 -88
  117. data/config/locales/fr-CA.yml +74 -86
  118. data/config/locales/fr.yml +78 -90
  119. data/config/locales/ga-IE.yml +0 -12
  120. data/config/locales/gl.yml +0 -58
  121. data/config/locales/hu.yml +58 -81
  122. data/config/locales/id-ID.yml +0 -38
  123. data/config/locales/is-IS.yml +0 -22
  124. data/config/locales/it.yml +0 -84
  125. data/config/locales/ja.yml +69 -81
  126. data/config/locales/ko.yml +0 -54
  127. data/config/locales/lb.yml +0 -85
  128. data/config/locales/lt.yml +59 -82
  129. data/config/locales/lv.yml +0 -44
  130. data/config/locales/nl.yml +0 -96
  131. data/config/locales/no.yml +0 -84
  132. data/config/locales/pl.yml +0 -167
  133. data/config/locales/pt-BR.yml +9 -141
  134. data/config/locales/pt.yml +0 -85
  135. data/config/locales/ro-RO.yml +0 -95
  136. data/config/locales/ru.yml +0 -41
  137. data/config/locales/sk.yml +0 -44
  138. data/config/locales/sq-AL.yml +0 -52
  139. data/config/locales/sr-CS.yml +0 -4
  140. data/config/locales/sv.yml +42 -150
  141. data/config/locales/tr-TR.yml +2 -82
  142. data/config/locales/uk.yml +0 -41
  143. data/config/locales/zh-CN.yml +0 -65
  144. data/config/locales/zh-TW.yml +13 -59
  145. data/lib/decidim/budgets/admin_engine.rb +3 -2
  146. data/lib/decidim/budgets/component.rb +4 -90
  147. data/lib/decidim/budgets/engine.rb +30 -10
  148. data/lib/decidim/budgets/project_serializer.rb +3 -3
  149. data/lib/decidim/budgets/seeds.rb +69 -0
  150. data/lib/decidim/budgets/test/factories.rb +23 -37
  151. data/lib/decidim/budgets/version.rb +1 -1
  152. data/lib/decidim/budgets/workflows/base.rb +1 -1
  153. metadata +46 -42
  154. data/app/cells/decidim/budgets/budget_m/data.erb +0 -12
  155. data/app/cells/decidim/budgets/budget_m/footer.erb +0 -5
  156. data/app/cells/decidim/budgets/budget_m_cell.rb +0 -16
  157. data/app/cells/decidim/budgets/project_list_item/project_data.erb +0 -19
  158. data/app/cells/decidim/budgets/project_list_item/project_image.erb +0 -5
  159. data/app/cells/decidim/budgets/project_list_item/project_text.erb +0 -23
  160. data/app/cells/decidim/budgets/project_list_item/show.erb +0 -5
  161. data/app/cells/decidim/budgets/project_list_item_cell.rb +0 -70
  162. data/app/cells/decidim/budgets/project_m/data.erb +0 -12
  163. data/app/cells/decidim/budgets/project_m/footer.erb +0 -5
  164. data/app/cells/decidim/budgets/project_m_cell.rb +0 -22
  165. data/app/packs/stylesheets/decidim/budgets/_budgets.scss +0 -3
  166. data/app/packs/stylesheets/decidim/budgets/budget/_budget-list.scss +0 -198
  167. data/app/packs/stylesheets/decidim/budgets/budget/_budget-meter.scss +0 -83
  168. data/app/packs/stylesheets/decidim/budgets/budget/_progress.scss +0 -19
  169. data/app/views/decidim/budgets/admin/projects/proposals_picker.html.erb +0 -1
  170. data/app/views/decidim/budgets/projects/_filters.html.erb +0 -30
  171. data/app/views/decidim/budgets/projects/_filters_small_view.html.erb +0 -18
  172. data/app/views/decidim/budgets/projects/_order_progress.html.erb +0 -32
  173. data/app/views/decidim/budgets/projects/_order_selected_projects.html.erb +0 -27
  174. data/config/locales/he-IL.yml +0 -1
  175. data/decidim-budgets.gemspec +0 -34
  176. data/lib/decidim/budgets/seeds/city.jpeg +0 -0
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "decidim/components/namer"
3
4
  require "decidim/faker/localized"
4
5
  require "decidim/dev"
5
6
 
@@ -8,12 +9,9 @@ require "decidim/participatory_processes/test/factories"
8
9
 
9
10
  FactoryBot.define do
10
11
  factory :budgets_component, parent: :component do
11
- transient do
12
- skip_injection { false }
13
- end
14
- name { generate_component_name(participatory_space.organization.available_locales, :budgets, skip_injection: skip_injection) }
12
+ name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :budgets).i18n_name }
15
13
  manifest_name { :budgets }
16
- participatory_space { create(:participatory_process, :with_steps, skip_injection: skip_injection, organization: organization) }
14
+ participatory_space { create(:participatory_process, :with_steps, organization:) }
17
15
 
18
16
  trait :with_geocoding_enabled do
19
17
  settings do
@@ -33,10 +31,10 @@ FactoryBot.define do
33
31
 
34
32
  settings do
35
33
  {
36
- vote_rule_threshold_percent_enabled: vote_rule_threshold_percent_enabled,
37
- vote_rule_minimum_budget_projects_enabled: vote_rule_minimum_budget_projects_enabled,
34
+ vote_rule_threshold_percent_enabled:,
35
+ vote_rule_minimum_budget_projects_enabled:,
38
36
  vote_rule_selected_projects_enabled: vote_rule_projects_enabled,
39
- vote_threshold_percent: vote_threshold_percent
37
+ vote_threshold_percent:
40
38
  }
41
39
  end
42
40
  end
@@ -51,10 +49,10 @@ FactoryBot.define do
51
49
 
52
50
  settings do
53
51
  {
54
- vote_rule_threshold_percent_enabled: vote_rule_threshold_percent_enabled,
55
- vote_rule_minimum_budget_projects_enabled: vote_rule_minimum_budget_projects_enabled,
52
+ vote_rule_threshold_percent_enabled:,
53
+ vote_rule_minimum_budget_projects_enabled:,
56
54
  vote_rule_selected_projects_enabled: vote_rule_projects_enabled,
57
- vote_minimum_budget_projects_number: vote_minimum_budget_projects_number
55
+ vote_minimum_budget_projects_number:
58
56
  }
59
57
  end
60
58
  end
@@ -70,8 +68,8 @@ FactoryBot.define do
70
68
 
71
69
  settings do
72
70
  {
73
- vote_rule_threshold_percent_enabled: vote_rule_threshold_percent_enabled,
74
- vote_rule_minimum_budget_projects_enabled: vote_rule_minimum_budget_projects_enabled,
71
+ vote_rule_threshold_percent_enabled:,
72
+ vote_rule_minimum_budget_projects_enabled:,
75
73
  vote_rule_selected_projects_enabled: vote_rule_projects_enabled,
76
74
  vote_selected_projects_minimum: vote_minimum_budget_projects_number,
77
75
  vote_selected_projects_maximum: vote_maximum_budget_projects_number
@@ -112,13 +110,10 @@ FactoryBot.define do
112
110
  end
113
111
 
114
112
  factory :budget, class: "Decidim::Budgets::Budget" do
115
- transient do
116
- skip_injection { false }
117
- end
118
- title { generate_localized_title(:budget_title, skip_injection: skip_injection) }
119
- description { generate_localized_description(:budget_description, skip_injection: skip_injection) }
113
+ title { generate_localized_title }
114
+ description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
120
115
  total_budget { 100_000_000 }
121
- component { create(:budgets_component, skip_injection: skip_injection) }
116
+ component { create(:budgets_component) }
122
117
 
123
118
  trait :with_projects do
124
119
  transient do
@@ -126,22 +121,19 @@ FactoryBot.define do
126
121
  end
127
122
 
128
123
  after(:create) do |budget, evaluator|
129
- create_list(:project, evaluator.projects_number, skip_injection: evaluator.skip_injection, budget: budget)
124
+ create_list(:project, evaluator.projects_number, budget:)
130
125
  end
131
126
  end
132
127
  end
133
128
 
134
129
  factory :project, class: "Decidim::Budgets::Project" do
135
- transient do
136
- skip_injection { false }
137
- end
138
- title { generate_localized_title(:project_title, skip_injection: skip_injection) }
139
- description { generate_localized_description(:project_description, skip_injection: skip_injection) }
130
+ title { generate_localized_title }
131
+ description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
140
132
  address { "#{Faker::Address.street_name}, #{Faker::Address.city}" }
141
133
  latitude { Faker::Address.latitude }
142
134
  longitude { Faker::Address.longitude }
143
135
  budget_amount { Faker::Number.number(digits: 8) }
144
- budget { create(:budget, skip_injection: skip_injection) }
136
+ budget { create(:budget) }
145
137
 
146
138
  trait :selected do
147
139
  selected_at { Time.current }
@@ -153,17 +145,14 @@ FactoryBot.define do
153
145
  end
154
146
 
155
147
  after :create do |project, evaluator|
156
- project.attachments = create_list(:attachment, evaluator.photos_number, :with_image, attached_to: project, skip_injection: evaluator.skip_injection)
148
+ project.attachments = create_list(:attachment, evaluator.photos_number, :with_image, attached_to: project)
157
149
  end
158
150
  end
159
151
  end
160
152
 
161
153
  factory :order, class: "Decidim::Budgets::Order" do
162
- transient do
163
- skip_injection { false }
164
- end
165
- budget { create(:budget, skip_injection: skip_injection) }
166
- user { create(:user, organization: component.organization, skip_injection: skip_injection) }
154
+ budget { create(:budget) }
155
+ user { create(:user, organization: component.organization) }
167
156
 
168
157
  trait :with_projects do
169
158
  transient do
@@ -172,17 +161,14 @@ FactoryBot.define do
172
161
 
173
162
  after(:create) do |order, evaluator|
174
163
  project_budget = (order.maximum_budget / evaluator.projects_number).to_i
175
- order.projects << create_list(:project, evaluator.projects_number, budget_amount: project_budget, budget: order.budget, skip_injection: evaluator.skip_injection)
164
+ order.projects << create_list(:project, evaluator.projects_number, budget_amount: project_budget, budget: order.budget)
176
165
  order.save!
177
166
  end
178
167
  end
179
168
  end
180
169
 
181
170
  factory :line_item, class: "Decidim::Budgets::LineItem" do
182
- transient do
183
- skip_injection { false }
184
- end
185
171
  order
186
- project { create(:project, budget: order.budget, skip_injection: skip_injection) }
172
+ project { create(:project, budget: order.budget) }
187
173
  end
188
174
  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.27.10"
7
+ "0.28.0.rc4"
8
8
  end
9
9
  end
10
10
  end
@@ -123,7 +123,7 @@ module Decidim
123
123
 
124
124
  def orders
125
125
  @orders ||= Decidim::Budgets::Order.includes(:projects).where(decidim_user_id: user, decidim_budgets_budget_id: budgets).map do |order|
126
- [order.decidim_budgets_budget_id, { order: order, status: order.checked_out? ? :voted : :progress }] if order.projects.any?
126
+ [order.decidim_budgets_budget_id, { order:, status: order.checked_out? ? :voted : :progress }] if order.projects.any?
127
127
  end.compact.to_h
128
128
  end
129
129
  end
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.27.10
4
+ version: 0.28.0.rc4
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-03-20 00:00:00.000000000 Z
13
+ date: 2023-12-11 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.27.10
21
+ version: 0.28.0.rc4
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.27.10
28
+ version: 0.28.0.rc4
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.27.10
35
+ version: 0.28.0.rc4
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.27.10
42
+ version: 0.28.0.rc4
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.27.10
49
+ version: 0.28.0.rc4
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.27.10
56
+ version: 0.28.0.rc4
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.27.10
63
+ version: 0.28.0.rc4
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.27.10
70
+ version: 0.28.0.rc4
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.27.10
77
+ version: 0.28.0.rc4
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.27.10
84
+ version: 0.28.0.rc4
85
85
  description: A budgets component for decidim's participatory spaces.
86
86
  email:
87
87
  - josepjaume@gmail.com
@@ -98,28 +98,28 @@ files:
98
98
  - app/cells/decidim/budgets/budget_cell.rb
99
99
  - app/cells/decidim/budgets/budget_information_modal/show.erb
100
100
  - app/cells/decidim/budgets/budget_information_modal_cell.rb
101
+ - app/cells/decidim/budgets/budget_list_item/projects_count.erb
101
102
  - app/cells/decidim/budgets/budget_list_item/show.erb
103
+ - app/cells/decidim/budgets/budget_list_item/vote_action.erb
102
104
  - app/cells/decidim/budgets/budget_list_item_cell.rb
103
- - app/cells/decidim/budgets/budget_m/data.erb
104
- - app/cells/decidim/budgets/budget_m/footer.erb
105
- - app/cells/decidim/budgets/budget_m_cell.rb
105
+ - app/cells/decidim/budgets/budget_metadata_cell.rb
106
+ - app/cells/decidim/budgets/budget_s_cell.rb
106
107
  - app/cells/decidim/budgets/budgets_header/show.erb
107
108
  - app/cells/decidim/budgets/budgets_header_cell.rb
108
109
  - app/cells/decidim/budgets/budgets_list/card_list.erb
110
+ - app/cells/decidim/budgets/budgets_list/main_list.erb
109
111
  - app/cells/decidim/budgets/budgets_list/show.erb
110
112
  - app/cells/decidim/budgets/budgets_list/voted.erb
111
113
  - app/cells/decidim/budgets/budgets_list_cell.rb
114
+ - app/cells/decidim/budgets/limit_announcement/show.erb
112
115
  - app/cells/decidim/budgets/limit_announcement_cell.rb
113
116
  - app/cells/decidim/budgets/order_activity_cell.rb
114
117
  - app/cells/decidim/budgets/project_cell.rb
115
- - app/cells/decidim/budgets/project_list_item/project_data.erb
116
- - app/cells/decidim/budgets/project_list_item/project_image.erb
117
- - app/cells/decidim/budgets/project_list_item/project_text.erb
118
- - app/cells/decidim/budgets/project_list_item/show.erb
119
- - app/cells/decidim/budgets/project_list_item_cell.rb
120
- - app/cells/decidim/budgets/project_m/data.erb
121
- - app/cells/decidim/budgets/project_m/footer.erb
122
- - app/cells/decidim/budgets/project_m_cell.rb
118
+ - app/cells/decidim/budgets/project_l/extra_data.erb
119
+ - app/cells/decidim/budgets/project_l/metadata.erb
120
+ - app/cells/decidim/budgets/project_l_cell.rb
121
+ - app/cells/decidim/budgets/project_metadata_cell.rb
122
+ - app/cells/decidim/budgets/project_s_cell.rb
123
123
  - app/cells/decidim/budgets/project_selected_status_cell.rb
124
124
  - app/cells/decidim/budgets/project_tags/show.erb
125
125
  - app/cells/decidim/budgets/project_tags_cell.rb
@@ -139,6 +139,7 @@ files:
139
139
  - app/commands/decidim/budgets/admin/update_project_category.rb
140
140
  - app/commands/decidim/budgets/admin/update_project_scope.rb
141
141
  - app/commands/decidim/budgets/admin/update_project_selection.rb
142
+ - app/commands/decidim/budgets/admin/update_projects_budget.rb
142
143
  - app/commands/decidim/budgets/cancel_order.rb
143
144
  - app/commands/decidim/budgets/checkout.rb
144
145
  - app/commands/decidim/budgets/remove_line_item.rb
@@ -182,10 +183,7 @@ files:
182
183
  - app/packs/src/decidim/budgets/exit_handler.js
183
184
  - app/packs/src/decidim/budgets/progressFixed.js
184
185
  - app/packs/src/decidim/budgets/projects.js
185
- - app/packs/stylesheets/decidim/budgets/_budgets.scss
186
- - app/packs/stylesheets/decidim/budgets/budget/_budget-list.scss
187
- - app/packs/stylesheets/decidim/budgets/budget/_budget-meter.scss
188
- - app/packs/stylesheets/decidim/budgets/budget/_progress.scss
186
+ - app/packs/stylesheets/budgets.scss
189
187
  - app/permissions/decidim/budgets/admin/permissions.rb
190
188
  - app/permissions/decidim/budgets/permissions.rb
191
189
  - app/presenters/decidim/budgets/admin_log/budget_presenter.rb
@@ -202,6 +200,7 @@ files:
202
200
  - app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb
203
201
  - app/views/decidim/budgets/admin/projects/_form.html.erb
204
202
  - app/views/decidim/budgets/admin/projects/_project-tr.html.erb
203
+ - app/views/decidim/budgets/admin/projects/bulk_actions/_budget-change.html.erb
205
204
  - app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb
206
205
  - app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb
207
206
  - app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb
@@ -209,26 +208,28 @@ files:
209
208
  - app/views/decidim/budgets/admin/projects/edit.html.erb
210
209
  - app/views/decidim/budgets/admin/projects/index.html.erb
211
210
  - app/views/decidim/budgets/admin/projects/new.html.erb
212
- - app/views/decidim/budgets/admin/projects/proposals_picker.html.erb
213
211
  - app/views/decidim/budgets/admin/projects/update_attribute.js.erb
214
212
  - app/views/decidim/budgets/admin/proposals_imports/new.html.erb
215
213
  - app/views/decidim/budgets/budgets/index.html.erb
214
+ - app/views/decidim/budgets/budgets/index.js.erb
216
215
  - app/views/decidim/budgets/line_items/update_budget.js.erb
217
216
  - app/views/decidim/budgets/order_summary_mailer/order_summary.html.erb
217
+ - app/views/decidim/budgets/projects/_addition_selector.html.erb
218
218
  - app/views/decidim/budgets/projects/_budget_confirm.html.erb
219
219
  - app/views/decidim/budgets/projects/_budget_excess.html.erb
220
220
  - app/views/decidim/budgets/projects/_budget_summary.html.erb
221
221
  - app/views/decidim/budgets/projects/_count.html.erb
222
222
  - app/views/decidim/budgets/projects/_exit_modal.html.erb
223
- - app/views/decidim/budgets/projects/_filters.html.erb
224
- - app/views/decidim/budgets/projects/_filters_small_view.html.erb
225
223
  - app/views/decidim/budgets/projects/_linked_projects.html.erb
226
- - app/views/decidim/budgets/projects/_order_progress.html.erb
227
- - app/views/decidim/budgets/projects/_order_selected_projects.html.erb
224
+ - app/views/decidim/budgets/projects/_order.html.erb
225
+ - app/views/decidim/budgets/projects/_order_progress_progressbar_marks_right.html.erb
226
+ - app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb
228
227
  - app/views/decidim/budgets/projects/_order_total_budget.html.erb
229
228
  - app/views/decidim/budgets/projects/_project.html.erb
230
229
  - app/views/decidim/budgets/projects/_project_budget_button.html.erb
231
230
  - app/views/decidim/budgets/projects/_projects.html.erb
231
+ - app/views/decidim/budgets/projects/_projects_count.html.erb
232
+ - app/views/decidim/budgets/projects/_projects_list.html.erb
232
233
  - app/views/decidim/budgets/projects/index.html.erb
233
234
  - app/views/decidim/budgets/projects/index.js.erb
234
235
  - app/views/decidim/budgets/projects/show.html.erb
@@ -266,7 +267,6 @@ files:
266
267
  - config/locales/ga-IE.yml
267
268
  - config/locales/gl.yml
268
269
  - config/locales/gn-PY.yml
269
- - config/locales/he-IL.yml
270
270
  - config/locales/hr-HR.yml
271
271
  - config/locales/hr.yml
272
272
  - config/locales/hu.yml
@@ -334,7 +334,6 @@ files:
334
334
  - db/migrate/20200827154129_add_commentable_counter_cache_to_projects.rb
335
335
  - db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
336
336
  - db/migrate/20220428072638_add_geolocalization_fields_to_projects.rb
337
- - decidim-budgets.gemspec
338
337
  - lib/decidim/api/budget_type.rb
339
338
  - lib/decidim/api/budgets_type.rb
340
339
  - lib/decidim/api/project_type.rb
@@ -345,34 +344,39 @@ files:
345
344
  - lib/decidim/budgets/component.rb
346
345
  - lib/decidim/budgets/engine.rb
347
346
  - lib/decidim/budgets/project_serializer.rb
347
+ - lib/decidim/budgets/seeds.rb
348
348
  - lib/decidim/budgets/seeds/Exampledocument.pdf
349
- - lib/decidim/budgets/seeds/city.jpeg
350
349
  - lib/decidim/budgets/test/factories.rb
351
350
  - lib/decidim/budgets/version.rb
352
351
  - lib/decidim/budgets/workflows.rb
353
352
  - lib/decidim/budgets/workflows/all.rb
354
353
  - lib/decidim/budgets/workflows/base.rb
355
354
  - lib/decidim/budgets/workflows/one.rb
356
- homepage: https://github.com/decidim/decidim
355
+ homepage: https://decidim.org
357
356
  licenses:
358
357
  - AGPL-3.0
359
- metadata: {}
358
+ metadata:
359
+ bug_tracker_uri: https://github.com/decidim/decidim/issues
360
+ documentation_uri: https://docs.decidim.org/
361
+ funding_uri: https://opencollective.com/decidim
362
+ homepage_uri: https://decidim.org
363
+ source_code_uri: https://github.com/decidim/decidim
360
364
  post_install_message:
361
365
  rdoc_options: []
362
366
  require_paths:
363
367
  - lib
364
368
  required_ruby_version: !ruby/object:Gem::Requirement
365
369
  requirements:
366
- - - "~>"
370
+ - - ">="
367
371
  - !ruby/object:Gem::Version
368
- version: 3.0.0
372
+ version: '3.1'
369
373
  required_rubygems_version: !ruby/object:Gem::Requirement
370
374
  requirements:
371
- - - ">="
375
+ - - ">"
372
376
  - !ruby/object:Gem::Version
373
- version: '0'
377
+ version: 1.3.1
374
378
  requirements: []
375
- rubygems_version: 3.2.22
379
+ rubygems_version: 3.4.20
376
380
  signing_key:
377
381
  specification_version: 4
378
382
  summary: Decidim budgets module
@@ -1,12 +0,0 @@
1
- <div class="card__icondata">
2
- <ul class="card-data">
3
- <li class="card-data__item">
4
- <%= icon "euro-outline", class: "icon--big", role: "img", "aria-hidden": true %>
5
- </li>
6
- <li class="card-data__item">
7
- <div class="text-left">
8
- <strong class="heading4"><%= budget_to_currency model.total_budget %></strong>
9
- </div>
10
- </li>
11
- </ul>
12
- </div>
@@ -1,5 +0,0 @@
1
- <div class="card__footer">
2
- <div class="card__support">
3
- <%= link_to t("view", scope: "decidim.budgets.budget"), resource_path, class: "card__button button button--sc small" %>
4
- </div>
5
- </div>
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Budgets
5
- # This cell renders the Medium (:m) budget card
6
- # for an given instance of a Decidim::Budgets::Budget
7
- class BudgetMCell < Decidim::CardMCell
8
- include ActiveSupport::NumberHelper
9
- include Decidim::Budgets::ProjectsHelper
10
-
11
- def statuses
12
- []
13
- end
14
- end
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- <div class="budget-list__data <%= data_class %>">
2
- <% if voting_finished? %>
3
- <div class="budget-list__data__votes">
4
- <%= cell("decidim/budgets/project_votes_count", model) %>
5
-
6
- <%= cell("decidim/budgets/project_voted_hint", model, class: "display-block margin-top-1") %>
7
- </div>
8
- <% else %>
9
- <span class="budget-list__data__number budget-list__number show-for-medium">
10
- <%= budget_to_currency(model.budget_amount) %>
11
-
12
- <%= cell("decidim/budgets/project_votes_count", model, layout: :one_line, class: "display-inline-block") %>
13
-
14
- <%= cell("decidim/budgets/project_voted_hint", model, class: "display-block margin-top-1") if current_order_checked_out? && resource_added? %>
15
- </span>
16
-
17
- <%= cell("decidim/budgets/project_vote_button", model) if !current_order_checked_out? && voting_open? %>
18
- <% end %>
19
- </div>
@@ -1,5 +0,0 @@
1
- <% if model.photos.first %>
2
- <div class="budget-list__image">
3
- <%= image_tag model.photos.first.thumbnail_url, alt: resource_title %>
4
- </div>
5
- <% end %>
@@ -1,23 +0,0 @@
1
- <div class="budget-list__text card__text">
2
- <div>
3
- <%= link_to resource_path, class: "card__link" do %>
4
- <h3 class="card__title budget-list__title">
5
- <%= cell("decidim/budgets/project_selected_status", model) %>
6
-
7
- <%= resource_title %>
8
- </h3>
9
- <% end %>
10
-
11
- <div class="show-for-medium">
12
- <%= cell "decidim/budgets/project_tags", model, context: { extra_classes: ["tags--project"] } %>
13
- </div>
14
-
15
- <div class="budget-list__data__number budget-list__number hide-for-medium">
16
- <%= cell("decidim/budgets/project_votes_count",
17
- model,
18
- layout: :one_line) %>
19
-
20
- <%= cell("decidim/budgets/project_voted_hint", model, class: "margin-left-1") if current_order_checked_out? && resource_added? %>
21
- </div>
22
- </div>
23
- </div>
@@ -1,5 +0,0 @@
1
- <div id="project-<%= model.id %>-item" class="budget-list__item">
2
- <%= render :project_image %>
3
- <%= render :project_text %>
4
- <%= render :project_data %>
5
- </div>
@@ -1,70 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Budgets
5
- # This cell renders a horizontal project card
6
- # for an given instance of a Project in a budget list
7
- class ProjectListItemCell < Decidim::ViewModel
8
- include ActiveSupport::NumberHelper
9
- include Decidim::LayoutHelper
10
- include Decidim::ActionAuthorizationHelper
11
- include Decidim::Budgets::ProjectsHelper
12
- include Decidim::Budgets::Engine.routes.url_helpers
13
-
14
- delegate :current_user, :current_settings, :current_order, :current_component,
15
- :current_participatory_space, :can_have_order?, :voting_open?, :voting_finished?, to: :parent_controller
16
-
17
- private
18
-
19
- def resource_path
20
- resource_locator([model.budget, model]).path
21
- end
22
-
23
- def resource_title
24
- decidim_escape_translated model.title
25
- end
26
-
27
- def resource_added?
28
- current_order && current_order.projects.include?(model)
29
- end
30
-
31
- def resource_allocation
32
- current_order.allocation_for(model)
33
- end
34
-
35
- def data_class
36
- [].tap do |list|
37
- list << "budget-list__data--added" if can_have_order? && resource_added?
38
- list << "show-for-medium" if voting_finished? || (current_order_checked_out? && !resource_added?)
39
- end.join(" ")
40
- end
41
-
42
- def vote_button_disabled?
43
- current_user && !can_have_order?
44
- end
45
-
46
- def vote_button_class
47
- return "success" if resource_added?
48
-
49
- "hollow"
50
- end
51
-
52
- def vote_button_method
53
- return :delete if resource_added?
54
-
55
- :post
56
- end
57
-
58
- def vote_button_label
59
- if resource_added?
60
- return t(
61
- "decidim.budgets.projects.project.remove",
62
- resource_name: resource_title
63
- )
64
- end
65
-
66
- t("decidim.budgets.projects.project.add", resource_name: resource_title)
67
- end
68
- end
69
- end
70
- end
@@ -1,12 +0,0 @@
1
- <div class="card__icondata">
2
- <ul class="card-data">
3
- <li class="card-data__item">
4
- <%= icon "euro-outline", class: "icon--big", role: "img", "aria-hidden": true %>
5
- </li>
6
- <li class="card-data__item">
7
- <div class="text-left">
8
- <strong class="heading4"><%= budget_to_currency model.budget_amount %></strong>
9
- </div>
10
- </li>
11
- </ul>
12
- </div>
@@ -1,5 +0,0 @@
1
- <div class="card__footer">
2
- <div class="card__support">
3
- <%= link_to t("view", scope: "decidim.budgets.projects.project"), resource_path, class: "card__button button button--sc small" %>
4
- </div>
5
- </div>
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Budgets
5
- # This cell renders the Medium (:m) project card
6
- # for an given instance of a Project
7
- class ProjectMCell < Decidim::CardMCell
8
- include ActiveSupport::NumberHelper
9
- include Decidim::Budgets::ProjectsHelper
10
-
11
- private
12
-
13
- def resource_icon
14
- icon "projects", class: "icon--big"
15
- end
16
-
17
- def resource_path
18
- resource_locator([model.budget, model]).path
19
- end
20
- end
21
- end
22
- end
@@ -1,3 +0,0 @@
1
- @import "stylesheets/decidim/budgets/budget/budget-list";
2
- @import "stylesheets/decidim/budgets/budget/budget-meter";
3
- @import "stylesheets/decidim/budgets/budget/progress";