decidim-budgets 0.19.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/decidim/budgets/icon.svg +1 -11
  3. data/app/assets/javascripts/decidim/budgets/projects.js.es6 +26 -4
  4. data/app/assets/stylesheets/decidim/budgets/budget/_budget-list.scss +147 -24
  5. data/app/cells/decidim/budgets/project_list_item/project_data.erb +5 -0
  6. data/app/cells/decidim/budgets/project_list_item/project_data_number.erb +3 -0
  7. data/app/cells/decidim/budgets/project_list_item/project_data_vote_button.erb +15 -0
  8. data/app/cells/decidim/budgets/project_list_item/project_data_votes.erb +7 -0
  9. data/app/cells/decidim/budgets/project_list_item/project_image.erb +5 -0
  10. data/app/cells/decidim/budgets/project_list_item/project_text.erb +17 -0
  11. data/app/cells/decidim/budgets/project_list_item/show.erb +5 -0
  12. data/app/cells/decidim/budgets/project_list_item_cell.rb +86 -0
  13. data/app/cells/decidim/budgets/project_m/data.erb +2 -2
  14. data/app/cells/decidim/budgets/project_m/footer.erb +1 -1
  15. data/app/commands/decidim/budgets/admin/create_project.rb +19 -9
  16. data/app/commands/decidim/budgets/admin/update_project.rb +12 -1
  17. data/app/commands/decidim/budgets/checkout.rb +2 -1
  18. data/app/controllers/concerns/decidim/budgets/needs_current_order.rb +5 -1
  19. data/app/controllers/concerns/decidim/budgets/orderable.rb +61 -0
  20. data/app/controllers/decidim/budgets/admin/projects_controller.rb +8 -5
  21. data/app/controllers/decidim/budgets/line_items_controller.rb +1 -1
  22. data/app/controllers/decidim/budgets/projects_controller.rb +23 -3
  23. data/app/forms/decidim/budgets/admin/component_form.rb +44 -0
  24. data/app/forms/decidim/budgets/admin/project_form.rb +14 -2
  25. data/app/helpers/decidim/budgets/application_helper.rb +1 -0
  26. data/app/helpers/decidim/budgets/projects_helper.rb +17 -0
  27. data/app/jobs/decidim/budgets/send_order_summary_job.rb +15 -0
  28. data/app/mailers/decidim/budgets/order_summary_mailer.rb +34 -0
  29. data/app/models/decidim/budgets/order.rb +28 -1
  30. data/app/models/decidim/budgets/project.rb +13 -0
  31. data/app/services/decidim/budgets/project_search.rb +8 -0
  32. data/app/types/decidim/budgets/budgets_type.rb +32 -0
  33. data/app/types/decidim/budgets/project_type.rb +25 -0
  34. data/app/views/decidim/budgets/admin/projects/_form.html.erb +3 -6
  35. data/app/views/decidim/budgets/admin/projects/proposals_picker.html.erb +1 -0
  36. data/app/views/decidim/budgets/order_summary_mailer/order_summary.html.erb +21 -0
  37. data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +1 -1
  38. data/app/views/decidim/budgets/projects/_budget_summary.html.erb +8 -2
  39. data/app/views/decidim/budgets/projects/_filters.html.erb +10 -6
  40. data/app/views/decidim/budgets/projects/_linked_projects.html.erb +1 -1
  41. data/app/views/decidim/budgets/projects/_order_progress.html.erb +8 -16
  42. data/app/views/decidim/budgets/projects/_project.html.erb +1 -57
  43. data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +3 -3
  44. data/app/views/decidim/budgets/projects/_projects.html.erb +8 -1
  45. data/app/views/decidim/budgets/projects/index.html.erb +3 -3
  46. data/app/views/decidim/budgets/projects/index.js.erb +8 -0
  47. data/app/views/decidim/budgets/projects/show.html.erb +1 -1
  48. data/config/locales/ar.yml +1 -6
  49. data/config/locales/bg-BG.yml +7 -0
  50. data/config/locales/ca.yml +27 -5
  51. data/config/locales/cs.yml +44 -22
  52. data/config/locales/da-DK.yml +1 -0
  53. data/config/locales/de.yml +27 -5
  54. data/config/locales/el-GR.yml +1 -0
  55. data/config/locales/el.yml +175 -0
  56. data/config/locales/en.yml +27 -5
  57. data/config/locales/es-MX.yml +27 -5
  58. data/config/locales/es-PY.yml +27 -5
  59. data/config/locales/es.yml +27 -5
  60. data/config/locales/et-EE.yml +1 -0
  61. data/config/locales/eu.yml +1 -6
  62. data/config/locales/fi-plain.yml +27 -5
  63. data/config/locales/fi.yml +40 -18
  64. data/config/locales/fr-CA.yml +175 -0
  65. data/config/locales/fr.yml +27 -5
  66. data/config/locales/ga-IE.yml +1 -0
  67. data/config/locales/gl.yml +1 -6
  68. data/config/locales/hr-HR.yml +1 -0
  69. data/config/locales/hu.yml +17 -6
  70. data/config/locales/id-ID.yml +1 -6
  71. data/config/locales/is-IS.yml +114 -0
  72. data/config/locales/it.yml +28 -6
  73. data/config/locales/ja-JP.yml +171 -0
  74. data/config/locales/lt-LT.yml +1 -0
  75. data/config/locales/lv-LV.yml +172 -0
  76. data/config/locales/mt-MT.yml +1 -0
  77. data/config/locales/nl.yml +32 -10
  78. data/config/locales/no.yml +160 -0
  79. data/config/locales/pl.yml +74 -52
  80. data/config/locales/pt-BR.yml +2 -7
  81. data/config/locales/pt.yml +64 -42
  82. data/config/locales/ro-RO.yml +179 -0
  83. data/config/locales/ru.yml +1 -6
  84. data/config/locales/sk-SK.yml +180 -0
  85. data/config/locales/sk.yml +175 -0
  86. data/config/locales/sl.yml +5 -0
  87. data/config/locales/sr-CS.yml +29 -0
  88. data/config/locales/sv.yml +27 -5
  89. data/config/locales/tr-TR.yml +1 -6
  90. data/config/locales/uk.yml +1 -6
  91. data/lib/decidim/budgets/admin_engine.rb +2 -0
  92. data/lib/decidim/budgets/component.rb +12 -0
  93. data/lib/decidim/budgets/seeds/city.jpeg +0 -0
  94. data/lib/decidim/budgets/test/factories.rb +33 -0
  95. data/lib/decidim/budgets/version.rb +1 -1
  96. metadata +55 -15
