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,32 +1,43 @@
1
- <div class="reveal" data-reveal id="budget-confirm">
2
- <% if current_order.present? %>
3
- <div class="reveal__header">
4
- <h3 class="reveal__title"><%= t(".title") %></h3>
5
- <button class="close-button" data-close aria-label="<%= t(".cancel") %>" type="button">
6
- <span aria-hidden="true">&times;</span>
7
- </button>
1
+ <%= decidim_modal id: "budget-confirm", class:"verification-modal" do %>
2
+ <div data-dialog-container>
3
+ <%= icon "check-double-line" %>
4
+ <h3 class="h3" id="dialog-title-budget-confirm" data-dialog-title>
5
+ <%= t("title", scope: "decidim.budgets.projects.budget_confirm") %>
6
+ </h3>
7
+ <div class="my-8" id="budget-confirm-current-order">
8
+ <% if current_order.present? %>
9
+ <h4 class="h4 mb-4"><%= translated_attribute(budget.title) %></h4>
10
+ <p class="mb-4"><%= t(".description") %></p>
11
+ <div class="card card--secondary">
12
+ <% current_order.projects.each do |project| %>
13
+ <div class="card__list card__list__project-voted">
14
+ <div class="card__list__content">
15
+ <div class="card__list-text">
16
+ <%= link_to translated_attribute(project.title), resource_locator([budget, project]).path, class: "card__list-title" %>
17
+ </div>
18
+ </div>
19
+ <div class="budget__card__list-project">
20
+ <span class="budget-list__data__number budget-list__number-show-for-medium">
21
+ <%= budget_to_currency project.budget_amount %>
22
+ </span>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+ </div>
27
+ <% end %>
8
28
  </div>
9
- <p><%= t(".description") %></p>
10
- <div class="card card--secondary">
11
- <ul class="card__content">
12
- <% current_order.projects.each do |project| %>
13
- <li class="budget-summary__selected-item">
14
- <%= link_to translated_attribute(project.title), resource_locator([budget, project]).path %>
15
- <strong class="budget-summary__selected-number">
16
- <%= budget_to_currency project.budget_amount %>
17
- </strong>
18
- </li>
19
- <% end %>
20
- </ul>
21
- </div>
22
- <p class="text-center"><%= t(".are_you_sure") %></p>
23
- <div class="row">
24
- <div class="columns medium-8 medium-offset-2">
25
- <%= button_to t(".confirm"), checkout_budget_order_path(budget), class: "button expanded", data: { disable: true } %>
26
- </div>
27
- </div>
28
- <div class="text-center">
29
- <button class="link" data-close><%= t(".cancel") %></button>
30
- </div>
31
- <% end %>
32
- </div>
29
+ </div>
30
+ <div data-dialog-actions>
31
+
32
+ <button class="button button__sm md:button__lg button__transparent-secondary" data-dialog-close="budget-confirm">
33
+ <%= t("cancel", scope: "decidim.budgets.projects.budget_confirm") %>
34
+ </button>
35
+
36
+ <%= button_to checkout_budget_order_path(budget), class: "button button__sm md:button__lg button__secondary", data: { disable: true } do %>
37
+ <span>
38
+ <%= t("confirm", scope: "decidim.budgets.projects.budget_confirm") %>
39
+ </span>
40
+ <%= icon "arrow-right-line", class: "fill-current" %>
41
+ <% end %>
42
+ </div>
43
+ <% end %>
@@ -1,14 +1,14 @@
1
- <div class="reveal" data-reveal id="budget-excess">
2
- <div class="reveal__header">
3
- <h3 class="reveal__title"><%= current_order.projects_rule? ? t(".projects_excess.title") : t(".budget_excess.title") %></h3>
4
- <button class="close-button" data-close aria-label="<%= t(".close") %>" type="button">
5
- <span aria-hidden="true">&times;</span>
6
- </button>
1
+ <%= decidim_modal id: "budget-excess" do %>
2
+ <div data-dialog-container>
3
+ <%= icon "error-warning-line" %>
4
+ <h3 class="h3" id="dialog-title-budget-excess" data-dialog-title>
5
+ <%= current_order.projects_rule? ? t(".projects_excess.title") : t(".budget_excess.title") %>
6
+ </h3>
7
+ <p id="dialog-desc-budget-excess"><%= current_order.projects_rule? ? t(".projects_excess.description") : t(".budget_excess.description") %></p>
7
8
  </div>
