decidim-budgets 0.29.1 → 0.29.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/budgets/budgets_list/main_list.erb +1 -1
  3. data/app/cells/decidim/budgets/budgets_list/show.erb +1 -1
  4. data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +6 -2
  5. data/app/forms/decidim/budgets/admin/budget_form.rb +1 -1
  6. data/app/forms/decidim/budgets/admin/project_form.rb +1 -1
  7. data/app/forms/decidim/budgets/admin/project_import_proposals_form.rb +1 -1
  8. data/app/packs/stylesheets/budgets.scss +6 -2
  9. data/app/permissions/decidim/budgets/permissions.rb +2 -0
  10. data/app/views/decidim/budgets/budgets/index.html.erb +1 -1
  11. data/app/views/decidim/budgets/projects/_order.html.erb +1 -1
  12. data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +1 -1
  13. data/app/views/decidim/budgets/projects/index.html.erb +10 -2
  14. data/app/views/decidim/budgets/projects/index.js.erb +10 -0
  15. data/app/views/decidim/budgets/projects/show.html.erb +14 -9
  16. data/config/locales/ar.yml +1 -3
  17. data/config/locales/bg.yml +1 -2
  18. data/config/locales/bn-BD.yml +1 -0
  19. data/config/locales/bs-BA.yml +22 -0
  20. data/config/locales/ca-IT.yml +388 -0
  21. data/config/locales/ca.yml +1 -1
  22. data/config/locales/cs.yml +1 -1
  23. data/config/locales/de.yml +4 -4
  24. data/config/locales/el.yml +0 -1
  25. data/config/locales/es-MX.yml +1 -1
  26. data/config/locales/es-PY.yml +1 -1
  27. data/config/locales/eu.yml +93 -84
  28. data/config/locales/fi-plain.yml +15 -15
  29. data/config/locales/fi.yml +68 -68
  30. data/config/locales/fr-CA.yml +4 -4
  31. data/config/locales/fr.yml +3 -3
  32. data/config/locales/ga-IE.yml +0 -4
  33. data/config/locales/gl.yml +0 -7
  34. data/config/locales/hu.yml +2 -3
  35. data/config/locales/id-ID.yml +0 -3
  36. data/config/locales/is-IS.yml +0 -3
  37. data/config/locales/it.yml +23 -5
  38. data/config/locales/ko.yml +8 -0
  39. data/config/locales/lb.yml +0 -4
  40. data/config/locales/lt.yml +0 -1
  41. data/config/locales/lv.yml +0 -3
  42. data/config/locales/nl.yml +2 -3
  43. data/config/locales/no.yml +0 -7
  44. data/config/locales/pl.yml +0 -1
  45. data/config/locales/pt-BR.yml +2 -3
  46. data/config/locales/pt.yml +0 -5
  47. data/config/locales/ro-RO.yml +1 -2
  48. data/config/locales/ru.yml +0 -3
  49. data/config/locales/sk.yml +0 -3
  50. data/config/locales/sq-AL.yml +10 -3
  51. data/config/locales/sv.yml +3 -3
  52. data/config/locales/tr-TR.yml +0 -5
  53. data/config/locales/uk.yml +0 -3
  54. data/config/locales/zh-CN.yml +0 -5
  55. data/config/locales/zh-TW.yml +0 -1
  56. data/decidim-budgets.gemspec +1 -1
  57. data/lib/decidim/api/budget_type.rb +6 -0
  58. data/lib/decidim/api/budgets_type.rb +1 -3
  59. data/lib/decidim/api/project_type.rb +13 -0
  60. data/lib/decidim/budgets/version.rb +1 -1
  61. metadata +16 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5868363edf9819d119576efd444c8c51809e9f7e3b259855546160ffbf68b53e
4
- data.tar.gz: d5600e4d6ebc920e5fa5ec585ce52a7e62007093eee26fa65e654fb095662dc5
3
+ metadata.gz: fb2c40b3a5eb29eb321fb61dd190aca4b01b62baa67c7d707a177a960533c9ff
4
+ data.tar.gz: 5ddc4377e8081598538121012523991c3448aba16923108b287557cf4d963932
5
5
  SHA512:
6
- metadata.gz: 75ac62e677c12d2873ff528b33c2a81fd62482ad27fb8d89046227cbcb481da5a6c93ac2e47bc558871a09ef9d42e2a56b3787a4889569f4848666760e71fe5b
7
- data.tar.gz: ffdc85aeec48d10700cdb21407edd2257c1f2abd2c0869f6980ed80577c483fd6a4f0800e8a2fbf8d8cd25fd4d17d5e54cbbf8192e855ebd07b9bcf469b3061e
6
+ metadata.gz: 83210fb9f507d38d1b00baee67316c5223f0e8faf1f7e2bd16d037cac9846d35e4d9c8160e2d7beee0a0ed801dec765f62919fa6019c447bcb6bde0fe0712d74
7
+ data.tar.gz: b275657a91a71f6fc8b16ca0001777fb2ebe420b7895ad081e8040edc585e66526ad8245e93c688b5a2bcb9cd898b1fc1555f6e2d00531bfaeee5de68d5519e6
@@ -1,5 +1,5 @@
1
1
  <h2 class="h5 md:h3 decorator"><%= t(:count, scope: i18n_scope, count: budgets.length) %></h2>
2
2
 
3
- <%= render partial: "decidim/shared/orders", formats: [:html], locals: { orders: AVAILABLE_ORDERS, i18n_scope: "decidim.budgets.budgets_list.orders" } %>
3
+ <%= render partial: "decidim/shared/orders", formats: [:html], locals: { orders: AVAILABLE_ORDERS, i18n_scope: "decidim.budgets.budgets_list.orders", css_class: "items-start ml-6", b_css_class: "!justify-start pb-0 pl-0" } %>
4
4
 
5
5
  <%= render :card_list %>
@@ -7,7 +7,7 @@
7
7
  <% end %>
8
8
 
9
9
  <% if budgets.where.not(id: voted.map(&:id)).exists? %>
10
- <div id="budgets" class="card__list-list">
10
+ <div id="budgets" class="card__list-list !space-y-5 w-full">
11
11
  <%= main_list %>
12
12
  </div>
13
13
  <% end %>
@@ -75,7 +75,7 @@ module Decidim
75
75
  end
76
76
 
77
77
  def all_proposals
78
- Decidim::Proposals::Proposal.where(component: origin_component).accepted
78
+ Decidim::Proposals::Proposal.where(component: origin_component).published.not_hidden.not_withdrawn.accepted.order(:published_at)
79
79
  end
80
80
 
81
81
  def origin_component
@@ -87,9 +87,13 @@ module Decidim
87
87
  # because otherwise duplicates could be created until the component is
88
88
  # published.
89
89
  original_proposal.linked_resources(:projects, "included_proposals", component_published: false).any? do |project|
90
- project.budget == form.budget
90
+ component_budgets.exists?(project.decidim_budgets_budget_id)
91
91
  end
92
92
  end
93
+
94
+ def component_budgets
95
+ @component_budgets ||= Decidim::Budgets::Budget.where(component: form.budget.component)
96
+ end
93
97
  end
94
98
  end
95
99
  end
@@ -11,7 +11,7 @@ module Decidim
11
11
 
12
12
  translatable_attribute :title, String
13
13
  attribute :weight, Integer, default: 0
14
- translatable_attribute :description, String
14
+ translatable_attribute :description, Decidim::Attributes::RichText
15
15
  attribute :total_budget, Integer, default: 0
16
16
  attribute :decidim_scope_id, Integer
17
17
 
@@ -11,7 +11,7 @@ module Decidim
11
11
  include Decidim::ApplicationHelper
12
12
 
13
13
  translatable_attribute :title, String
14
- translatable_attribute :description, String
14
+ translatable_attribute :description, Decidim::Attributes::RichText
15
15
 
16
16
  attribute :address, String
17
17
  attribute :latitude, Float
@@ -34,7 +34,7 @@ module Decidim
34
34
  end
35
35
 
36
36
  def scope
37
- @scope ||= @scope_id ? current_component.scopes.find_by(id: @scope_id) : current_component.scope
37
+ @scope ||= @attributes["scope_id"].value ? current_component.scopes.find_by(id: @attributes["scope_id"].value) : current_component.scope
38
38
  end
39
39
 
40
40
  def scope_id
@@ -71,8 +71,12 @@
71
71
  }
72
72
  }
73
73
 
74
+ &__projects__container {
75
+ @apply -mt-12 sm:mt-0;
76
+ }
77
+
74
78
  &__card__list-project {
75
- @apply ml-auto rounded py-3 px-6 bg-background w-[30%] min-w-[120px] grid grid-cols-1 md:grid-cols-2 md:place-items-center;
79
+ @apply ml-auto rounded py-3 px-4 bg-background w-[30%] min-w-[120px] flex flex-col justify-center items-center lg:flex-row lg:justify-around lg:place-items-center;
76
80
  }