@@ -17,11 +17,24 @@ module Decidim
17
17
  include Decidim::Traceable
18
18
  include Decidim::Loggable
19
19
  include Decidim::Randomable
20
+ include Decidim::Searchable
20
21
 
21
22
  component_manifest_name "budgets"
22
23
  has_many :line_items, class_name: "Decidim::Budgets::LineItem", foreign_key: "decidim_project_id", dependent: :destroy
23
24
  has_many :orders, through: :line_items, foreign_key: "decidim_project_id", class_name: "Decidim::Budgets::Order"
24
25
 
26
+ searchable_fields(
27
+ scope_id: :decidim_scope_id,
28
+ participatory_space: { component: :participatory_space },
29
+ A: :title,
30
+ D: :description,
31
+ datetime: :created_at
32
+ )
33
+
34
+ def self.ordered_ids(ids)
35
+ order(Arel.sql("position(id::text in '#{ids.join(",")}')"))
36
+ end
37
+
25
38
  def self.log_presenter_class_for(_log)
26
39
  Decidim::Budgets::AdminLog::ProjectPresenter
27
40
  end
@@ -19,6 +19,14 @@ module Decidim
19
19
  .or(query.where(localized_search_text_in(:description), text: "%#{search_text}%"))
20
20
  end
21
21
 