8
- <p><%= current_order.projects_rule? ? t(".projects_excess.description") : t(".budget_excess.description") %></p>
9
- <div class="row">
10
- <div class="columns medium-8 medium-offset-2">
11
- <button data-close class="button expanded"><%= t(".ok") %></button>
12
- </div>
9
+ <div data-dialog-actions>
10
+ <button data-dialog-close="budget-excess" class="button button__sm md:button__lg button__secondary">
11
+ <%= t("ok", scope: "decidim.budgets.projects.budget_excess") %>
12
+ </button>
13
13
  </div>
14
- </div>
14
+ <% end %>
@@ -1,76 +1,3 @@
1
- <div class="row column voting-rules">
2
- <div class="callout warning">
3
- <div class="row">
4
- <div class="columns medium-8 large-9">
5
- <h2 class="heading3">
6
- <%= t(".rules.title") %>
7
- </h2>
8
- <ul>
9
- <%= raw current_rule_explanation %>
10
- </ul>
11
- </div>
12
- </div>
13
- </div>
1
+ <div id="order-progress<%= "-responsive" if responsive %>" class="budget-summary <%= responsive ? "block md:hidden" : "hidden md:block" %>" data-progress-reference data-safe-url="<%= budget_url(budget) %>">
2
+ <%= render partial: "order_progress_summary_content", locals: { responsive: , include_heading: } %>
14
3
  </div>
15
- <div class="card budget-summary" data-progress-reference data-safe-url="<%= budget_url(budget) %>">
16
- <div class="card__content">
17
- <% if include_heading %>
18
- <% if current_order_checked_out? %>
19
- <h2 class="heading3">
20
- <%= t(".checked_out.title") %>
21
- <% unless current_workflow.single? %>
22
- <small><%= translated_attribute(budget.title) %></small>
23
- <% end %>
24
- </h2>
25
- <p>
26
- <%= raw t(".checked_out.description", cancel_link: link_to(t(".cancel_order"), budget_order_path(return_to: "budget"), method: :delete, class: "cancel-order", data: { confirm: t(".are_you_sure") })) %>
27
- </p>
28
- <% else %>
29
- <h2 class="heading3">
30
- <% if current_workflow.single? %>
31
- <%= t(".title") %>
32
- <% else %>
33
- <%= translated_attribute(budget.title) %>
34
- <% end %>
35
- </h2>
36
- <p>
37
- <%= raw current_rule_description %>
38
- </p>
39
- <% end %>
40
- <% end %>
41
-
42
- <% if current_order.projects_rule? %>
43
- <div class="budget-summary__total" data-total-allocation="<%= current_order.available_allocation %>">
44
- <span class="mini-title"><%= t(".total_projects") %>
45
- <strong class="mini-title__strong mini-title__strong--highlight">
46
- <%= current_order.maximum_projects %>
47
- </strong>
48
- </span>
49
- </div>
50
- <% else %>
51
- <div class="budget-summary__total" data-total-allocation="<%= current_order.available_allocation %>" data-total-budget="<%= budget.total_budget %>">
52
- <span class="mini-title"><%= t(".total_budget") %>
53
- <strong class="mini-title__strong mini-title__strong--highlight">
54
- <%= budget_to_currency(budget.total_budget) %>
55
- </strong>
56
- </span>
57
- </div>
58
- <% end %>
59
-
60
- <%= render partial: "order_progress" %>
61
-
62
- <div>
63
- <span class="mini-title">
64
- <%= t(".assigned") %>
65
- <%= render partial: "order_total_budget" %>
66
- </span>
67
- </div>
68
-
69
- <%= cell("decidim/budgets/budget_information_modal", budget) %>
70
- </div>
71
-
72
- <%= render partial: "order_selected_projects" %>
73
- </div>
74
-
75
- <%= render partial: "budget_excess" %>
76
- <%= render partial: "budget_confirm" %>
@@ -1,22 +1,19 @@
1
1
  <% if current_user && current_component.current_settings.votes == "enabled" && !current_workflow.voted?(budget) %>