77
81
 
78
82
  &__card__list-project__amount {
@@ -132,7 +136,7 @@
132
136
  }
133
137
 
134
138
  &__list--header {
135
- @apply grid grid-cols-2;
139
+ @apply flex items-center justify-between -ml-2 md:ml-0;
136
140
  }
137
141
 
138
142
  &-list {
@@ -18,6 +18,8 @@ module Decidim
18
18
  can_vote?(false) if can_vote_project?(project || order&.projects&.first)
19
19
  when :report
20
20
  permission_action.allow!
21
+ when :read
22
+ toggle_allow(project.visible?)
21
23
  end
22
24
  end
23
25
 
@@ -17,7 +17,7 @@
17
17
  <%= cell("decidim/budgets/budgets_header", current_workflow) %>
18
18
  </section>
19
19
 
20
- <section class="layout-main__section layout-main__heading">
20
+ <section class="layout-main__section layout-main__heading flex flex-col items-start">
21
21
  <%= cell("decidim/budgets/budgets_list", current_workflow) %>
22
22
  </section>
23
23
  <% end %>
@@ -1 +1 @@
1
- <%= order_selector available_orders, i18n_scope: "decidim.budgets.projects.orders" %>
1
+ <%= order_selector available_orders, i18n_scope: "decidim.budgets.projects.orders", css_class: "items-start pl-4" %>
@@ -26,7 +26,7 @@
26
26
  <div class="budget-summary__progressbar--meter" style="width: <%= current_order_budget_percent %>%"> </div>
27
27
  </div>
28
28
  <div class="budget-summary__progressbar-marks">
29
- <span class="budget-summary__progressbar-legend" style="width: <%= current_order_budget_percent_minimum %>%;">
29
+ <span class="budget-summary__progressbar-legend">
30
30
  <strong id="order-total-budget<%= "-responsive" if responsive %>" class="budget-summary__progressbar-legend-strong">
31
31
  <%= render partial: "decidim/budgets/projects/order_total_budget" %>
32
32
  </strong>
@@ -1,4 +1,12 @@
1
- <% add_decidim_page_title t("decidim.budgets.projects.projects_for", name: translated_attribute(budget.title)) %>
1
+ <% add_decidim_meta_tags(
2
+ description: translated_attribute(budget.description),
3
+ title: t("decidim.components.pagination.page_title",
4
+ component_name: t("decidim.budgets.projects.projects_for", name: translated_attribute(budget.title)),
5
+ current_page: projects.current_page,
6
+ total_pages: projects.total_pages ),
7
+ url: budget_url(budget),
8
+ resource: budget) %>
9
+
2
10
  <%= append_javascript_pack_tag "decidim_budgets" %>
3
11
  <%= append_stylesheet_pack_tag "decidim_budgets" %>
4
12
 
@@ -56,7 +64,7 @@
56
64
  </section>
57
65
  <% end %>
58
66
 
59
- <section id="projects" class="layout-main__section layout-main__heading">
67
+ <section id="projects" class="layout-main__section layout-main__heading budget__projects__container">
60
68
  <%= render partial: "projects" %>
61
69
  </section>
62
70
  <% else %>
@@ -8,4 +8,14 @@ $order.html('<%= j(render partial: "order").strip.html_safe %>');
8
8
  $projectsCount.html('<%= j(render partial: "count").strip.html_safe %>');
9
9
  $orderFilterInput.val('<%= order %>');
10
10
 
11
+ var $map = $("#map");
12
+ var controller = $map.data("map-controller");
13
+ if (controller) {
14
+ var markerData = JSON.parse('<%= escape_javascript projects_data_for_map(all_geocoded_projects).to_json.html_safe %>');
15
+ controller.clearMarkers();
16
+ if (markerData.length > 0){
17
+ controller.addMarkers(markerData);
18
+ }
19
+ }
20
+
11
21
  document.dispatchEvent(new CustomEvent("ajax:loaded", { detail: $projects[0] }));
@@ -1,15 +1,17 @@
1
1
  <% add_decidim_meta_tags(
2
- title: translated_attribute(project.title),
3
- description: translated_attribute(project.description)
4
- ) %>
2
+ title: translated_attribute(project.title),
3
+ description: translated_attribute(project.description),
4
+ resource: project,
5
+ url: resource_locator([project.budget, project]).url
6
+ ) %>
5
7
 