22
+ def search_category_id
23
+ super
24
+ end
25
+
26
+ def search_scope_id
27
+ super
28
+ end
29
+
22
30
  # Returns the random projects for the current page.
23
31
  def results
24
32
  Project.where(id: super.pluck(:id))
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Budgets
5
+ BudgetsType = GraphQL::ObjectType.define do
6
+ interfaces [-> { Decidim::Core::ComponentInterface }]
7
+
8
+ name "Budgets"
9
+ description "A budget component of a participatory space."
10
+
11
+ connection :projects, ProjectType.connection_type do
12
+ resolve ->(component, _args, _ctx) {
13
+ ProjectTypeHelper.base_scope(component).includes(:component)
14
+ }
15
+ end
16
+
17
+ field(:project, ProjectType) do
18
+ argument :id, !types.ID
19
+
20
+ resolve ->(component, args, _ctx) {
21
+ ProjectTypeHelper.base_scope(component).find_by(id: args[:id])
22
+ }
23
+ end
24
+ end
25
+
26
+ module ProjectTypeHelper
27
+ def self.base_scope(component)
28
+ Project.where(component: component)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Budgets
5
+ ProjectType = GraphQL::ObjectType.define do
6
+ interfaces [
7
+ -> { Decidim::Core::ScopableInterface },
8
+ -> { Decidim::Core::AttachableInterface },
9
+ -> { Decidim::Comments::CommentableInterface },
10
+ -> { Decidim::Core::CategorizableInterface }
11
+ ]
12
+
13
+ name "Project"
14
+ description "A project"
15
+
16
+ field :id, !types.ID, "The internal ID for this project"
17
+ field :title, Decidim::Core::TranslatedFieldType, "The title for this project"
18
+ field :description, Decidim::Core::TranslatedFieldType, "The description for this project"
19
+ field :budget, types.Int, "The budget for this project"
20
+ field :createdAt, Decidim::Core::DateTimeType, "When this project was created", property: :created_at
21
+ field :updatedAt, Decidim::Core::DateTimeType, "When this project was updated", property: :updated_at
22
+ field :reference, types.String, "The reference for this project"
23
+ end
24
+ end
25
+ end
@@ -27,12 +27,9 @@
27
27
  </div>
28
28
 
29
29
  <div class="row column">
30
- <% if @form.proposals %>
31
- <%= form.select :proposal_ids,
32
- @form.proposals,
33
- {},
34
- { multiple: true, class: "chosen-select" } %>
35
- <% end %>
30
+ <%= proposals_picker(form, :proposals, proposals_picker_projects_path) %>
36
31
  </div>
32
+
33
+ <%= render partial: "decidim/admin/shared/gallery", locals: { form: form } %>
37
34
  </div>
38
35
  </div>
@@ -0,0 +1 @@
1
+ <%= cell "decidim/proposals/proposals_picker", current_component %>
@@ -0,0 +1,21 @@
1
+ <% if @component.try(:scopes_enabled) %>
2
+ <%= t(
3
+ ".voted_on_space_with_scope",
4
+ space_name: translated_attribute(@space.title),
5
+ scope_name: translated_attribute(@component.scope.name),
6
+ scope_type: translated_attribute(@component.scope.scope_type.name)
7
+ ) %>
8
+ <% else %>
9
+ <%= t(
10
+ ".voted_on_space",
11
+ space_name: translated_attribute(@space.title)
12
+ ) %>
13
+ <% end %>
14
+
15
+ <p><%= t(".selected_projects") %></p>
16
+
17
+ <ul>
18
+ <% @order.projects.each do |project| %>
19
+ <li><%= translated_attribute(project.title) %></li>
20
+ <% end %>
21
+ </ul>
@@ -22,7 +22,7 @@
22
22
  <p class="text-center"><%= t(".are_you_sure") %></p>