2
- <div class="reveal" data-reveal id="exit-notification" role="dialog" aria-modal="true" aria-labelledby="exit-notification-label" aria-live="polite">
3
- <div class="reveal__header">
4
- <h3 id="exit-notification-label" class="reveal__title"><%= t(".title") %></h3>
5
- <button class="close-button" data-close aria-label="<%= t(".close_modal") %>" type="button">
6
- <span aria-hidden="true">&times;</span>
7
- </button>
8
- </div>
9
- <div class="static__content text-center">
10
- <p><%= t(".message") %></p>
2
+ <%= decidim_modal id: "exit-notification" do %>
3
+ <div data-dialog-container>
4
+ <%= icon "information-line" %>
5
+ <h3 class="h3" id="dialog-title-exit-notification" tabindex="-1" data-dialog-title>
6
+ <%= t("title", scope: "decidim.budgets.projects.exit_modal") %>
7
+ </h3>
8
+ <p id="dialog-desc-budget-modal">
9
+ <%= t("message", scope: "decidim.budgets.projects.exit_modal") %>
10
+ </p>
11
11
  </div>
12
-
13
- <div class="row">
14
- <div class="columns medium-8 medium-offset-2">
15
- <button class="button primary expanded" data-close type="button">
16
- <%= t(".cancel") %>
17
- </button>
18
- <%= link_to t(".exit"), budget_projects_path, id: "exit-notification-link", class: "button primary hollow expanded" %>
19
- </div>
12
+ <div data-dialog-actions>
13
+ <button data-dialog-close="exit-notification" class="button button__sm md:button__lg button__secondary">
14
+ <p><%= t("cancel", scope: "decidim.budgets.projects.exit_modal") %></p>
15
+ </button>
16
+ <%= link_to t("exit", scope: "decidim.budgets.projects.exit_modal"), budget_projects_path, id: "exit-notification-link", class: "button button__sm md:button__lg button__secondary" %>
20
17
  </div>
21
- </div>
18
+ <% end %>
22
19
  <% end %>
