decidim-budgets 0.27.9 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
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,51 +1,47 @@
1
- <div class="card">
2
- <div class="card-divider">
3
- <h2 class="card-title">
4
- <%= title.html_safe %>
5
- </h2>
6
- </div>
7
-
8
- <div class="card-section">
9
- <div class="row column">
10
- <%= form.translated :text_field, :title, autofocus: true %>
11
- </div>
12
-
13
- <div class="row column">
14
- <%= form.translated :editor, :description %>
15
- </div>
16
-
17
- <div class="row column">
18
- <%= form.number_field :budget_amount %>
19
- </div>
1
+ <div class="form__wrapper">
2
+ <div class="card pt-4">
3
+ <div class="card-section">
4
+ <div class="row column">
5
+ <%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
6
+ </div>
20
7
 
21
- <% if @form.geocoding_enabled? %>
22
8
  <div class="row column">
23
- <%= form.geocoding_field :address %>
9
+ <%= form.translated :editor, :description, aria: { label: :description } %>
24
10
  </div>
25
- <% end %>
26
11
 
27
- <% if current_component.has_subscopes? %>
28
12
  <div class="row column">
29
- <%= scopes_picker_field form, :decidim_scope_id, root: budget.scope %>
13
+ <%= form.number_field :budget_amount %>
30
14
  </div>
31
- <% end %>
32
15
 
33
- <div class="row column">
34
- <%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: true, disable_parents: false %>
35
- </div>
16
+ <% if @form.geocoding_enabled? %>
17
+ <div class="row column">
18
+ <%= form.geocoding_field :address %>
19
+ </div>
20
+ <% end %>
21
+
22
+ <% if current_component.has_subscopes? %>
23
+ <div class="row column">
24
+ <%= scopes_select_field form, :decidim_scope_id, root: budget.scope %>
25
+ </div>
26
+ <% end %>
36
27
 
37
- <% if Decidim::Budgets.enable_proposal_linking %>
38
28
  <div class="row column">
39
- <%= proposals_picker(form, :proposals, proposals_picker_projects_path) %>
29
+ <%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: true, disable_parents: false %>
40
30
  </div>
41
- <% end %>
42
31
 
43
- <%= render partial: "decidim/admin/shared/gallery", locals: { form: form } %>
44
-
45
- <% if form.object.persisted? %>
32
+ <% if Decidim::Budgets.enable_proposal_linking %>
46
33
  <div class="row column">
47
- <%= form.check_box :selected %>
34
+ <%= render partial: "decidim/proposals/proposals/proposals_picker", locals: { form:, field: :proposals } %>
48
35
  </div>
49
36
  <% end %>
37
+
38
+ <%= render partial: "decidim/admin/shared/gallery", locals: { form: } %>
39
+
40
+ <% if form.object.persisted? %>
41
+ <div class="row column">
42
+ <%= form.check_box :selected %>
43
+ </div>
44
+ <% end %>
45
+ </div>
50
46
  </div>
51
47
  </div>
@@ -6,47 +6,49 @@
6
6
  <%= project.id %><br>
7
7
  </td>
8
8
  <td>
9
- <%= translated_attribute(project.title) %><br>
9
+ <% if allowed_to? :update, :project, project: project %>
10
+ <%= link_to translated_attribute(project.title), resource_locator([budget, project]).edit %><br>
11
+ <% else %>
12
+ <%= translated_attribute(project.title) %><br>
13
+ <% end %>
10
14
  </td>
11
15
  <td>
12
16
  <% if project.category %>
13
17
  <%= translated_attribute project.category.name %>
14
18
  <% end %>
15
19
  </td>
16
- <% if current_component.has_subscopes? %>
17
- <%= td_resource_scope_for(project.scope) %>
18
- <% end %>
20
+ <%= td_resource_scope_for(project.scope) %>
19
21
  <td>
20
22
  <%= project.confirmed_orders_count %>