23
23
  <div class="row">
24
24
  <div class="columns medium-8 medium-offset-2">
25
- <%= button_to t(".confirm"), checkout_order_path, class: "button expanded", data: { disable: true } %>
25
+ <%= button_to t(".confirm"), "#{checkout_order_path}#content", class: "button expanded", data: { disable: true } %>
26
26
  </div>
27
27
  </div>
28
28
  <div class="text-center">
@@ -1,4 +1,4 @@
1
- <div class="card budget-summary" data-progress-reference>
1
+ <div class="card budget-summary" data-progress-reference data-safe-url="<%= projects_base_url %>">
2
2
  <div class="card__content">
3
3
  <% if include_heading %>
4
4
  <% if current_order_checked_out? %>
@@ -8,7 +8,13 @@
8
8
  </p>
9
9
  <% else %>
10
10
  <h3 class="heading3"><%= t(".title") %></h3>
11
- <p><%= t(".description", minimum_budget: budget_to_currency(current_order&.minimum_budget)) %></p>
11
+ <p>
12
+ <% if current_order.minimum_projects_rule? %>
13
+ <%= t(".description_minimum_projects_rule", minimum_number: current_order.minimum_projects) %>
14
+ <% else %>
15
+ <%= t(".description", minimum_budget: budget_to_currency(current_order.minimum_budget)) %>
16
+ <% end %>
17
+ </p>
12
18
  <% end %>
13
19
  <% end %>
14
20
 
@@ -1,11 +1,13 @@
1
+ <%= render partial: "decidim/shared/filter_form_help", locals: { skip_to_id: "projects" } %>
2
+
1
3
  <%= filter_form_for filter do |form| %>
2
4
  <div class="filters__section">
3
5
  <div class="filters__search">
4
6
  <div class="input-group">
5
- <%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t(".search") %>
7
+ <%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), data: { disable_dynamic_change: true } %>
6
8
  <div class="input-group-button">
7
- <button type="submit" class="button button--muted">
8
- <%= icon "magnifying-glass", aria_label: t(".search") %>
9
+ <button type="submit" class="button" aria-controls="projects">
10
+ <%= icon "magnifying-glass", aria_label: t(".search"), role: "img", "aria-hidden": true %>
9
11
  </button>
10
12
  </div>
11
13
  </div>
@@ -13,10 +15,12 @@
13
15
  </div>
14
16
 
15
17
  <% if current_participatory_space.has_subscopes? %>
16
- <%= scopes_picker_filter form, :scope_id %>
18
+ <%= form.check_boxes_tree :scope_id, filter_scopes_values, legend_title: t(".scope"), "aria-controls": "projects" %>
17
19
  <% end %>
18
20
 
19
- <% if current_component.categories.any? %>
20
- <%= form.categories_select :category_id, current_component.categories, legend_title: t(".category"), disable_parents: false, label: false, prompt: t(".category_prompt") %>
21
+ <% if current_participatory_space.categories.any? %>
22
+ <%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category"), "aria-controls": "projects" %>
21
23
  <% end %>
24
+
25
+ <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
22
26
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <div class="card card--action card--list">
2
2
  <% resources.each do |project| %>
3
3
  <div class="card--list__item">
4
- <%= icon "actions", class: "card--list__icon", remove_icon_class: true %>
4
+ <%= icon "actions", class: "card--list__icon", role: "img", "aria-hidden": true, remove_icon_class: true %>
5
5
  <%= link_to resource_locator(project).path, class: "card--list__text card__link card__link--block" do %>
6
6
  <h5 class="card--list__heading">
7
7
  <%= translated_attribute(project.title) %>
@@ -1,35 +1,27 @@
1
1
  <div id="order-progress">
2
2
  <div class="budget-summary__progressbox" data-current-budget="<%= current_order ? current_order.total_budget : 0 %>">