@@ -1,12 +1,3 @@
1
- <div class="card card--action card--list">
2
- <% resources.each do |project| %>
3
- <div class="card--list__item">
4
- <%= icon "actions", class: "card--list__icon", role: "img", "aria-hidden": true, remove_icon_class: true %>
5
- <%= link_to resource_locator([project.budget, project]).path, class: "card--list__text card__link card__link--block" do %>
6
- <h5 class="card--list__heading">
7
- <%= translated_attribute(project.title) %>
8
- </h5>
9
- <% end %>
10
- </div>
11
- <% end %>
12
- </div>
1
+ <% resources.each do |project| %>
2
+ <%= cell "decidim/budgets/project_l", project, url_extra_params: { included_in: resource.to_gid } %>
3
+ <% end %>
@@ -0,0 +1 @@
1
+ <%= order_selector available_orders, i18n_scope: "decidim.budgets.projects.orders" %>
@@ -0,0 +1,10 @@
1
+ <span class="budget-summary__progressbar-legend budget-summary__progressbar-marks_right" data-total-allocation="<%= current_order.available_allocation %>">
2
+ <%= t("budget", scope: "decidim.budgets.projects.order_progress") %>
3
+ <strong class="budget-summary__progressbar-legend-strong">
4
+ <% if current_order.projects_rule? %>
5
+ <%= current_order.maximum_projects %>
6
+ <% else %>
7
+ <%= budget_to_currency(budget.total_budget) %>
8
+ <% end %>
9
+ </strong>
10
+ </span>
@@ -0,0 +1,113 @@
1
+ <div data-order-progress-responsive="<%= responsive.inspect %>" class="budget-summary__content">
2
+ <div class="budget-summary__progressbox" data-current-allocation="<%= current_order ? current_order.total : 0 %>">
3
+ <% if include_heading %>
4
+ <% if current_order_checked_out? %>
5
+ <%= t("title", scope: "decidim.budgets.projects.budget_summary.checked_out") %>
6
+ <div class="budget-summary__content__header">
7
+ <span class="budget-summary__content__header--title">
8
+ <%= t("name", scope: "decidim.components.budgets") %>
9
+ </span>
10
+ /
11
+ <%= translated_attribute(budget.title) %>
12
+ <p class="budget-summary__content__header--description">
13
+ <%= t("description", scope: "decidim.budgets.projects.budget_summary.checked_out") %>
14
+ </p>
15
+ </div>
16
+ <% else %>
17
+ <p class="budget-summary__progressbox--checked_out">
18
+ <%= current_rule_description %>
19
+ </p>
20
+ <% end %>
21
+ <% end %>
22
+ <div class="budget-summary__progressbar">
23
+ <div class="progress budget-progress" role="progressbar" aria-label="<%= t("budget", scope: "decidim.budgets.projects.order_progress") %>" aria-valuenow="<%= current_order_budget_percent %>" aria-valuetext="<%= current_order_budget_percent %> %" aria-valuemin="0" aria-valuemax="100">
24
+ <div class="progress-meter budget-summary__progressbar--minimum" style="width: <%= current_order_budget_percent_minimum %>%">
25
+ <span class="progress-meter--minimum-mark"></span>
26
+ </div>
27
+ <div class="progress-meter budget-summary__progressbar--meter" style="width: <%= current_order_budget_percent %>%"> </div>
28
+ </div>
29
+ <div class="budget-summary__progressbar-marks">
30
+ <span class="budget-summary__progressbar-legend" style="width: <%= current_order_budget_percent_minimum %>%;">
31
+ <%= t("assigned", scope: "decidim.budgets.projects.order_progress") %>
32
+ <strong id="order-total-budget<%= "-responsive" if responsive %>" class="budget-summary__progressbar-legend-strong">
33
+ <%= render partial: "decidim/budgets/projects/order_total_budget" %>
34
+ </strong>
35
+ </span>
36
+ <% if current_order.minimum_budget > 0 %>
37
+ <span class="budget-summary__progressbar-legend budget-summary__progressbar-marks_center">
38
+ <%= t("minimum", scope: "decidim.budgets.projects.order_progress") %>
39
+ <strong class="budget-summary__progressbar-legend-strong">
40
+ <%= budget_to_currency(current_order.minimum_budget) %>
41
+ </strong>
42
+ </span>
43
+ <% end %>
44
+ <%= render partial: "decidim/budgets/projects/order_progress_progressbar_marks_right" %>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ <div class="budget-summary__progressbox-buttons">
49
+ <% if !current_order_checked_out? && voting_open? %>
50
+ <button class="button button__secondary button__lg w-full" data-dialog-open="budget-confirm" <%= budget_confirm_disabled_attr %>>
51
+ <%= t("vote", scope: "decidim.budgets.projects.budget_summary") %>
52
+ <%= icon "check-line" %>
53
+ </button>
54
+ <% end %>
55
+ <% if include_heading && current_order_checked_out? %>
56
+ <%= link_to budget_order_path(return_to: "budget"), method: :delete, class: "button button__lg button__secondary cancel-order w-full", data: { confirm: t("are_you_sure", scope: "decidim.budgets.projects.budget_confirm") } do %>
57
+ <span><%= t("cancel_order", scope: "decidim.budgets.projects.budget_summary") %></span>
58
+ <%= icon "delete-bin-line" %>
59
+ <% end %>
60
+ <% end %>
61
+ </div>
62
+ <div class="budget-summary__button-modal">
63
+ <button type="button" data-dialog-open="budget-modal-info" aria-haspopup="dialog" tabindex="0" class="button button__text button__xs">
64
+ <%= t("more_information", scope: "decidim.budgets.budget_information_modal") %>
65
+ </button>
66
+ </div>
67
+ <div class="w-screen max-w-screen progressbox-fixed-wrapper" data-progressbox-fixed>
68
+ <div class="gap-0 layout-item py-4 items-center budget-summary__progressbar">
69
+ <div class="budget-summary__progressbox layout-item__main">
70
+ <div class="progress budget-progress relative" role="progressbar" aria-valuenow="<%= current_order_budget_percent %>" aria-valuetext="<%= current_order_budget_percent %>%" aria-valuemin="0" aria-valuemax="100">
71
+ <div class="progress-meter budget-summary__progressbar--minimum" style="width: <%= current_order_budget_percent_minimum %>%">
72
+ <span class="progress-meter--minimum-mark"></span>
73
+ </div>
74
+ <div class="progress-meter budget-summary__progressbar--meter" style="width: <%= current_order_budget_percent %>%">
75
+ </div>
76
+ </div>
77
+ <div class="budget-summary__progressbar-marks">
78
+ <span class="budget-summary__progressbar-legend" style="width: <%= current_order_budget_percent_minimum %>%;">
79
+ <%= t("assigned", scope: "decidim.budgets.projects.order_progress") %>
80
+ <strong id="order-total-budget-sticky<%= "-responsive" if responsive %>" class="budget-summary__progressbar-legend-strong">
81
+ <%= render partial: "decidim/budgets/projects/order_total_budget" %>
82
+ </strong>
83
+ </span>
84
+ <% if current_order.minimum_budget > 0 %>
85
+ <span class="budget-summary__progressbar-legend budget-summary__progressbar-marks_center">
86
+ <%= t("minimum", scope: "decidim.budgets.projects.order_progress") %>
87
+ <strong class="budget-summary__progressbar-legend-strong">
88
+ <%= budget_to_currency(current_order.minimum_budget) %>
89
+ </strong>
90
+ </span>
91
+ <% end %>
92
+ <%= render partial: "decidim/budgets/projects/order_progress_progressbar_marks_right" %>
93
+ </div>
94
+ </div>
95
+ <div class="layout-item__aside budget-summary__progressbox-buttons">
96
+ <% if !current_order_checked_out? && voting_open? %>
97
+ <button class="button button__secondary button__lg mt-2 md:mt-0 w-full" data-dialog-open="budget-confirm" <%= budget_confirm_disabled_attr %>>
98
+ <span>
99
+ <%= t("vote", scope: "decidim.budgets.projects.budget_summary") %>
100
+ </span>
101
+ <%= icon "check-line" %>
102
+ </button>
103
+ <% end %>
104
+ <% if include_heading && current_order_checked_out? %>
105
+ <%= link_to budget_order_path(return_to: "budget"), method: :delete, class: "button button__lg button__secondary cancel-order w-full mt-2 md:mt-0", data: { confirm: t("are_you_sure", scope: "decidim.budgets.projects.budget_confirm") } do %>
106
+ <span><%= t("cancel_order", scope: "decidim.budgets.projects.budget_summary") %></span>
107
+ <%= icon "delete-bin-line" %>
108
+ <% end %>
109
+ <% end %>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ </div>
@@ -1,7 +1,6 @@
1
- <strong id="order-total-budget" class="mini-title__strong">
2
- <% if current_order.projects_rule? %>
3
- <%= current_order.projects.count %> / <%= current_order.maximum_projects %>
4
- <% else %>
5
- <%= budget_to_currency current_order&.total_budget.to_f %>
6
- <% end %>
7
- </strong>
1
+ <% if current_order.projects_rule? %>
2
+ <%= current_order.projects.count %> /
3
+ <%= current_order.maximum_projects %>
4
+ <% else %>
5
+ <%= budget_to_currency current_order&.total_budget.to_f %>
6
+ <% end %>
@@ -1 +1,2 @@
1
- <%= cell "decidim/budgets/project_list_item", project %>
1
+ <% show_only_added ||= params.dig(:filter, :addition_type) == "added" %>
2
+ <%= card_for project, render_extra_data: true, link_whole_card: false, wrapper_class: "project-item", show_only_added: %>
@@ -1,19 +1,11 @@
1
- <% if current_user.blank? %>
2
- <div id="project-<%= project.id %>-budget-button">
3
- <button class="button expanded primary button--sc"
4
- data-toggle="loginModal"
5
- aria-label="<%= t(".added_descriptive", resource_name: translated_attribute(project.title)) %>">
6
- <%= t(".add") %>
7
- </button>
8
- </div>
9
- <% else %>
10
- <div id="project-<%= project.id %>-budget-button"
11
- class="<%= "added" if voted_for?(project) %> button expanded primary button--sc budget-vote-button budget-list__data"
12
- aria-label="<%= t(".#{voted_for?(project) ? ".added" : ".add"}_descriptive", resource_name: translated_attribute(project.title)) %>">
13
- <span>
14
- <%= t(voted_for?(project) ? ".added" : ".add") %>
15
- </span>
16
-
17
- <%= cell("decidim/budgets/project_vote_button", project) %>
18
- </div>
19
- <% end %>
1
+ <div id="project-<%= project.id %>-budget-button">
2
+ <% if current_user.blank? %>
3
+ <button class="button button__lg w-full button__secondary"
4
+ data-dialog-open="loginModal"
5
+ aria-label="<%= t(".added_descriptive", resource_name: translated_attribute(project.title)) %>">
6
+ <%= t("add", scope: "decidim.budgets.projects.project_budget_button") %>
7
+ </button>
8
+ <% else %>
9
+ <%= cell("decidim/budgets/project_vote_button", project, project_item: true) %>
10
+ <% end %>
11
+ </div>
@@ -1,13 +1,15 @@
1
- <div class="collection-sort-controls row small-up-1 medium-up-3 card-grid">
2
- <div class="column">
3
- <%= order_selector available_orders, i18n_scope: "decidim.budgets.projects.orders" %>
1
+ <div class="budget__list--header">
2
+ <div>
3
+ <%= render partial: "addition_selector" %>
4
+ </div>
5
+
6
+ <div class="collection-sort-controls">
7
+ <%= render partial: "order" %>
4
8
  </div>