21
23
  </td>
22
24
  <td>
23
25
  <% if project.selected? %>
24
- <%= content_tag :strong, t("yes", scope: "decidim.budgets.admin.projects.index.selected_options"), class: "label" %>
26
+ <%= content_tag :strong, t("projects.index.selected", scope: "decidim.budgets.admin"), class: "text-success" %>
25
27
  <% else %>
26
- <%= content_tag :strong, t("no", scope: "decidim.budgets.admin.projects.index.selected_options"), class: "label secondary" %>
28
+ <%= content_tag :span, "close-line", class: "text-muted" %>
27
29
  <% end %>
28
30
  </td>
29
31
  <td class="table-list__actions">
30
- <%= icon_link_to "eye", resource_locator([budget, project]).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
31
-
32
32
  <% if allowed_to? :update, :project, project: project %>
33
- <%= icon_link_to "pencil", resource_locator([budget, project]).edit, t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
33
+ <%= icon_link_to "pencil-line", resource_locator([budget, project]).edit, t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
34
34
  <% end %>
35
35
 
36
36
  <% if allowed_to? :update, :project, project: project %>
37
- <%= icon_link_to "folder", project_attachment_collections_path(project), t("actions.attachment_collections", scope: "decidim.budgets"), class: "action-icon--attachment_collections" %>
37
+ <%= icon_link_to "folder-line", project_attachment_collections_path(project), t("actions.attachment_collections", scope: "decidim.budgets"), class: "action-icon--attachment_collections" %>
38
38
  <% end %>
39
39
 
40
40
  <% if allowed_to? :update, :project, project: project %>
41
- <%= icon_link_to "paperclip", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
41
+ <%= icon_link_to "attachment-line", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
42
42
  <% end %>
43
43
 
44
+ <%= icon_link_to "eye-line", resource_locator([budget, project]).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview", data: { "external-link": false } %>
45
+
44
46
  <%= resource_permissions_link(project) %>
45
47
 
46
48
  <% if allowed_to? :destroy, :project, project: project %>