3
- <div class="progress budget-progress" role="progressbar" tabindex="0" aria-valuenow="<%= current_order_budget_percent %>" aria-valuemin="<%= component_settings.vote_threshold_percent %>" aria-valuetext="<%= current_order_budget_percent %>%" aria-valuemax="100">
4
- <div class="progress-meter progress-meter--minimum" style="width: <%= 100 - current_order_budget_percent %>%"></div>
3
+ <div class="progress budget-progress" role="progressbar" aria-valuenow="<%= current_order_budget_percent %>" aria-valuetext="<%= current_order_budget_percent %>%" aria-valuemin="0" aria-valuemax="100">
4
+ <div class="progress-meter progress-meter--minimum" style="width: <%= component_settings.vote_threshold_percent %>%"></div>
5
5
  <!--Change width and text dynamically.-->
6
6
  <div class="progress-meter budget-progress__meter" style="width: <%= current_order_budget_percent %>%">
7
- <p class="progress-meter-text progress-meter-text--right"><%= current_order_budget_percent %>%</p>
7
+ <span class="progress-meter-text progress-meter-text--right"><%= current_order_budget_percent %>%</span>
8
8
  </div>
9
9
  </div>
10
10
  <% unless current_order_checked_out? %>
11
- <% if current_order_can_be_checked_out? %>
12
- <button class="button small button--sc" data-toggle="budget-confirm"><%= t(".vote") %></button>
13
- <% else %>
14
- <button class="button small button--sc" data-toggle="budget-confirm" disabled><%= t(".vote") %></button>
15
- <% end %>
11
+ <button class="button small button--sc" data-toggle="budget-confirm" <%= budget_confirm_disabled_attr %>><%= t(".vote") %></button>
16
12
  <% end %>
17
13
  </div>
18
14
 
19
15
  <div class="progressbox-fixed-wrapper" data-progressbox-fixed>
20
16
  <div class="budget-summary__progressbox budget-summary__progressbox--fixed">
21
- <div class="progress budget-progress budget-progress--fixed" role="progressbar" tabindex="0" aria-valuenow="<%= current_order_budget_percent %>" aria-valuemin="<%= component_settings.vote_threshold_percent %>" aria-valuetext="<%= current_order_budget_percent %>%" aria-valuemax="100">
22
- <div class="progress-meter progress-meter--minimum" style="width: <%= 100 - current_order_budget_percent %>%"></div>
17
+ <div class="progress budget-progress budget-progress--fixed" role="progressbar" aria-valuenow="<%= current_order_budget_percent %>" aria-valuetext="<%= current_order_budget_percent %>%" aria-valuemin="0" aria-valuemax="100">
18
+ <div class="progress-meter progress-meter--minimum" style="width: <%= component_settings.vote_threshold_percent %>%"></div>
23
19
  <div class="progress-meter budget-progress__meter" style="width: <%= current_order_budget_percent %>%">
24
- <p class="progress-meter-text progress-meter-text--right"><%= current_order_budget_percent %>%</p>
20
+ <span class="progress-meter-text progress-meter-text--right"><%= current_order_budget_percent %>%</span>
25
21
  </div>
26
22
  </div>
27
23
  <% unless current_order_checked_out? %>
28
- <% if current_order_can_be_checked_out? %>
29
- <button class="button small button--sc" data-toggle="budget-confirm"><%= t(".vote") %></button>
30
- <% else %>
31
- <button class="button small button--sc" data-toggle="budget-confirm" disabled><%= t(".vote") %></button>
32
- <% end %>
24
+ <button class="button small button--sc" data-toggle="budget-confirm" <%= budget_confirm_disabled_attr %>><%= t(".vote") %></button>
33
25
  <% end %>
34
26
  </div>
35
27
  </div>