6
8
  <%
7
- edit_link(
8
- resource_locator([project.budget, project]).edit,
9
- :update,
10
- :project,
11
- project:
12
- )
9
+ edit_link(
10
+ resource_locator([project.budget, project]).edit,
11
+ :update,
12
+ :project,
13
+ project:
14
+ )
13
15
  %>
14
16
 
15
17
  <%= append_javascript_pack_tag "decidim_budgets" %>
@@ -37,6 +39,7 @@ edit_link(
37
39
  </div>
38
40
  <% end %>
39
41
  <%= cell("decidim/budgets/project_selected_status", project, as_label: true) %>
42
+
40
43
  <h1 class="h1 decorator budget__definition-project__title editor-content">
41
44
  <%= decidim_sanitize translated_attribute project.title %>
42
45
  </h1>
@@ -67,8 +70,10 @@ edit_link(
67
70
  </div>
68
71
  <% end %>
69
72
  </section>
73
+
70
74
  <section class="layout-main__section layout-main__buttons" data-buttons>
71
75
  <%= cell "decidim/comments_button", nil %>
76
+
72
77
  <div class="ml-auto">
73
78
  <%= cell "decidim/budgets/project_tags", project %>
74
79
  </div>
@@ -8,7 +8,6 @@ ar:
8
8
  total_budget: الميزانية الإجمالية
9
9
  project:
10
10
  decidim_category_id: الفئة
11
- decidim_scope_id: نطاق
12
11
  description: وصف
13
12
  proposal_ids: المقترحات ذات الصلة
14
13
  title: عنوان
@@ -31,7 +30,6 @@ ar:
31
30
  actions:
32
31
  attachment_collections: المجلدات
33
32
  attachments: مرفقات
34
- confirm_destroy: هل أنت متأكد أنك تريد حذف هذا المشروع؟
35
33
  destroy: حذف
36
34
  edit: تعديل
37
35
  edit_projects: إدارة المشاريع
@@ -117,7 +115,6 @@ ar:
117
115
  other: "%{count} مشاريع"
118
116
  filters:
119
117
  category: الفئة
120
- scope: نطاق
121
118
  search: بحث
122
119
  show:
123
120
  budget: ميزانية
@@ -127,6 +124,7 @@ ar:
127
124
  components:
128
125
  budgets:
129
126
  actions:
127
+ comment: تعليق
130
128
  vote: تصويت
131
129
  name: الميزانيات
132
130
  settings:
@@ -11,7 +11,7 @@ bg:
11
11
  project:
12
12
  budget_amount: Бюджетна сума
13
13
  decidim_category_id: Категория
14
- decidim_scope_id: Сфера
14
+ decidim_scope_id: Обхват
15
15
  description: Описание
16
16
  proposal_ids: Свързани предложения
17
17
  proposals: Предложения
@@ -44,7 +44,6 @@ bg:
44
44
  actions:
45
45
  attachment_collections: Папки
46
46
  attachments: Прикачени файлове
47
- confirm_destroy: Сигурни ли сте, че искате да изтриете този проект?
48
47
  destroy: Изтрий
49
48
  edit: Редактирай
50
49
  edit_projects: Обедини проекти
@@ -0,0 +1 @@
1
+ bn:
@@ -0,0 +1,22 @@
1
+ ---
2
+ bs:
3
+ decidim:
4
+ budgets:
5
+ order_summary_mailer:
6
+ order_summary:
7
+ selected_projects: 'Projekti koje ste izabrali su:'
8
+ subject: Glasali ste na prostoru za diskusiju %{space_name}
9
+ projects:
10
+ orders:
11
+ highest_cost: Najveća cena
12
+ label: Poređaj projekte po
13
+ lowest_cost: Najniža cena
14
+ most_voted: Najviše glasova
15
+ random: Slučajan redosled
16
+ components:
17
+ budgets:
18
+ settings:
19
+ global:
20
+ vote_minimum_budget_projects_number: Minimum projekata za glasanje
21
+ vote_rule_minimum_budget_projects_enabled: 'Omogući pravilo: Minimalni broj projekata o kojima se glasa'
22
+ vote_rule_threshold_percent_enabled: 'Omogući pravilo: Minimalni procenta budžeta'