47
- <%= icon_link_to "circle-x", resource_locator([budget, project]).show, t("actions.destroy", scope: "decidim.budgets"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.budgets") } %>
49
+ <%= icon_link_to "delete-bin-line", resource_locator([budget, project]).show, t("actions.destroy", scope: "decidim.budgets"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.budgets") } %>
48
50
  <% else %>
49
- <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.destroy", scope: "decidim.budgets") %>
51
+ <%= icon "delete-bin-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.destroy", scope: "decidim.budgets") %>
50
52
  <% end %>
51
53
  </td>
52
54
  </tr>
@@ -0,0 +1,22 @@
1
+ <div id="js-budget-change-projects-actions" class="hide js-bulk-action-form">
2
+ <%= form_tag(update_budget_budget_projects_path, method: :post, remote: true, id: "js-form-budget-change-projects", class: "form form-defaults flex items-center gap-x-2") do %>
3
+
4
+ <div class="checkboxes hide">
5
+ <% projects.each do |project| %>
6
+ <%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
7
+ <% end %>
8
+ </div>
9
+
10
+ <%= budgets_select_tag(:reference_id) %>
11
+
12
+ <%= submit_tag(
13
+ t("decidim.budgets.admin.projects.index.update_budget_button"),
14
+ id: "js-submit-budget-change-projects",
15
+ class: "button button__sm button__secondary small button--simple float-left"
16
+ ) %>
17
+
18
+ <button id="js-cancel-budget-change-projects" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button">
19
+ <%= t("decidim.budgets.admin.projects.index.cancel") %>
20
+ </button>
21
+ <% end %>
22
+ </div>
@@ -1,5 +1,5 @@
1
1
  <div id="js-change-selected-projects-actions" class="hide js-bulk-action-form">
2
- <%= form_tag(update_selected_budget_projects_path, method: :post, remote: true, id: "js-form-change-selected-projects", class: "flex--cc flex-gap--1") do %>
2
+ <%= form_tag(update_selected_budget_projects_path, method: :post, remote: true, id: "js-form-change-selected-projects", class: "form form-defaults flex items-center gap-x-2") do %>
3
3
  <div class="checkboxes hide">
4
4
  <% projects.each do |project| %>
5
5
  <%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
@@ -8,8 +8,8 @@
8
8
 
9
9
  <%= bulk_selections %>
10
10
 
11
- <%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-selected", class: "button small button--simple float-left") %>
11
+ <%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-selected", class: "button button__sm button__secondary small button--simple float-left") %>
12
12
 
13
- <button id="js-cancel-edit-selected" class="button tiny clear compact js-cancel-bulk-action" type="button"><%= t("decidim.budgets.admin.projects.index.cancel") %></button>
13
+ <button id="js-cancel-edit-selected" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button"><%= t("decidim.budgets.admin.projects.index.cancel") %></button>
14
14
  <% end %>
15
15
  </div>
@@ -1,10 +1,11 @@
1
1
  <div id="js-bulk-actions-wrapper">
2
2
  <button
3
3
  id="js-bulk-actions-button"
4
- class="button button--nomargin tiny success light dropdown hide"
4
+ class="button button__sm button__secondary"
5
5
  type="button"
6
6
  data-toggle="js-bulk-actions-dropdown">
7
7
  <%= t("decidim.budgets.admin.projects.index.actions") %>
8
+ <%= icon "arrow-down-s-line", class: "dropdown-filter-icon" %>
8
9
  </button>
9
10
 
10
11
  <div
@@ -15,7 +16,7 @@
15
16
  data-dropdown="dropdown"
16
17
  data-auto-focus="false"
17
18
  data-events="resize">
18
- <ul class="list-reset">
19
+ <ul>
19
20
  <li>
20
21
  <button type="button" data-action="recategorize-projects">
21
22
  <%= t("decidim.budgets.admin.projects.index.change_category") %>
@@ -31,6 +32,11 @@
31
32
  <%= t("decidim.budgets.admin.projects.index.change_selected") %>
32
33
  </button>
33
34
  </li>
35
+ <li>
36
+ <button type="button" data-action="budget-change-projects">
37
+ <%= t("decidim.budgets.admin.projects.index.change_budget") %>
38
+ </button>
39
+ </li>
34
40
  </ul>
35
41
  </div>
36
42
  </div>
@@ -1,5 +1,5 @@
1
1
  <div id="js-recategorize-projects-actions" class="hide js-bulk-action-form">
2
- <%= form_tag(update_category_budget_projects_path, method: :post, remote: true, id: "js-form-recategorize-projects", class: "flex--cc flex-gap--1") do %>
2
+ <%= form_tag(update_category_budget_projects_path, method: :post, remote: true, id: "js-form-recategorize-projects", class: "form form-defaults flex items-center gap-x-2") do %>
3
3
  <div class="checkboxes hide">
4
4
  <% projects.each do |project| %>
5
5
  <%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
@@ -8,8 +8,8 @@
8
8
 
9
9
  <%= bulk_categories_select current_component.categories %>
10
10
 
11
- <%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-category", class: "button small button--simple float-left") %>
11
+ <%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-category", class: "button button__sm button__secondary small button--simple float-left") %>
12
12
 
13
- <button id="js-cancel-edit-category" class="button tiny clear compact js-cancel-bulk-action" type="button"><%= t("decidim.budgets.admin.projects.index.cancel") %></button>
13
+ <button id="js-cancel-edit-category" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button"><%= t("decidim.budgets.admin.projects.index.cancel") %></button>
14
14
  <% end %>
15
15
  </div>
@@ -1,24 +1,21 @@
1
1
  <div id="js-scope-change-projects-actions" class="hide js-bulk-action-form">
2
- <%= form_tag(update_scope_budget_projects_path, method: :post, remote: true, id: "js-form-scope-change-projects", class: "flex--cc flex-gap--1") do %>
2
+ <%= form_tag(update_scope_budget_projects_path, method: :post, remote: true, id: "js-form-scope-change-projects", class: "form form-defaults flex items-center gap-x-2") do %>
3
+
3
4
  <div class="checkboxes hide">
4
5
  <% projects.each do |project| %>
5
6
  <%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
6
7
  <% end %>
7
8
  </div>
8
9
 
9
- <%= scopes_picker_tag(
10
- :scope_id,
11
- try(:current_participatory_space)&.scope,
12
- field: t("models.project.fields.scope", scope: "decidim.budgets")
13
- ) %>
10
+ <%= scopes_select_tag(:scope_id) %>
14
11
 
15
12
  <%= submit_tag(
16
13
  t("decidim.budgets.admin.projects.index.update_scope_button"),
17
14
  id: "js-submit-scope-change-projects",
18
- class: "button small button--simple float-left"
15
+ class: "button button__sm button__secondary small button--simple float-left"
19
16
  ) %>
20
17
 
21
- <button id="js-cancel-scope-change-projects" class="button tiny clear compact js-cancel-bulk-action" type="button">
18
+ <button id="js-cancel-scope-change-projects" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button">
22
19
  <%= t("decidim.budgets.admin.projects.index.cancel") %>
23
20
  </button>
24
21
  <% end %>
@@ -1,8 +1,18 @@
1
1
  <% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
2
- <%= decidim_form_for([budget, @form], html: { class: "form edit_project" }) do |f| %>
3
- <%= render partial: "form", object: f, locals: { title: "#{decidim_escape_translated(budget.title)} &gt; #{t(".title")}" } %>
4
-
5
- <div class="button--double form-general-submit">
6
- <%= f.submit t(".update") %>
2
+ <div class="item_show__header">
3
+ <h2 class="item_show__header-title">
4
+ <%= "#{translated_attribute(budget.title)} #{t(".title")}" %>
5
+ </h2>
6
+ </div>
7
+ <div class="item__edit item__edit-1col">
8
+ <div class="item__edit-form">
9
+ <%= decidim_form_for([budget, @form], html: { class: "form-defaults form edit_project" }) do |f| %>
10
+ <%= render partial: "form", object: f %>
11
+ <div class="item__edit-sticky">
12
+ <div class="item__edit-sticky-container">
13
+ <%= f.submit t(".update"), class: "button button__sm button__secondary" %>
14
+ </div>
15
+ </div>
16
+ <% end %>
7
17
  </div>
8
- <% end %>
18
+ </div>
@@ -1,42 +1,37 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
- <div class="card with-overflow">
3
- <div class="card-divider">
4
- <h2 class="card-title flex--sbc">
2
+ <div class="card">
3
+ <div class="item_show__header">
4
+ <h2 class="item_show__header-title">
5
5
  <div>
6
- <%= link_to decidim_escape_translated(budget.title).html_safe, budgets_path %> &gt;
6
+ <%= link_to translated_attribute(budget.title), budgets_path %> &gt;
7
7
  <%= t(".title") %>
8
8
  <span id="js-selected-resources-count" class="component-counter component-counter--inline" title="<%= t("decidim.budgets.admin.projects.index.selected") %>"></span>
9
9
  </div>
10
10
  <%= render partial: "bulk-actions" %>
11
11
  </h2>
12
12
  </div>
13
-
14
13
  <%= admin_filter_selector(:projects) %>
15
- <div class="card-section">
16
- <div class="table-scroll">
17
- <table class="table-list">
18
- <thead>
19
- <tr>
20
- <th><%= check_box_tag "projects_bulk", "all", false, class: "js-check-all" %></th>
21
- <th><%= sort_link(query, :id, t("models.project.fields.id", scope: "decidim.budgets"), default_order: :desc) %>
22
- <th><%= sort_link(query, :title, t("models.project.fields.title", scope: "decidim.budgets")) %></th>
23
- <th><%= sort_link(query, :category_name, t("models.project.fields.category", scope: "decidim.budgets") ) %></th>
24
- <% if current_component.has_subscopes? %>
25
- <%= th_scope_sort_link %>
26
- <% end %>
27
- <th><%= sort_link(query, :confirmed_orders_count, t("index.confirmed_orders_count")) %></th>
28
- <th><%= sort_link(query, :selected, t(".selected")) %></th>
29
- <th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
30
- </tr>
31
- </thead>
32
- <tbody>
33
- <% projects.each do |project| %>
34
- <%= render partial: "project-tr", locals: { project: project } %>
35
- <% end %>
36
- </tbody>
37
- </table>
38
- <%= paginate projects, theme: "decidim" %>
39
- </div>
14
+ <div class="table-scroll">
15
+ <table class="table-list">
16
+ <thead>
17
+ <tr>
18
+ <th><%= check_box_tag "projects_bulk", "all", false, class: "js-check-all" %></th>
19
+ <th><%= sort_link(query, :id, t("models.project.fields.id", scope: "decidim.budgets"), default_order: :desc) %>
20
+ <th><%= sort_link(query, :title, t("models.project.fields.title", scope: "decidim.budgets")) %></th>
21
+ <th><%= sort_link(query, :category_name, t("models.project.fields.category", scope: "decidim.budgets") ) %></th>
22
+ <%= th_scope_sort_link %>
23
+ <th><%= sort_link(query, :confirmed_orders_count, t("index.confirmed_orders_count")) %></th>
24
+ <th><%= sort_link(query, :selected, t(".selected")) %></th>
25
+ <th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
26
+ </tr>
27
+ </thead>
28
+ <tbody>
29
+ <% projects.each do |project| %>
30
+ <%= render partial: "project-tr", locals: { project: } %>
31
+ <% end %>
32
+ </tbody>
33
+ </table>
34
+ <%= decidim_paginate projects %>
40
35
  </div>
41
36
  <div class="card-divider">
42
37
  <strong><%= t ".finished_orders" %>:&nbsp;</strong><span><%= finished_orders.count %></span>
@@ -45,4 +40,4 @@
45
40
  </div>
46
41
  </div>
47
42
 
48
- <%= javascript_pack_tag "decidim_budgets_admin" %>
43
+ <%= append_javascript_pack_tag "decidim_budgets_admin" %>
@@ -1,8 +1,18 @@
1
1
  <% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
2
- <%= decidim_form_for([budget, @form], html: { class: "form new_project" }) do |f| %>
3
- <%= render partial: "form", object: f, locals: { title: "#{decidim_escape_translated(budget.title)} &gt; #{t(".title")}" } %>
4
-
5
- <div class="button--double form-general-submit">
6
- <%= f.submit t(".create") %>
2
+ <div class="item_show__header">
3
+ <h2 class="item_show__header-title">
4
+ <%= "#{translated_attribute(budget.title)} &gt; #{t(".title")}".html_safe %>
5
+ </h2>
6
+ </div>
7
+ <div class="item__edit item__edit-1col">
8
+ <div class="item__edit-form">
9
+ <%= decidim_form_for([budget, @form], html: { class: "form-defaults form new_project" }) do |f| %>
10
+ <%= render partial: "form", object: f %>
11
+ <div class="item__edit-sticky">
12
+ <div class="item__edit-sticky-container">
13
+ <%= f.submit t(".create"), class: "button button__sm button__secondary" %>
14
+ </div>
15
+ </div>
16
+ <% end %>
7
17
  </div>
8
- <% end %>
18
+ </div>
@@ -1,19 +1,23 @@
1
1
  <% if flash.now[:error].present? %>
2
2
  $("<%= form_selector %> <%= attribute_selector %>").addClass("is-invalid-input")
3
- $("<%= escape_javascript(render partial: %q{decidim/admin/shared/js-callout}, locals: { css: %q{alert}, text: flash.now[:error] }) %>").appendTo(".callout-wrapper");
3
+ $("<%= escape_javascript(render partial: %q(decidim/admin/shared/js-callout), locals: { css: %q(alert), text: flash.now[:error] }) %>").appendTo(".callout-wrapper");
4
4
  <% end %>
5
5
 
6
6
  <% if flash.now[:alert].present? %>
7
7
  $("<%= form_selector %> <%= attribute_selector %>").removeClass("is-invalid-input")
8
- $("<%= escape_javascript(render partial: %q{decidim/admin/shared/js-callout}, locals: { css: %q{warning}, text: flash.now[:alert] }) %>").appendTo(".callout-wrapper");
8
+ $("<%= escape_javascript(render partial: %q(decidim/admin/shared/js-callout), locals: { css: %q(warning), text: flash.now[:alert] }) %>").appendTo(".callout-wrapper");
9
9
  <% end %>
10
10
 
11
11
  <% if flash.now[:notice].present? %>
12
- $("<%= escape_javascript(render partial: %q{decidim/admin/shared/js-callout}, locals: { css: %q{success}, text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
12
+ $("<%= escape_javascript(render partial: %q(decidim/admin/shared/js-callout), locals: { css: %q(success), text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
13
+
14
+ <% @moved_items&.each do |id| %>
15
+ $(".table-list [data-id='<%= id %>']").remove()
16
+ <% end %>
13
17
 
14
18
  <% project_ids.each do |id| %>
15
19
  $(".table-list [data-id='<%= id %>']")
16
- .replaceWith("<%= escape_javascript(render partial: %q{project-tr}, locals: { project: Decidim::Budgets::Project.find(id) }) %>");
20
+ .replaceWith("<%= escape_javascript(render partial: %q(project-tr), locals: { project: Decidim::Budgets::Project.find(id) }) %>");
17
21
  <% end %>
18
22
 
19
23
  $("<%= form_selector %> <%= attribute_selector %>").removeClass("is-invalid-input")
@@ -1,33 +1,45 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
- <%= decidim_form_for(@form, url: budget_proposals_import_path(budget), html: { class: "form import_proposals" }) do |f| %>
3
- <% if @form.origin_components.any? %>
4
- <div class="card">
5
- <div class="card-divider">
6
- <h2 class="card-title"><%= t(".title") %></h2>
7
- </div>
8
2
 
9
- <div class="card-section">
10
- <div class="row column">
11
- <%= f.select :origin_component_id, @form.origin_components_collection, prompt: t(".select_component"), label: t(".origin_component_id") %>
12
- </div>
13
- <% if current_component.scopes_enabled? %>
14
- <div class="row column">
15
- <%= scopes_picker_field f, :scope_id, root: budget.scope %>
3
+ <div class="item_show__header">
4
+ <h2 class="item_show__header-title">
5
+ <%= t(".title") %>
6
+ </h2>
7
+ </div>
8
+
9
+ <div class="item__edit item__edit-1col">
10
+ <div class="item__edit-form">
11
+ <%= decidim_form_for(@form, url: budget_proposals_import_path(budget), html: { class: "form form-defaults import_proposals" }) do |f| %>
12
+ <% if @form.origin_components.any? %>
13
+ <div class="form__wrapper">
14
+ <div class="card">
15
+ <div class="card-divider"></div>
16
+ <div class="card-section">
17
+ <div class="row column">
18
+ <%= f.select :origin_component_id, @form.origin_components_collection, prompt: t(".select_component"), label: t(".origin_component_id") %>
19
+ </div>
20
+ <% if current_component.scopes_enabled? %>
21
+ <div class="row column">
22
+ <%= scopes_select_field f, :scope_id, root: budget.scope %>
23
+ </div>
24
+ <% end %>
25
+ <div class="row column">
26
+ <%= f.number_field :default_budget, label: t(".default_budget") %>
27
+ </div>
28
+ <div class="row column">
29
+ <%= f.check_box :import_all_accepted_proposals, label: t(".import_all_accepted_proposals") %>
30
+ </div>
31
+ </div>
16
32
  </div>
17
- <% end %>
18
- <div class="row column">
19
- <%= f.number_field :default_budget, label: t(".default_budget") %>
20
- </div>
21
- <div class="row column">
22
- <%= f.check_box :import_all_accepted_proposals, label: t(".import_all_accepted_proposals") %>
23
33
  </div>
24
- </div>
25
- </div>
26
34
 
27
- <div class="button--double form-general-submit">
28
- <%= f.submit t(".create") %>
29
- </div>
30
- <% else %>
31
- <p><%= t(".no_components") %></p>
32
- <% end %>
33
- <% end %>
35
+ <div class="item__edit-sticky">
36
+ <div class="item__edit-sticky-container">
37
+ <%= f.submit t(".create"), class: "button button__sm button__secondary" %>
38
+ </div>
39
+ </div>
40
+ <% else %>
41
+ <p><%= t(".no_components") %></p>
42
+ <% end %>
43
+ <% end %>
44
+ </div>
45
+ </div>
@@ -1,5 +1,23 @@
1
- <%= render partial: "decidim/shared/component_announcement" %>
1
+ <% add_decidim_page_title component_name %>
2
+ <%= append_javascript_pack_tag "decidim_budgets" %>
3
+ <%= append_stylesheet_pack_tag "decidim_budgets", media: "all" %>
2
4
 
3
- <%= cell("decidim/budgets/budgets_header", current_workflow) %>
5
+ <% content_for :aside do %>
6
+ <h1 class="title-decorator"><%= component_name %></h1>
7
+ <% end %>
4
8
 
5
- <%= cell("decidim/budgets/budgets_list", current_workflow) %>
9
+ <%= render layout: "layouts/decidim/shared/layout_two_col" do %>
10
+ <%= render partial: "decidim/shared/component_announcement" %>
11
+
12
+ <% if current_workflow.budgets.empty? %>
13
+ <%= cell("decidim/announcement", t("empty", scope: "decidim.budgets.budgets_list")) %>
14
+ <% end %>
15
+
16
+ <section class="layout-main__section">
17
+ <%= cell("decidim/budgets/budgets_header", current_workflow) %>
18
+ </section>
19
+
20
+ <section class="layout-main__section layout-main__heading">
21
+ <%= cell("decidim/budgets/budgets_list", current_workflow) %>
22
+ </section>
23
+ <% end %>
@@ -0,0 +1,6 @@
1
+ var $budgets = $('#budgets');
2
+
3
+ if ($budgets.length > 0) {
4
+ $budgets.html('<%= j(cell("decidim/budgets/budgets_list", current_workflow).main_list).strip.html_safe %>');
5
+ document.dispatchEvent(new CustomEvent("ajax:loaded", { detail: $budgets[0] }));
6
+ }
@@ -1,24 +1,34 @@
1
- var $orderTotalBudget = $('#order-total-budget');
2
- var $orderSelectedProjects = $('#order-selected-projects');
3
- var $orderProgress = $('#order-progress');
1
+ var $orderSelectedProjectsCount = $('#order-selected-projects-count');
2
+ var $orderProgress = document.querySelectorAll('[id^=order-progress] .budget-summary__content');
4
3
  var $projectItem = $('#project-<%= project.id %>-item');
5
4
  var $projectBudgetButton = $('#project-<%= project.id %>-budget-button');
6
5
  var $budgetConfirm = $('#budget-confirm');
7
6
 
8
- morphdom($orderTotalBudget[0], '<%= j(render partial: "decidim/budgets/projects/order_total_budget").strip.html_safe %>');
9
- morphdom($orderSelectedProjects[0], '<%= j(render partial: "decidim/budgets/projects/order_selected_projects").strip.html_safe %>');
10
- morphdom($orderProgress[0], '<%= j(render partial: "decidim/budgets/projects/order_progress").strip.html_safe %>');
11
- morphdom($budgetConfirm[0], '<%= j(render partial: "decidim/budgets/projects/budget_confirm").strip.html_safe %>')
7
+ $orderProgress.forEach((orderProgress) => {
8
+ var $orderTotalBudget = $(orderProgress).find("[id^=order-total-budget]");
9
+ $orderTotalBudget.html('<%= j(render partial: "decidim/budgets/projects/order_total_budget").strip.html_safe %>');
12
10
 
13
- $("#order-progress").foundation();
14
- $(".budget-summary__selected").foundation();
11
+ if(orderProgress.dataset.orderProgressResponsive) {
12
+ morphdom(orderProgress, '<%= j(render partial: "decidim/budgets/projects/order_progress_summary_content", locals: { include_heading: true, responsive: true }).strip.html_safe %>');
13
+ } else {
14
+ morphdom(orderProgress, '<%= j(render partial: "decidim/budgets/projects/order_progress_summary_content", locals: { include_heading: true, responsive: false }).strip.html_safe %>');
15
+ }
16
+ })
17
+ morphdom($budgetConfirm[0], '<%= j(render partial: "decidim/budgets/projects/budget_confirm").strip.html_safe %>')
18
+ if ($orderSelectedProjectsCount.length > 0) {
19
+ morphdom($orderSelectedProjectsCount[0], '<%= j(render partial: "decidim/budgets/projects/projects_count", locals: { count: current_order.projects.size }).strip.html_safe %>')
20
+ }
15
21
 
16
22
  if ($projectItem.length > 0) {
17
- morphdom($projectItem[0], '<%= j(render partial: "decidim/budgets/projects/project", locals: { project: project }).strip.html_safe %>');
23
+ <% if params[:action] == "destroy" && params[:show_only_added] == "true" %>
24
+ $projectItem[0].remove();
25
+ <% else %>
26
+ morphdom($projectItem[0], '<%= j(render partial: "decidim/budgets/projects/project", locals: { project: }).strip.html_safe %>');
27
+ <% end %>
18
28
  }
19
29
 
20
30
  if ($projectBudgetButton.length > 0) {
21
- morphdom($projectBudgetButton[0], '<%= j(render partial: "decidim/budgets/projects/project_budget_button", locals: { project: project }).strip.html_safe %>');
31
+ morphdom($projectBudgetButton[0], '<%= j(render partial: "decidim/budgets/projects/project_budget_button", locals: { project: }).strip.html_safe %>');
22
32
  }
23
33
 
24
34
  window.DecidimBudgets.checkProgressPosition();
@@ -0,0 +1,16 @@
1
+ <%= filter_form_for filter, url_for, data: { filters: "", component: "accordion" } do |form| %>
2
+ <%= form.collection_radio_buttons(
3
+ :addition_type,
4
+ filter_addition_type_values(added_count: search.result.with_order(current_order).size),
5
+ :first,
6
+ :last
7
+ ) do |builder|
8
+ builder.label(class: "button button__xs button__pill #{filter.addition_type == builder.value ? 'button__pill--active' : ''}") do %>
9
+ <span>
10
+ <%= builder.text[:text] %>
11
+ </span>
12
+ <%= render partial: "projects_count", locals: { count: builder.text[:count] } %>
13
+ <%= builder.radio_button(class: "!hidden") %>
14
+ <% end %>
15
+ <% end %>
16
+ <% end %>