5
9
  </div>
6
10
 
7
11
  <div class="budget-list">
8
- <% projects.each do |project| %>
9
- <%= render partial: "project", locals: { project: project } %>
10
- <% end %>
12
+ <%= render partial: "projects_list", locals: { project: } %>
11
13
  </div>
12
14
 
13
15
  <%= decidim_paginate projects %>
@@ -0,0 +1,5 @@
1
+ <% if count.present? %>
2
+ <span class="button__pill--count" id="order-selected-projects-count">
3
+ <%= count %>
4
+ </span>
5
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <% projects.each do |project| %>
2
+ <%= render partial: "project", locals: { project: } %>
3
+ <% end %>
@@ -1,63 +1,66 @@
1
- <%= render partial: "decidim/shared/component_announcement" %>
2
- <%= render partial: "exit_modal" %>
3
-
4
- <%= cell("decidim/budgets/limit_announcement", budget) %>
5
-
6
- <div class="voting-wrapper">
7
- <div class="row columns">
8
- <% if component_settings.geocoding_enabled? %>
9
- <%= dynamic_map_for projects_data_for_map(all_geocoded_projects) do %>
10
- <template id="marker-popup">
11
- <div class="map-info__content">
12
- <h3>${title}</h3>
13
- <div id="bodyContent">
14
- <p>{{html body}}</p>
15
- <div class="map__date-address">
16
- <div class="address card__extra">
17
- <div class="address__icon">{{html icon}}</div>
18
- <div class="address__details">
19
- <span>${address}</span><br>
1
+ <% add_decidim_page_title t("decidim.budgets.projects.projects_for", name: translated_attribute(budget.title)) %>
2
+ <%= append_javascript_pack_tag "decidim_budgets" %>
3
+ <%= append_stylesheet_pack_tag "decidim_budgets" %>
4
+
5
+ <%= render partial: "budget_summary", locals: { include_heading: true, project_item: false, responsive: true } %>
6
+ <%= cell("decidim/budgets/budget_information_modal", budget) %>
7
+
8
+ <% content_for :aside do %>
9
+ <h1 class="h3 decorator"><%= t("decidim.budgets.projects.projects_for", name: translated_attribute(budget.title)) %></h1>
10
+
11
+ <%= render layout: "decidim/shared/filters", locals: { filter_sections: , search_variable: :search_text_cont, skip_to_id: "projects" } do %>
12
+ <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
13
+ <% end %>
14
+ <% end %>
15
+
16
+ <%= render layout: "layouts/decidim/shared/layout_two_col" do %>
17
+ <% if projects.any? %>
18
+ <%= render partial: "exit_modal" %>
19
+ <%= render partial: "budget_excess" %>
20
+ <%= render partial: "budget_confirm" %>
21
+
22
+ <% unless voting_finished? %>
23
+ <div class="budget-summary__container">
24
+ <%= render partial: "budget_summary", locals: { include_heading: true, project_item: false, responsive: false } %>
25
+ </div>
26
+ <% end %>
27
+
28
+ <% if Decidim::Map.available?(:geocoding, :dynamic) && component_settings.geocoding_enabled? %>
29
+ <div class="budget-list__map">
30
+ <%= dynamic_map_for projects_data_for_map(all_geocoded_projects) do %>
31
+ <template id="marker-popup">
32
+ <div class="space-y-6">
33
+ <a href="${link}" class="card__list">
34
+ <div class="card__list-content">
35
+ <h3 class="h4 card__list-title">${title}</h3>
36
+ <div class="card__list-metadata">
37
+ {{each JSON.parse(items)}}
38
+ <span>{{html icon}}{{html text}}</span>
39
+ {{/each}}
20
40
  </div>