@@ -1,57 +1 @@
1
- <div id="project-<%= project.id %>-item" class="card--list__item">
2
- <div class="card--list__text">
3
- <div>
4
- <%= link_to project, class: "card__link" do %>
5
- <h5 class="card__title budget-list__title">
6
- <%= translated_attribute project.title %>
7
- </h5>
8
- <% end %>
9
- <%= cell "decidim/tags", project, context: { extra_classes: ["tags--project"] } %>
10
- </div>
11
- </div>
12
- <% if current_user.present? %>
13
- <% if current_order && current_order.projects.include?(project) %>
14
- <div class="card--list__data budget-list__data budget-list__data--added">
15
- <span class="card--list__data__number budget-list__number">
16
- <%= budget_to_currency(project.budget) %>
17
- </span>
18
- <%= action_authorized_button_to "vote", order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true, budget: project.budget, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button tiny budget--list__action success" do %>
19
- <%= icon("check", class: "icon--small", aria_label: t(".remove"), role: "img") %>
20
- <% end %>
21
- <% if current_settings.show_votes? %>
22
- <div class="card__support" style="width: 7em">
23
- <span><%= t(".count", count: project.confirmed_orders_count) %></span>
24
- </div>
25
- <% end %>
26
- </div>
27
- <% else %>
28
- <div class="card--list__data budget-list__data">
29
- <span class="card--list__data__number budget-list__number">
30
- <%= budget_to_currency(project.budget) %>
31
- </span>
32
- <%= action_authorized_button_to "vote", order_line_item_path(project_id: project), method: :post, remote: true, data: { disable: true, budget: project.budget, add: true, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button tiny hollow budget--list__action" do %>
33
- <%= icon("check", class: "icon--small", aria_label: t(".add"), role: "img") %>
34
- <% end %>
35
- <% if current_settings.show_votes? %>
36
- <div class="card__support" style="width: 7em">
37
- <span><%= t(".count", count: project.confirmed_orders_count) %></span>
38
- </div>
39
- <% end %>
40
- </div>
41
- <% end %>
42
- <% else %>
43
- <div class="card--list__data budget-list__data">
44
- <span class="card--list__data__number budget-list__number">
45
- <%= budget_to_currency(project.budget) %>
46
- </span>
47
- <a href="#" class="button tiny hollow budget--list__action disabled" data-toggle="loginModal">
48
- <%= icon("check", class: "icon--small", aria_label: t(".add"), role: "img") %>
49
- </a>
50
- <% if current_settings.show_votes? %>
51
- <div class="card__support" style="width: 7em">
52
- <span><%= t(".count", count: project.confirmed_orders_count) %></span>
53
- </div>
54
- <% end %>
55
- </div>
56
- <% end %>
57
- </div>
1
+ <%= cell "decidim/budgets/project_list_item", project %>
@@ -1,11 +1,11 @@
1
1
  <div id="project-<%= project.id %>-budget-button">
2
2
  <% if current_user.present? %>
3
3
  <% if current_order && current_order.projects.include?(project) %>
4
- <%= action_authorized_button_to "vote", t(".added"), order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true, budget: project.budget, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button expanded button--sc success budget--list__action" %>
4
+ <%= action_authorized_button_to "vote", t(".added"), order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true, budget: project.budget, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button expanded button--sc active budget--list__action", "aria-label": t(".added_descriptive", resource_name: translated_attribute(project.title)) %>
5
5
  <% else %>
6
- <%= action_authorized_button_to "vote", t(".add"), order_line_item_path(project_id: project), method: :post, remote: true, data: { disable: true, budget: project.budget, add: true, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button expanded button--sc budget--list__action" %>
6
+ <%= action_authorized_button_to "vote", t(".add"), order_line_item_path(project_id: project), method: :post, remote: true, data: { disable: true, budget: project.budget, add: true, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button expanded button--sc budget--list__action", "aria-label": t(".add_descriptive", resource_name: translated_attribute(project.title)) %>
7
7
  <% end %>
8
8
  <% else %>
9
- <button class="button expanded button--sc disabled" data-toggle="loginModal"><%= t(".add") %></button>
9
+ <button class="button expanded button--sc disabled" data-toggle="loginModal" aria-label="<%= t(".add_descriptive", resource_name: translated_attribute(project.title)) %>"><%= t(".add") %></button>
10
10
  <% end %>
11
11
  </div>
@@ -1,6 +1,13 @@
1
- <div class="card card--list budget-list">
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" %>
4
+ </div>
5
+ </div>
6
+
7
+ <div class="budget-list">
2
8
  <% projects.each do |project| %>
3
9
  <%= render partial: "project", locals: { project: project } %>
4
10
  <% end %>
5
11
  </div>
12
+
6
13
  <%= decidim_paginate projects %>
@@ -6,9 +6,9 @@
6
6
  </div>
7
7
  <% end %>
8
8
  <div class="row columns">
9
- <h2 class="section-heading">
9
+ <h3 class="section-heading">
10
10
  <%= render partial: "count" %>
11
- </h2>
11
+ </h3>
12
12
  </div>
13
13
  <div class="row">
14
14
  <div class="columns mediumlarge-4 large-3">
@@ -17,7 +17,7 @@
17
17
  <%= render partial: "filters" %>
18
18
  </div>
19
19
  </div>
20
- <div id="projects" class="columns mediumlarge-8 large-9">
20
+ <div id="projects" class="columns mediumlarge-8 large-9" aria-live="polite">
21
21
  <%= render partial: "projects" %>
22
22
  </div>
23
23
  </div>
@@ -1,2 +1,10 @@
1
1
  var $projects = $('#projects');
2
+ var $projectsCount = $('#projects-count');
3
+ var $orderFilterInput = $('.order_filter');
4
+
2
5
  $projects.html('<%= j(render partial: "projects").strip.html_safe %>');
6
+ $projectsCount.html('<%= j(render partial: "count").strip.html_safe %>');
7
+ $orderFilterInput.val('<%= order %>');
8
+
9
+ var $dropdownMenu = $('.dropdown.menu', $projects);
10
+ $dropdownMenu.foundation();
@@ -17,7 +17,7 @@ edit_link(
17
17
  <%= render partial: "budget_summary", locals: { include_heading: false } %>
18
18
  <% end %>
19
19
  <%= link_to projects_path, class: "muted-link" do %>
20
- <%= icon "chevron-left", class: "icon--small" %>
20
+ <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
21
21
  <%= t(".view_all_projects") %>
22
22
  <% end %>
23
23
  <h2 class="heading2"><%= translated_attribute project.title %></h2>
@@ -100,7 +100,7 @@ ar:
100
100
  other: "%{count} مشاريع"
101
101
  filters:
102
102
  category: الفئة
103
- category_prompt: اختر تصنيف
103
+ scope: نطاق
104
104
  search: بحث
105
105
  filters_small_view:
106
106
  close_modal: إغلاق مشروط
@@ -120,7 +120,6 @@ ar:
120
120
  other: المشاريع المختارة
121
121
  view: رأي
122
122
  project:
123
- add: إضافة
124
123
  count:
125
124
  zero: "%{count} يدعم"
126
125
  one: 1 الدعم
@@ -128,11 +127,7 @@ ar:
128
127
  few: "%{count} يدعم"
129
128
  many: "%{count} يدعم"
130
129
  other: "%{count} يدعم"
131
- remove: إزالة
132
130
  view: رأي
133
- project_budget_button:
134
- add: إضافة
135
- added: وأضاف
136
131
  show:
137
132
  budget: ميزانية
138
133
  view_all_projects: عرض جميع المشاريع
@@ -0,0 +1,7 @@
1
+ bg:
2
+ activemodel:
3
+ attributes:
4
+ project:
5
+ budget: Бюджет
6
+ decidim_category_id: Категория
7
+ decidim_scope_id: Сфера
@@ -65,6 +65,12 @@ ca:
65
65
  project:
66
66
  fields:
67
67
  title: Títol
68
+ order_summary_mailer:
69
+ order_summary:
70
+ selected_projects: 'Els projectes que has seleccionat són:'
71
+ subject: Has votat a l'espai de participació %{space_name}
72
+ voted_on_space: Has votat en el pressupost de l'espai de participació %{space_name}.
73
+ voted_on_space_with_scope: Has votat en el pressupost de l'espai de participació %{space_name} a %{scope_name} (%{scope_type}).
68
74
  projects:
69
75
  budget_confirm:
70
76
  are_you_sure: Hi estàs d'acord? Un cop hagis confirmat el teu vot, no podràs canviar-lo.
@@ -85,6 +91,7 @@ ca:
85
91
  description: Ja has votat pel pressupost. Si has canviat d'idea, pots %{cancel_link}.
86
92
  title: Vot pels pressupostos completat
87
93
  description: En quins projectes creus que hem de destinar el pressupost? Assigna com a mínim %{minimum_budget} als projectes que desitges i vota per definir el pressupost.
94
+ description_minimum_projects_rule: A quins projectes creus que hem de destinar el pressupost? Selecciona com a mínim %{minimum_number} projectes i vota segons les teves preferències per a definir el pressupost.
88
95
  title: Tu decideixes el pressupost
89
96
  count:
90
97
  projects_count:
@@ -92,7 +99,7 @@ ca:
92
99
  other: "%{count} projectes"
93
100
  filters:
94
101
  category: Categoria
95
- category_prompt: Selecciona una categoria
102
+ scope: Àmbit
96
103
  search: Cerca
97
104
  filters_small_view:
98
105
  close_modal: Tancar finestra
@@ -107,16 +114,24 @@ ca:
107
114
  one: projecte seleccionat
108
115
  other: projectes seleccionats
109
116
  view: Veure
117
+ orders:
118
+ highest_cost: Major cost
119
+ label: Ordenar projectes per
120
+ lowest_cost: Menor cost
121
+ most_voted: Més votats
122
+ random: Ordre aleatori
110
123
  project:
111
- add: Afegir
124
+ add: Afegir el projecte %{resource_name} al teu vot
112
125
  count:
113
126
  one: 1 suport
114
127
  other: "%{count} suports"
115
- remove: Esborrar
128
+ remove: Esborrar el projecte %{resource_name} del teu vot
116
129
  view: Veure
117
130
  project_budget_button:
118
- add: Afegir
119
- added: Afegit
131
+ add: Afegir al teu vot
132
+ add_descriptive: Afegir el projecte %{resource_name} al teu vot
133
+ added: Afegit al teu vot
134
+ added_descriptive: El projecte %{resource_name} s'ha afegit al teu vot
120
135
  show:
121
136
  budget: Pressupost
122
137
  view_all_projects: Veure tots els projectes
@@ -129,9 +144,16 @@ ca:
129
144
  global:
130
145
  announcement: Avís
131
146
  comments_enabled: Comentaris habilitats
147
+ form:
148
+ errors:
149
+ budget_voting_rule_only_one: Cal activar com a mínim una norma per a la votació
150
+ budget_voting_rule_required: Es requereix una norma per a la votació
132
151
  projects_per_page: Projectes per pàgina
133
152
  resources_permissions_enabled: Es poden establir permisos d'accions per a cada trobada
134
153
  total_budget: Pressupost total
154
+ vote_minimum_budget_projects_number: Nombre màxim de projectes a votar
155
+ vote_rule_minimum_budget_projects_enabled: 'Activar norma: Número mínim de projectes a votar'
156
+ vote_rule_threshold_percent_enabled: 'Activar norma: percentatge mínim del pressupost'
135
157
  vote_threshold_percent: Percentatge del pressupost mínim per fer el vot
136
158
  step:
137
159
  announcement: Avís