decidim-budgets 0.26.7 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/budgets/budgets_header/show.erb +1 -1
  3. data/app/cells/decidim/budgets/order_activity_cell.rb +29 -0
  4. data/app/commands/decidim/budgets/add_line_item.rb +4 -2
  5. data/app/commands/decidim/budgets/admin/create_budget.rb +1 -1
  6. data/app/commands/decidim/budgets/admin/create_order_reminders.rb +66 -0
  7. data/app/commands/decidim/budgets/admin/create_project.rb +5 -2
  8. data/app/commands/decidim/budgets/admin/destroy_budget.rb +1 -1
  9. data/app/commands/decidim/budgets/admin/destroy_project.rb +1 -1
  10. data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +6 -6
  11. data/app/commands/decidim/budgets/admin/update_budget.rb +1 -1
  12. data/app/commands/decidim/budgets/admin/update_project.rb +5 -2
  13. data/app/commands/decidim/budgets/admin/update_project_category.rb +48 -0
  14. data/app/commands/decidim/budgets/admin/update_project_scope.rb +54 -0
  15. data/app/commands/decidim/budgets/admin/update_project_selection.rb +56 -0
  16. data/app/commands/decidim/budgets/cancel_order.rb +1 -1
  17. data/app/commands/decidim/budgets/checkout.rb +10 -3
  18. data/app/commands/decidim/budgets/remove_line_item.rb +1 -1
  19. data/app/controllers/decidim/budgets/admin/projects_controller.rb +149 -1
  20. data/app/controllers/decidim/budgets/projects_controller.rb +13 -13
  21. data/app/forms/decidim/budgets/admin/budget_form.rb +2 -2
  22. data/app/forms/decidim/budgets/admin/order_reminder_form.rb +75 -0
  23. data/app/forms/decidim/budgets/admin/project_form.rb +19 -3
  24. data/app/helpers/decidim/budgets/admin/project_bulk_actions_helper.rb +20 -0
  25. data/app/helpers/decidim/budgets/projects_helper.rb +29 -0
  26. data/app/jobs/decidim/budgets/send_vote_reminder_job.rb +16 -0
  27. data/app/mailers/decidim/budgets/vote_reminder_mailer.rb +39 -0
  28. data/app/models/decidim/budgets/order.rb +2 -3
  29. data/app/models/decidim/budgets/project.rb +12 -4
  30. data/app/packs/entrypoints/decidim_budgets_admin.js +1 -0
  31. data/app/packs/src/decidim/budgets/admin/projects.js +143 -0
  32. data/app/permissions/decidim/budgets/admin/permissions.rb +8 -3
  33. data/app/queries/decidim/budgets/filtered_projects.rb +1 -1
  34. data/app/serializers/decidim/budgets/{data_portability_budgets_order_serializer.rb → download_your_data_budgets_order_serializer.rb} +2 -2
  35. data/app/services/decidim/budgets/order_reminder_generator.rb +85 -0
  36. data/app/views/decidim/budgets/admin/budgets/_form.html.erb +1 -1
  37. data/app/views/decidim/budgets/admin/budgets/index.html.erb +3 -0
  38. data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +13 -0
  39. data/app/views/decidim/budgets/admin/projects/_form.html.erb +6 -0
  40. data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +50 -0
  41. data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +15 -0
  42. data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +36 -0
  43. data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +15 -0
  44. data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +25 -0
  45. data/app/views/decidim/budgets/admin/projects/index.html.erb +6 -54
  46. data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +26 -0
  47. data/app/views/decidim/budgets/order_summary_mailer/order_summary.html.erb +0 -1
  48. data/app/views/decidim/budgets/projects/_filters.html.erb +4 -4
  49. data/app/views/decidim/budgets/projects/index.html.erb +28 -1
  50. data/app/views/decidim/budgets/projects/show.html.erb +7 -2
  51. data/app/views/decidim/budgets/vote_reminder_mailer/vote_reminder.html.erb +21 -0
  52. data/config/assets.rb +2 -1
  53. data/config/locales/am-ET.yml +1 -0
  54. data/config/locales/ar.yml +4 -0
  55. data/config/locales/bg.yml +1 -0
  56. data/config/locales/ca.yml +47 -1
  57. data/config/locales/cs.yml +51 -1
  58. data/config/locales/da.yml +1 -0
  59. data/config/locales/de.yml +45 -3
  60. data/config/locales/el.yml +2 -0
  61. data/config/locales/en.yml +46 -1
  62. data/config/locales/eo.yml +1 -0
  63. data/config/locales/es-MX.yml +43 -0
  64. data/config/locales/es-PY.yml +46 -0
  65. data/config/locales/es.yml +48 -2
  66. data/config/locales/et.yml +1 -0
  67. data/config/locales/eu.yml +3 -7
  68. data/config/locales/fi-plain.yml +46 -0
  69. data/config/locales/fi.yml +91 -45
  70. data/config/locales/fr-CA.yml +46 -1
  71. data/config/locales/fr.yml +47 -2
  72. data/config/locales/ga-IE.yml +1 -0
  73. data/config/locales/gl.yml +11 -0
  74. data/config/locales/hr.yml +1 -0
  75. data/config/locales/hu.yml +19 -107
  76. data/config/locales/id-ID.yml +1 -0
  77. data/config/locales/is-IS.yml +2 -1
  78. data/config/locales/it.yml +2 -0
  79. data/config/locales/ja.yml +42 -1
  80. data/config/locales/ko.yml +1 -0
  81. data/config/locales/lb.yml +2 -0
  82. data/config/locales/lt.yml +1 -337
  83. data/config/locales/lv.yml +1 -0
  84. data/config/locales/mt.yml +1 -0
  85. data/config/locales/nl.yml +14 -28
  86. data/config/locales/no.yml +17 -0
  87. data/config/locales/om-ET.yml +1 -0
  88. data/config/locales/pl.yml +2 -0
  89. data/config/locales/pt-BR.yml +3 -1
  90. data/config/locales/pt.yml +2 -0
  91. data/config/locales/ro-RO.yml +2 -3
  92. data/config/locales/ru.yml +1 -0
  93. data/config/locales/si-LK.yml +1 -0
  94. data/config/locales/sk.yml +1 -0
  95. data/config/locales/sl.yml +1 -0
  96. data/config/locales/so-SO.yml +1 -0
  97. data/config/locales/sr-CS.yml +1 -0
  98. data/config/locales/sv.yml +24 -4
  99. data/config/locales/sw-KE.yml +1 -0
  100. data/config/locales/ti-ER.yml +1 -0
  101. data/config/locales/tr-TR.yml +2 -0
  102. data/config/locales/uk.yml +1 -0
  103. data/config/locales/val-ES.yml +1 -0
  104. data/config/locales/vi.yml +1 -0
  105. data/config/locales/zh-CN.yml +1 -0
  106. data/config/locales/zh-TW.yml +1 -326
  107. data/db/migrate/20200804175222_votes_enabled_to_votes_choices.rb +2 -2
  108. data/db/migrate/20220428072638_add_geolocalization_fields_to_projects.rb +9 -0
  109. data/lib/decidim/budgets/admin_engine.rb +3 -0
  110. data/lib/decidim/budgets/component.rb +7 -6
  111. data/lib/decidim/budgets/engine.rb +17 -0
  112. data/lib/decidim/budgets/test/factories.rb +11 -0
  113. data/lib/decidim/budgets/version.rb +1 -1
  114. metadata +38 -24
  115. data/app/services/decidim/budgets/project_search.rb +0 -45
  116. data/config/locales/fa-IR.yml +0 -1
  117. data/config/locales/gn-PY.yml +0 -1
  118. data/config/locales/ka-GE.yml +0 -1
  119. data/config/locales/kaa.yml +0 -1
  120. data/config/locales/lo-LA.yml +0 -1
  121. data/config/locales/oc-FR.yml +0 -1