21
41
  </div>
22
- </div>
23
- <div class="map-info__button">
24
- <a href="${link}" class="button button--sc">
25
- <%= t(".view_project") %>
26
- </a>
27
- </div>
42
+ </a>
28
43
  </div>
29
- </div>
30
- </template>
31
- <% end %>
44
+ </template>
45
+ <% end %>
46
+ </div>
32
47
  <% end %>
33
- <% if voting_finished? %>
34
- <h2 class="heading2">
35
- <%= t("decidim.budgets.projects.projects_for", name: translated_attribute(budget.title)) %>
36
- </h2>
37
- <% else %>
38
- <%= render partial: "budget_summary", locals: { include_heading: true } %>
48
+
49
+ <%= cell("decidim/budgets/limit_announcement", budget) %>
50
+
51
+ <% unless voting_finished? %>
52
+ <section class="layout-main__section">
53
+ <span class="text-xl font-semibold">
54
+ <%= t("select_projects", scope: "decidim.budgets.projects") %>
55
+ </span>
56
+ </section>
39
57
  <% end %>
40
- </div>
41
-
42
- <div class="row columns">
43
- <h2 class="section-heading">
44
- <%= render partial: "count" %>
45
- </h2>
46
- </div>
47
-
48
- <div class="row">
49
- <div class="columns mediumlarge-4 large-3">
50
- <%= render partial: "filters_small_view" %>
51
- <div class="card card--secondary show-for-mediumlarge">
52
- <%= render partial: "filters" %>
53
- </div>
54
- </div>
55
- <div id="projects" class="columns mediumlarge-8 large-9" aria-live="polite">
58
+
59
+ <section id="projects" class="layout-main__section layout-main__heading">
56
60
  <%= render partial: "projects" %>
57
- </div>
58
- </div>
59
- </div>
61
+ </section>
62
+ <% else %>
63
+ <%= cell("decidim/announcement", t("empty", scope: "decidim.budgets.projects")) %>
64
+ <% end %>
60
65
 
61
- <% content_for :js_content do %>
62
- <%= javascript_pack_tag "decidim_budgets" %>
63
66
  <% end %>
@@ -1,10 +1,11 @@
1
- var $projects = $('#projects');
1
+ var $projects = $('#projects .budget-list');
2
+ var $order = $('.budget__list--header .collection-sort-controls');
2
3
  var $projectsCount = $('#projects-count');
3
4
  var $orderFilterInput = $('.order_filter');
4
5
 
5
- $projects.html('<%= j(render partial: "projects").strip.html_safe %>');
6
+ $projects.html('<%= j(render partial: "projects_list").strip.html_safe %>');
7
+ $order.html('<%= j(render partial: "order").strip.html_safe %>');
6
8
  $projectsCount.html('<%= j(render partial: "count").strip.html_safe %>');
7
9
  $orderFilterInput.val('<%= order %>');
8
10
 
9
- var $dropdownMenu = $('.dropdown.menu', $projects);
10
- $dropdownMenu.foundation();
11
+ document.dispatchEvent(new CustomEvent("ajax:loaded", { detail: $projects[0] }));