@@ -9,7 +9,7 @@
9
9
 
10
10
  <%= form.number_field :weight %>
11
11
 
12
- <%= form.translated :editor, :description, toolbar: :content %>
12
+ <%= form.translated :editor, :description %>
13
13
 
14
14
  <%= form.number_field :total_budget %>
15
15
 
@@ -5,6 +5,9 @@
5
5
  <%= t(".title") %>
6
6
  </div>
7
7
  <div class="flex--cc flex-gap--1">
8
+ <% if allowed_to? :remind, :order %>
9
+ <%= link_to "Send voting reminders", admin_reminders_path(current_component, name: "orders"), class: "button tiny button--title" %>
10
+ <% end %>
8
11
  <% if allowed_to? :export, :budget %>
9
12
  <%= export_dropdown %>
10
13
  <% end %>
@@ -0,0 +1,13 @@
1
+ <div class="flex--cc flex-gap--1">
2
+ <%= render partial: "decidim/budgets/admin/projects/bulk_actions/dropdown" %>
3
+
4
+ <%= render partial: "decidim/budgets/admin/projects/bulk_actions/recategorize" %>
5
+ <%= render partial: "decidim/budgets/admin/projects/bulk_actions/scope-change" %>
6
+ <%= render partial: "decidim/budgets/admin/projects/bulk_actions/change-selected" %>
7
+
8
+ <%= link_to t("actions.import", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_budget_proposals_import_path(budget), class: "button tiny button--title" if allowed_to? :import_proposals, :project %>
9
+ <% if allowed_to? :export, :budget %>
10
+ <%= export_dropdown(current_component, budget.id) %>
11
+ <% end %>
12
+ <%= link_to t("actions.new", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_budget_project_path, class: "button tiny button--title new" if allowed_to? :create, :project %>
13
+ </div>
@@ -18,6 +18,12 @@
18
18
  <%= form.number_field :budget_amount %>
19
19
  </div>
20
20
 
21
+ <% if @form.geocoding_enabled? %>
22
+ <div class="row column">
23
+ <%= form.geocoding_field :address %>
24
+ </div>
25
+ <% end %>
26
+
21
27
  <% if current_component.has_subscopes? %>
22
28
  <div class="row column">
23
29
  <%= scopes_picker_field form, :decidim_scope_id, root: budget.scope %>
@@ -0,0 +1,50 @@
1
+ <tr data-id="<%= project.id %>">
2
+ <td>
3
+ <%= check_box_tag "project_ids_s[]", project.id, false, class: "js-check-all-resources js-project-list-check js-resource-id-#{project.id}" %><br>
4
+ </td>
5
+ <td>
6
+ <%= project.id %><br>
7
+ </td>
8
+ <td>
9
+ <%= translated_attribute(project.title) %><br>
10
+ </td>
11
+ <td>
12
+ <% if project.category %>
13
+ <%= translated_attribute project.category.name %>
14
+ <% end %>
15
+ </td>
16
+ <%= td_resource_scope_for(project.scope) %>
17
+ <td>
18
+ <%= project.confirmed_orders_count %>
19
+ </td>
20
+ <td>
21
+ <% if project.selected? %>
22
+ <%= content_tag :strong, t("projects.index.selected", scope: "decidim.budgets.admin"), class: "text-success" %>
23
+ <% else %>
24
+ <%= content_tag :span, "x", class: "text-muted" %>
25
+ <% end %>
26
+ </td>
27
+ <td class="table-list__actions">
28
+ <%= icon_link_to "eye", resource_locator([budget, project]).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
29
+
30
+ <% if allowed_to? :update, :project, project: project %>
31
+ <%= icon_link_to "pencil", resource_locator([budget, project]).edit, t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
32
+ <% end %>
33
+
34
+ <% if allowed_to? :update, :project, project: project %>
35
+ <%= icon_link_to "folder", project_attachment_collections_path(project), t("actions.attachment_collections", scope: "decidim.budgets"), class: "action-icon--attachment_collections" %>
36
+ <% end %>
37
+
38
+ <% if allowed_to? :update, :project, project: project %>
39
+ <%= icon_link_to "paperclip", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
40
+ <% end %>
41
+
42
+ <%= resource_permissions_link(project) %>
43
+
44
+ <% if allowed_to? :destroy, :project, project: project %>
45
+ <%= 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") } %>
46
+ <% else %>
47
+ <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.destroy", scope: "decidim.budgets") %>
48
+ <% end %>
49
+ </td>
50
+ </tr>
@@ -0,0 +1,15 @@
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 %>
3
+ <div class="checkboxes hide">
4
+ <% projects.each do |project| %>
5
+ <%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
6
+ <% end %>
7
+ </div>
8
+
9
+ <%= bulk_selections %>
10
+
11
+ <%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-selected", class: "button small button--simple float-left") %>
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>
14
+ <% end %>
15
+ </div>
@@ -0,0 +1,36 @@
1
+ <div id="js-bulk-actions-wrapper">
2
+ <button
3
+ id="js-bulk-actions-button"
4
+ class="button button--nomargin tiny success light dropdown hide"
5
+ type="button"
6
+ data-toggle="js-bulk-actions-dropdown">
7
+ <%= t("decidim.budgets.admin.projects.index.actions") %>
8
+ </button>
9
+
10
+ <div
11
+ id="js-bulk-actions-dropdown"
12
+ class="dropdown-pane"
13
+ data-position="bottom"
14
+ data-alignment="right"
15
+ data-dropdown="dropdown"
16
+ data-auto-focus="false"
17
+ data-events="resize">
18
+ <ul class="list-reset">
19
+ <li>
20
+ <button type="button" data-action="recategorize-projects">
21
+ <%= t("decidim.budgets.admin.projects.index.change_category") %>
22
+ </button>
23
+ </li>
24
+ <li>
25
+ <button type="button" data-action="scope-change-projects">
26
+ <%= t("decidim.budgets.admin.projects.index.change_scope") %>
27
+ </button>
28
+ </li>
29
+ <li>
30
+ <button type="button" data-action="change-selected-projects">
31
+ <%= t("decidim.budgets.admin.projects.index.change_selected") %>
32
+ </button>
33
+ </li>
34
+ </ul>
35
+ </div>
36
+ </div>
@@ -0,0 +1,15 @@
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 %>
3
+ <div class="checkboxes hide">
4
+ <% projects.each do |project| %>
5
+ <%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
6
+ <% end %>
7
+ </div>
8
+
9
+ <%= bulk_categories_select current_component.categories %>
10
+
11
+ <%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-category", class: "button small button--simple float-left") %>
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>
14
+ <% end %>
15
+ </div>
@@ -0,0 +1,25 @@
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 %>
3
+ <div class="checkboxes hide">
4
+ <% projects.each do |project| %>
5
+ <%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
6
+ <% end %>
7
+ </div>
8
+
9
+ <%= scopes_picker_tag(
10
+ :scope_id,
11
+ try(:current_participatory_space)&.scope,
12
+ field: t("models.project.fields.scope", scope: "decidim.budgets")
13
+ ) %>
14
+
15
+ <%= submit_tag(
16
+ t("decidim.budgets.admin.projects.index.update_scope_button"),
17
+ id: "js-submit-scope-change-projects",
18
+ class: "button small button--simple float-left"
19
+ ) %>
20
+
21
+ <button id="js-cancel-scope-change-projects" class="button tiny clear compact js-cancel-bulk-action" type="button">
22
+ <%= t("decidim.budgets.admin.projects.index.cancel") %>
23
+ </button>
24
+ <% end %>
25
+ </div>
@@ -4,14 +4,9 @@
4
4
  <div>
5
5
  <%= link_to translated_attribute(budget.title), budgets_path %> &gt;
6
6
  <%= t(".title") %>
7
+ <span id="js-selected-resources-count" class="component-counter component-counter--inline" title="<%= t("decidim.budgets.admin.projects.index.selected") %>"></span>
7
8
  </div>
8
- <div class="flex--cc flex-gap--1">
9
- <%= link_to t("actions.import", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_budget_proposals_import_path(budget), class: "button tiny button--title" if allowed_to? :import_proposals, :project %>
10
- <% if allowed_to? :export, :budget %>
11
- <%= export_dropdown(current_component, budget.id) %>
12
- <% end %>
13
- <%= link_to t("actions.new", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_budget_project_path, class: "button tiny button--title new" if allowed_to? :create, :project %>
14
- </div>
9
+ <%= render partial: "bulk-actions" %>
15
10
  </h2>
16
11
  </div>
17
12
 
@@ -21,6 +16,7 @@
21
16
  <table class="table-list">
22
17
  <thead>
23
18
  <tr>
19
+ <th><%= check_box_tag "projects_bulk", "all", false, class: "js-check-all" %></th>
24
20
  <th><%= sort_link(query, :id, t("models.project.fields.id", scope: "decidim.budgets"), default_order: :desc) %>
25
21
  <th><%= sort_link(query, :title, t("models.project.fields.title", scope: "decidim.budgets")) %></th>
26
22
  <th><%= sort_link(query, :category_name, t("models.project.fields.category", scope: "decidim.budgets") ) %></th>
@@ -32,53 +28,7 @@
32
28
  </thead>
33
29
  <tbody>
34
30
  <% projects.each do |project| %>
35
- <tr data-id="<%= project.id %>">
36
- <td>
37
- <%= project.id %><br>
38
- </td>
39
- <td>
40
- <%= translated_attribute(project.title) %><br>
41
- </td>
42
- <td>
43
- <% if project.category %>
44
- <%= translated_attribute project.category.name %>
45
- <% end %>
46
- </td>
47
- <%= td_resource_scope_for(project.scope) %>
48
- <td>
49
- <%= project.confirmed_orders_count %>
50
- </td>
51
- <td>
52
- <% if project.selected? %>
53
- <%= content_tag :strong, t(".selected"), class: "text-success" %>
54
- <% else %>
55
- <%= content_tag :span, "×", class: "text-muted" %>
56
- <% end %>
57
- </td>
58
- <td class="table-list__actions">
59
- <%= icon_link_to "eye", resource_locator([budget, project]).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
60
-
61
- <% if allowed_to? :update, :project, project: project %>
62
- <%= icon_link_to "pencil", resource_locator([budget, project]).edit, t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
63
- <% end %>
64
-
65
- <% if allowed_to? :update, :project, project: project %>
66
- <%= icon_link_to "folder", project_attachment_collections_path(project), t("actions.attachment_collections", scope: "decidim.budgets"), class: "action-icon--attachment_collections" %>
67
- <% end %>
68
-
69
- <% if allowed_to? :update, :project, project: project %>
70
- <%= icon_link_to "paperclip", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
71
- <% end %>
72
-
73
- <%= resource_permissions_link(project) %>
74
-
75
- <% if allowed_to? :destroy, :project, project: project %>
76
- <%= 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") } %>
77
- <% else %>
78
- <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.destroy", scope: "decidim.budgets") %>
79
- <% end %>
80
- </td>
81
- </tr>
31
+ <%= render partial: "project-tr", locals: { project: project } %>
82
32
  <% end %>
83
33
  </tbody>
84
34
  </table>
@@ -91,3 +41,5 @@
91
41
  <strong><%= t ".pending_orders" %>:&nbsp;</strong><span><%= pending_orders.count %></span>
92
42
  </div>
93
43
  </div>
44
+
45
+ <%= javascript_pack_tag "decidim_budgets_admin" %>
@@ -0,0 +1,26 @@
1
+ <% if flash.now[:error].present? %>
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");
4
+ <% end %>
5
+
6
+ <% if flash.now[:alert].present? %>
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");
9
+ <% end %>
10
+
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");
13
+
14
+ <% project_ids.each do |id| %>
15
+ $(".table-list [data-id='<%= id %>']")
16
+ .replaceWith("<%= escape_javascript(render partial: %q{project-tr}, locals: { project: Decidim::Budgets::Project.find(id) }) %>");
17
+ <% end %>
18
+
19
+ $("<%= form_selector %> <%= attribute_selector %>").removeClass("is-invalid-input")
20
+ $(".js-check-all").prop('checked', false);
21
+ $(".js-check-all-resources").prop('checked', false);
22
+ window.hideBulkActionsButton();
23
+ window.hideBulkActionForms();
24
+ window.showOtherActionsButtons();
25
+ window.selectedResourcesCountUpdate();
26
+ <% end %>
@@ -1,7 +1,6 @@
1
1
  <% if @component.try(:scopes_enabled) %>
2
2
  <%= t(
3
3
  ".voted_on_space_with_scope",
4
- budget_name: translated_attribute(@budget.title),
5
4
  space_name: translated_attribute(@space.title),
6
5
  scope_name: translated_attribute(@component.scope.name),
7
6
  scope_type: translated_attribute(@component.scope.scope_type.name)
@@ -4,7 +4,7 @@
4
4
  <div class="filters__section">
5
5
  <div class="filters__search">
6
6
  <div class="input-group">
7
- <%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), "aria-label": t(".search"), data: { disable_dynamic_change: true } %>
7
+ <%= form.search_field :search_text_cont, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), "aria-label": t(".search"), data: { disable_dynamic_change: true } %>
8
8
  <div class="input-group-button">
9
9
  <button type="submit" class="button" aria-controls="projects">
10
10
  <%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
@@ -15,15 +15,15 @@
15
15
  </div>
16
16
 
17
17
  <% if voting_finished? %>
18
- <%= form.check_boxes_tree :status, filter_status_values, legend_title: t(".status"), "aria-controls": "projects" %>
18
+ <%= form.check_boxes_tree :with_any_status, filter_status_values, legend_title: t(".status"), "aria-controls": "projects" %>
19
19
  <% end %>
20
20
 
21
21
  <% if current_component.has_subscopes? %>
22
- <%= form.check_boxes_tree :scope_id, resource_filter_scope_values(budget.scope), legend_title: t(".scope"), "aria-controls": "projects" %>
22
+ <%= form.check_boxes_tree :with_any_scope, resource_filter_scope_values(budget.scope), legend_title: t(".scope"), "aria-controls": "projects" %>
23
23
  <% end %>
24
24
 
25
25
  <% if current_participatory_space.categories.any? %>
26
- <%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category"), "aria-controls": "projects" %>
26
+ <%= form.check_boxes_tree :with_any_category, filter_categories_values, legend_title: t(".category"), "aria-controls": "projects" %>
27
27
  <% end %>
28
28
 
29
29
  <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
@@ -5,6 +5,31 @@
5
5
 
6
6
  <div class="voting-wrapper">
7
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>
20
+ </div>
21
+ </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>
28
+ </div>
29
+ </div>
30
+ </template>
31
+ <% end %>
32
+ <% end %>
8
33
  <% if voting_finished? %>
9
34
  <h2 class="heading2">
10
35
  <%= t("decidim.budgets.projects.projects_for", name: translated_attribute(budget.title)) %>
@@ -33,4 +58,6 @@
33
58
  </div>
34
59
  </div>
35
60
 
36
- <%= javascript_pack_tag("decidim_budgets") %>
61
+ <% content_for :js_content do %>
62
+ <%= javascript_pack_tag "decidim_budgets" %>
63
+ <% end %>
@@ -55,8 +55,11 @@ edit_link(
55
55
  </div>
56
56
  <div class="columns mediumlarge-8 mediumlarge-pull-4">
57
57
  <div class="section">
58
+ <% if component_settings.geocoding_enabled? && project.geocoded? %>
59
+ <%= render partial: "decidim/shared/static_map", locals: { icon_name: "projects", geolocalizable: project } %>
60
+ <% end %>
58
61
  <%= cell("decidim/budgets/project_selected_status", project, as_label: true) %>
59
- <%= decidim_sanitize_editor_admin translated_attribute project.description %>
62
+ <%= decidim_sanitize_editor translated_attribute project.description %>
60
63
  <%= cell "decidim/budgets/project_tags", project, context: { extra_classes: ["tags--project"] } %>
61
64
  </div>
62
65
  <%= attachments_for project %>
@@ -68,4 +71,6 @@ edit_link(
68
71
 
69
72
  <%= comments_for project, polymorphic: [project.budget] %>
70
73
 
71
- <%= javascript_pack_tag("decidim_budgets") %>
74
+ <% content_for :js_content do %>
75
+ <%= javascript_pack_tag "decidim_budgets" %>
76
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <p><%= t(".email_intro") %></p>
2
+
3
+ <p><%= t(".email_budgets") %></p>
4
+
5
+ <ul>
6
+ <% @orders.each do |order| %>
7
+ <li>
8
+ <%= link_to(
9
+ translated_attribute(order.budget.title),
10
+ routes.budget_url(order.budget, host: @organization.host)
11
+ ) %>
12
+ </li>
13
+ <% end %>
14
+ </ul>
15
+
16
+ <p><%= t(".email_outro") %></p>
17
+
18
+ <%= link_to(
19
+ t(".email_link"),
20
+ routes.root_url(host: @organization.host)
21
+ ) %>
data/config/assets.rb CHANGED
@@ -4,6 +4,7 @@ base_path = File.expand_path("..", __dir__)
4
4
 
5
5
  Decidim::Webpacker.register_path("#{base_path}/app/packs")
6
6
  Decidim::Webpacker.register_entrypoints(
7
- decidim_budgets: "#{base_path}/app/packs/entrypoints/decidim_budgets.js"
7
+ decidim_budgets: "#{base_path}/app/packs/entrypoints/decidim_budgets.js",
8
+ decidim_budgets_admin: "#{base_path}/app/packs/entrypoints/decidim_budgets_admin.js"
8
9
  )
9
10
  Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/budgets/budgets")
@@ -1 +1,2 @@
1
+ ---
1
2
  am:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ar:
2
3
  activemodel:
3
4
  attributes:
@@ -60,6 +61,9 @@ ar:
60
61
  title: تحرير المشروع
61
62
  update: تحديث
62
63
  index:
64
+ actions: الإجراءات
65
+ cancel: إلغاء
66
+ change_category: تغيير الفئة
63
67
  finished_orders: الانتهاء من الأصوات
64
68
  pending_orders: في انتظار الأصوات
65
69
  title: مشاريع
@@ -1,3 +1,4 @@
1
+ ---
1
2
  bg:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ca:
2
3
  activemodel:
3
4
  attributes:
@@ -40,7 +41,7 @@ ca:
40
41
  actions:
41
42
  attachment_collections: Carpetes
42
43
  attachments: Adjunts
43
- confirm_destroy: Segur que vols eliminar aquest projecte?
44
+ confirm_destroy: Estàs segura que vols eliminar aquest projecte?
44
45
  destroy: Esborrar
45
46
  edit: Editar
46
47
  edit_projects: Gestionar projectes
@@ -88,16 +89,40 @@ ca:
88
89
  title: Editar projecte
89
90
  update: Actualitzar
90
91
  index:
92
+ actions: Accions
93
+ cancel: Cancel·lar
94
+ change_category: Canviar categoria
95
+ change_scope: Canviar àmbit
96
+ change_selected: Canviar la selecció
97
+ deselect_implementation: Deseleccionar
91
98
  finished_orders: Vots finalitzats
92
99
  pending_orders: Vots en procés
100
+ select_for_implementation: Seleccionar
93
101
  selected: Seleccionat
94
102
  title: Projectes
103
+ update: Actualitzar
104
+ update_scope_button: Actualitzar àmbit
95
105
  new:
96
106
  create: Crear
97
107
  title: Nou projecte
98
108
  update:
99
109
  invalid: S'ha produït un error en actualitzar aquest projecte
100
110
  success: Projecte actualitzat correctament
111
+ update_category:
112
+ invalid: 'Aquestes propostes ja tenien la categoria %{subject_name}: %{projects}.'
113
+ select_a_category: Si us plau, selecciona una categoria
114
+ select_a_project: Si us plau, selecciona un projecte
115
+ success: 'Els projectes s''han actualitzat correctament a la categoria %{subject_name}: %{projects}.'
116
+ update_scope:
117
+ invalid: 'Aquests projectes ja estaven assignats a l''àmbit %{subject_name}: %{projects}.'
118
+ select_a_project: Si us plau, selecciona un projecte
119
+ select_a_scope: Si us plau, selecciona un àmbit
120
+ success: 'Els projectes s''han actualitzat correctament a l''àmbit %{subject_name}: %{projects}.'
121
+ update_selected:
122
+ invalid: 'Aquests projectes ja estaven seleccionats: %{projects}.'
123
+ select_a_project: Si us plau, selecciona un projecte
124
+ select_a_selection: Si us plau, fes una selecció
125
+ success: 'Selecció de projectes modificada correctament: %{projects}.'
101
126
  proposals_imports:
102
127
  create:
103
128
  invalid: S'ha produït un error en importar les propostes en projectes
@@ -110,6 +135,12 @@ ca:
110
135
  origin_component_id: Component d'origen
111
136
  select_component: Selecciona un component
112
137
  title: Importar propostes
138
+ reminders:
139
+ orders:
140
+ description: Les usuàries rebran un correu amb els enllaços als pressupostos on tenen "comandes" pendents.
141
+ title:
142
+ one: Estàs a punt d'enviar un correu recordatori a %{count} usuària
143
+ other: Estàs a punt d'enviar un correu recordatori a les usuàries %{count}
113
144
  admin_log:
114
145
  budget:
115
146
  create: "%{user_name} ha creat el pressupost %{resource_name} a l'espai %{space_name}"
@@ -141,6 +172,8 @@ ca:
141
172
  show: Mostra els projectes
142
173
  vote: Vota
143
174
  voted_on: Has votat a %{links}
175
+ last_activity:
176
+ new_vote_at_html: "<span>Nova votació pressupostària a %{link}</span>"
144
177
  limit_announcement:
145
178
  cant_vote: No pots votar a aquests pressupostos. <a href="%{landing_path}"> Prova amb un altre pressupost </a>.
146
179
  limit_reached: Tens vots actius a %{links}. Per votar en aquest pressupot has d' <a href="%{landing_path}">esborrar el teu vot i començar de nou</a>.
@@ -154,6 +187,7 @@ ca:
154
187
  fields:
155
188
  category: Categoria
156
189
  id: ID
190
+ scope: Àmbit
157
191
  title: Títol
158
192
  order_summary_mailer:
159
193
  order_summary:
@@ -226,6 +260,8 @@ ca:
226
260
  filter: Filtra
227
261
  filter_by: Filtra per
228
262
  unfold: Desplegar
263
+ index:
264
+ view_project: Veure projecte
229
265
  order_progress:
230
266
  vote: Vota
231
267
  order_selected_projects:
@@ -259,6 +295,15 @@ ca:
259
295
  show:
260
296
  budget: Pressupost
261
297
  view_all_projects: Veure tots els projectes
298
+ vote_reminder_mailer:
299
+ vote_reminder:
300
+ email_budgets: 'Àrees a les quals no has finalitzat el vot:'
301
+ email_intro: Has iniciat la votació als pressupostos participatius, però no l'has completat.
302
+ email_link: Ves-hi i segueix votant
303
+ email_outro: Si us plau, recorda completar el vot. Per votar, primer has de seleccionar la proposta o propostes que vols votar i a després confirmar el teu vot amb el botó "Votar".
304
+ email_subject:
305
+ one: Tens un vot no finalitzat a la votació dels pressupostos participatius
306
+ other: Tens alguns vots no finalitzats a la votació dels pressupostos participatius
262
307
  components:
263
308
  budgets:
264
309
  actions:
@@ -274,6 +319,7 @@ ca:
274
319
  errors:
275
320
  budget_voting_rule_only_one: Cal activar com a mínim una norma per a la votació
276
321
  budget_voting_rule_required: Es requereix una norma per a la votació
322
+ geocoding_enabled: Geolocalització habilitada
277
323
  landing_page_content: Pàgina d'inici de pressupostos
278
324
  more_information_modal: Finestra de "Més informació"
279
325
  projects_per_page: Projectes per pàgina