decidim-budgets 0.21.0 → 0.23.2
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.
- checksums.yaml +4 -4
- data/README.md +38 -3
- data/app/assets/images/decidim/budgets/icon.svg +1 -11
- data/app/assets/javascripts/decidim/budgets/projects.js.es6 +26 -4
- data/app/assets/stylesheets/decidim/budgets/budget/_budget-list.scss +152 -24
- data/app/cells/decidim/budgets/base_cell.rb +22 -0
- data/app/cells/decidim/budgets/budget_cell.rb +21 -0
- data/app/cells/decidim/budgets/budget_information_modal/show.erb +28 -0
- data/app/cells/decidim/budgets/budget_information_modal_cell.rb +22 -0
- data/app/cells/decidim/budgets/budget_list_item/show.erb +22 -0
- data/app/cells/decidim/budgets/budget_list_item_cell.rb +40 -0
- data/app/cells/decidim/budgets/budget_m/data.erb +12 -0
- data/app/cells/decidim/budgets/budget_m/footer.erb +5 -0
- data/app/cells/decidim/budgets/budget_m_cell.rb +16 -0
- data/app/cells/decidim/budgets/budgets_header/show.erb +7 -0
- data/app/cells/decidim/budgets/budgets_header_cell.rb +14 -0
- data/app/cells/decidim/budgets/budgets_list/card_list.erb +7 -0
- data/app/cells/decidim/budgets/budgets_list/highlighted.erb +11 -0
- data/app/cells/decidim/budgets/budgets_list/show.erb +20 -0
- data/app/cells/decidim/budgets/budgets_list/voted.erb +43 -0
- data/app/cells/decidim/budgets/budgets_list_cell.rb +39 -0
- data/app/cells/decidim/budgets/limit_announcement_cell.rb +52 -0
- data/app/cells/decidim/budgets/project_list_item/project_data.erb +19 -0
- data/app/cells/decidim/budgets/project_list_item/project_data_vote_button.erb +15 -0
- data/app/cells/decidim/budgets/project_list_item/project_image.erb +5 -0
- data/app/cells/decidim/budgets/project_list_item/project_text.erb +23 -0
- data/app/cells/decidim/budgets/project_list_item/show.erb +5 -0
- data/app/cells/decidim/budgets/project_list_item_cell.rb +66 -0
- data/app/cells/decidim/budgets/project_m/data.erb +3 -3
- data/app/cells/decidim/budgets/project_m/footer.erb +1 -1
- data/app/cells/decidim/budgets/project_m_cell.rb +4 -0
- data/app/cells/decidim/budgets/project_selected_status_cell.rb +28 -0
- data/app/cells/decidim/budgets/project_tags/show.erb +5 -0
- data/app/cells/decidim/budgets/project_tags_cell.rb +18 -0
- data/app/cells/decidim/budgets/project_voted_hint_cell.rb +33 -0
- data/app/cells/decidim/budgets/project_votes_count_cell.rb +44 -0
- data/app/commands/decidim/budgets/add_line_item.rb +7 -10
- data/app/commands/decidim/budgets/admin/create_budget.rb +48 -0
- data/app/commands/decidim/budgets/admin/create_project.rb +26 -11
- data/app/commands/decidim/budgets/admin/destroy_budget.rb +42 -0
- data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +26 -25
- data/app/commands/decidim/budgets/admin/update_budget.rb +48 -0
- data/app/commands/decidim/budgets/admin/update_project.rb +20 -2
- data/app/commands/decidim/budgets/checkout.rb +7 -6
- data/app/commands/decidim/budgets/remove_line_item.rb +3 -2
- data/app/controllers/concerns/decidim/budgets/needs_current_order.rb +18 -2
- data/app/controllers/concerns/decidim/budgets/orderable.rb +57 -0
- data/app/controllers/decidim/budgets/admin/application_controller.rb +10 -2
- data/app/controllers/decidim/budgets/admin/attachment_collections_controller.rb +1 -1
- data/app/controllers/decidim/budgets/admin/attachments_controller.rb +2 -2
- data/app/controllers/decidim/budgets/admin/budgets_controller.rb +82 -0
- data/app/controllers/decidim/budgets/admin/projects_controller.rb +15 -12
- data/app/controllers/decidim/budgets/admin/proposals_imports_controller.rb +10 -2
- data/app/controllers/decidim/budgets/application_controller.rb +23 -0
- data/app/controllers/decidim/budgets/budgets_controller.rb +24 -0
- data/app/controllers/decidim/budgets/line_items_controller.rb +10 -6
- data/app/controllers/decidim/budgets/orders_controller.rb +20 -6
- data/app/controllers/decidim/budgets/projects_controller.rb +24 -19
- data/app/forms/decidim/budgets/admin/budget_form.rb +39 -0
- data/app/forms/decidim/budgets/admin/component_form.rb +44 -0
- data/app/forms/decidim/budgets/admin/project_form.rb +25 -9
- data/app/forms/decidim/budgets/admin/project_import_proposals_form.rb +4 -0
- data/app/helpers/decidim/budgets/admin/application_helper.rb +13 -0
- data/app/helpers/decidim/budgets/application_helper.rb +10 -0
- data/app/helpers/decidim/budgets/projects_helper.rb +13 -0
- data/app/jobs/decidim/budgets/send_order_summary_job.rb +15 -0
- data/app/mailers/decidim/budgets/order_summary_mailer.rb +36 -0
- data/app/models/decidim/budgets/budget.rb +34 -0
- data/app/models/decidim/budgets/line_item.rb +4 -4
- data/app/models/decidim/budgets/order.rb +47 -16
- data/app/models/decidim/budgets/project.rb +37 -4
- data/app/permissions/decidim/budgets/admin/permissions.rb +23 -10
- data/app/permissions/decidim/budgets/permissions.rb +28 -6
- data/app/presenters/decidim/budgets/admin_log/budget_presenter.rb +42 -0
- data/app/queries/decidim/budgets/filtered_projects.rb +9 -1
- data/app/queries/decidim/budgets/metrics/budget_followers_metric_measure.rb +3 -2
- data/app/queries/decidim/budgets/metrics/budget_participants_metric_measure.rb +6 -5
- data/app/serializers/decidim/budgets/data_portability_budgets_order_serializer.rb +3 -2
- data/app/services/decidim/budgets/project_search.rb +12 -24
- data/app/types/decidim/budgets/budget_type.rb +24 -0
- data/app/types/decidim/budgets/budgets_type.rb +6 -6
- data/app/types/decidim/budgets/project_type.rb +2 -1
- data/app/views/decidim/budgets/admin/budgets/_form.html.erb +23 -0
- data/app/views/decidim/budgets/admin/budgets/edit.html.erb +7 -0
- data/app/views/decidim/budgets/admin/budgets/index.html.erb +58 -0
- data/app/views/decidim/budgets/admin/budgets/new.html.erb +7 -0
- data/app/views/decidim/budgets/admin/projects/_form.html.erb +15 -10
- data/app/views/decidim/budgets/admin/projects/edit.html.erb +2 -2
- data/app/views/decidim/budgets/admin/projects/index.html.erb +20 -7
- data/app/views/decidim/budgets/admin/projects/new.html.erb +2 -2
- data/app/views/decidim/budgets/admin/projects/proposals_picker.html.erb +1 -0
- data/app/views/decidim/budgets/admin/proposals_imports/new.html.erb +1 -1
- data/app/views/decidim/budgets/budgets/index.html.erb +5 -0
- data/app/views/decidim/budgets/order_summary_mailer/order_summary.html.erb +22 -0
- data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +3 -3
- data/app/views/decidim/budgets/projects/_budget_summary.html.erb +26 -7
- data/app/views/decidim/budgets/projects/_filters.html.erb +15 -7
- data/app/views/decidim/budgets/projects/_linked_projects.html.erb +2 -2
- data/app/views/decidim/budgets/projects/_order_progress.html.erb +14 -18
- data/app/views/decidim/budgets/projects/_order_selected_projects.html.erb +3 -3
- data/app/views/decidim/budgets/projects/_project.html.erb +1 -57
- data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +36 -7
- data/app/views/decidim/budgets/projects/_projects.html.erb +8 -1
- data/app/views/decidim/budgets/projects/index.html.erb +15 -7
- data/app/views/decidim/budgets/projects/index.js.erb +8 -0
- data/app/views/decidim/budgets/projects/show.html.erb +22 -13
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +2 -16
- data/config/locales/bg-BG.yml +7 -0
- data/config/locales/bg.yml +6 -0
- data/config/locales/ca.yml +125 -11
- data/config/locales/cs.yml +148 -34
- data/config/locales/da-DK.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +143 -29
- data/config/locales/el.yml +168 -0
- data/config/locales/en.yml +125 -11
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +125 -11
- data/config/locales/es-PY.yml +125 -11
- data/config/locales/es.yml +125 -11
- data/config/locales/et-EE.yml +1 -0
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +5 -13
- data/config/locales/fi-plain.yml +126 -12
- data/config/locales/fi.yml +136 -22
- data/config/locales/fr-CA.yml +267 -0
- data/config/locales/fr.yml +125 -11
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +70 -15
- data/config/locales/hr-HR.yml +1 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +18 -12
- data/config/locales/id-ID.yml +2 -11
- data/config/locales/is-IS.yml +0 -11
- data/config/locales/is.yml +114 -0
- data/config/locales/it.yml +96 -12
- data/config/locales/ja-JP.yml +172 -0
- data/config/locales/ja.yml +262 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt-LT.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +164 -0
- data/config/locales/mt-MT.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +112 -12
- data/config/locales/no.yml +42 -13
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +175 -61
- data/config/locales/pt-BR.yml +3 -13
- data/config/locales/pt.yml +62 -46
- data/config/locales/ro-RO.yml +172 -0
- data/config/locales/ru.yml +2 -14
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk-SK.yml +180 -0
- data/config/locales/sk.yml +166 -0
- data/config/locales/sl.yml +1 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +27 -0
- data/config/locales/sv.yml +125 -11
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +152 -38
- data/config/locales/uk.yml +2 -14
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +260 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20200617105120_create_decidim_budgets.rb +15 -0
- data/db/migrate/20200629072626_rename_budget_to_budget_ammount.rb +7 -0
- data/db/migrate/20200629134013_add_budget_reference_to_project.rb +7 -0
- data/db/migrate/20200706142609_add_budget_reference_to_order.rb +7 -0
- data/db/migrate/20200714103519_move_budgets_to_own_model.rb +109 -0
- data/db/migrate/20200717140012_add_scope_to_budgets.rb +7 -0
- data/db/migrate/20200728075039_add_selected_at_to_project.rb +7 -0
- data/db/migrate/20200804175222_votes_enabled_to_votes_choices.rb +35 -0
- data/db/migrate/20200827154129_add_commentable_counter_cache_to_projects.rb +9 -0
- data/lib/decidim/budgets.rb +1 -0
- data/lib/decidim/budgets/admin_engine.rb +12 -5
- data/lib/decidim/budgets/component.rb +87 -38
- data/lib/decidim/budgets/engine.rb +8 -6
- data/lib/decidim/budgets/seeds/city.jpeg +0 -0
- data/lib/decidim/budgets/test/factories.rb +71 -9
- data/lib/decidim/budgets/version.rb +1 -1
- data/lib/decidim/budgets/workflows.rb +17 -0
- data/lib/decidim/budgets/workflows/all.rb +20 -0
- data/lib/decidim/budgets/workflows/base.rb +132 -0
- data/lib/decidim/budgets/workflows/one.rb +33 -0
- metadata +123 -19
@@ -0,0 +1,22 @@
|
|
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
|
+
budget_name: translated_attribute(@budget.title),
|
12
|
+
space_name: translated_attribute(@space.title)
|
13
|
+
) %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<p><%= t(".selected_projects") %></p>
|
17
|
+
|
18
|
+
<ul>
|
19
|
+
<% @order.projects.each do |project| %>
|
20
|
+
<li><%= translated_attribute(project.title) %></li>
|
21
|
+
<% end %>
|
22
|
+
</ul>
|
@@ -11,9 +11,9 @@
|
|
11
11
|
<ul class="card__content">
|
12
12
|
<% current_order.projects.each do |project| %>
|
13
13
|
<li class="budget-summary__selected-item">
|
14
|
-
<%= link_to translated_attribute(project.title), project %>
|
14
|
+
<%= link_to translated_attribute(project.title), resource_locator([budget, project]).path %>
|
15
15
|
<strong class="budget-summary__selected-number">
|
16
|
-
<%= budget_to_currency project.
|
16
|
+
<%= budget_to_currency project.budget_amount %>
|
17
17
|
</strong>
|
18
18
|
</li>
|
19
19
|
<% end %>
|
@@ -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"),
|
25
|
+
<%= button_to t(".confirm"), checkout_budget_order_path(budget), class: "button expanded", data: { disable: true } %>
|
26
26
|
</div>
|
27
27
|
</div>
|
28
28
|
<div class="text-center">
|
@@ -1,21 +1,38 @@
|
|
1
|
-
<div class="card budget-summary" data-progress-reference>
|
1
|
+
<div class="card budget-summary" data-progress-reference data-safe-url="<%= budget_url(budget) %>">
|
2
2
|
<div class="card__content">
|
3
3
|
<% if include_heading %>
|
4
4
|
<% if current_order_checked_out? %>
|
5
|
-
<h3 class="heading3"
|
5
|
+
<h3 class="heading3">
|
6
|
+
<%= t(".checked_out.title") %>
|
7
|
+
<% unless current_workflow.single? %>
|
8
|
+
<small><%= translated_attribute(budget.title) %></small>
|
9
|
+
<% end %>
|
10
|
+
</h3>
|
6
11
|
<p>
|
7
|
-
<%= raw t(".checked_out.description", cancel_link: link_to(t(".cancel_order"),
|
12
|
+
<%= 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") })) %>
|
8
13
|
</p>
|
9
14
|
<% else %>
|
10
|
-
<h3 class="heading3"
|
11
|
-
|
15
|
+
<h3 class="heading3">
|
16
|
+
<% if current_workflow.single? %>
|
17
|
+
<%= t(".title") %>
|
18
|
+
<% else %>
|
19
|
+
<%= translated_attribute(budget.title) %>
|
20
|
+
<% end %>
|
21
|
+
</h3>
|
22
|
+
<p>
|
23
|
+
<% if current_order.minimum_projects_rule? %>
|
24
|
+
<%= t(".description_minimum_projects_rule", minimum_number: current_order.minimum_projects) %>
|
25
|
+
<% else %>
|
26
|
+
<%= t(".description", minimum_budget: budget_to_currency(current_order.minimum_budget)) %>
|
27
|
+
<% end %>
|
28
|
+
</p>
|
12
29
|
<% end %>
|
13
30
|
<% end %>
|
14
31
|
|
15
|
-
<div class="budget-summary__total" data-total-budget="<%=
|
32
|
+
<div class="budget-summary__total" data-total-budget="<%= budget.total_budget %>">
|
16
33
|
<span class="mini-title"><%= t("total_budget") %>
|
17
34
|
<strong class="mini-title__strong mini-title__strong--highlight">
|
18
|
-
<%= budget_to_currency(
|
35
|
+
<%= budget_to_currency(budget.total_budget) %>
|
19
36
|
</strong>
|
20
37
|
</span>
|
21
38
|
</div>
|
@@ -28,6 +45,8 @@
|
|
28
45
|
<%= render partial: "order_total_budget" %>
|
29
46
|
</span>
|
30
47
|
</div>
|
48
|
+
|
49
|
+
<%= cell("decidim/budgets/budget_information_modal", budget) %>
|
31
50
|
</div>
|
32
51
|
|
33
52
|
<%= render partial: "order_selected_projects" %>
|
@@ -1,22 +1,30 @@
|
|
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
|
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>
|
12
14
|
</div>
|
13
15
|
</div>
|
14
16
|
|
15
|
-
<% if
|
16
|
-
<%= form.check_boxes_tree :
|
17
|
+
<% if voting_finished? %>
|
18
|
+
<%= form.check_boxes_tree :status, filter_status_values, legend_title: t(".status"), "aria-controls": "projects" %>
|
19
|
+
<% end %>
|
20
|
+
|
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" %>
|
17
23
|
<% end %>
|
18
24
|
|
19
|
-
<% if
|
20
|
-
<%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category") %>
|
25
|
+
<% if current_participatory_space.categories.any? %>
|
26
|
+
<%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category"), "aria-controls": "projects" %>
|
21
27
|
<% end %>
|
28
|
+
|
29
|
+
<%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
|
22
30
|
<% end %>
|
@@ -1,8 +1,8 @@
|
|
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 %>
|
5
|
-
<%= link_to resource_locator(project).path, class: "card--list__text card__link card__link--block" do %>
|
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
6
|
<h5 class="card--list__heading">
|
7
7
|
<%= translated_attribute(project.title) %>
|
8
8
|
</h5>
|
@@ -1,35 +1,31 @@
|
|
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"
|
4
|
-
<div class="progress-meter progress-meter--minimum" style="width: <%=
|
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: <%= current_order_budget_percent_minimum %>%"></div>
|
5
5
|
<!--Change width and text dynamically.-->
|
6
6
|
<div class="progress-meter budget-progress__meter" style="width: <%= current_order_budget_percent %>%">
|
7
|
-
<
|
7
|
+
<span class="progress-meter-text progress-meter-text--right"><%= current_order_budget_percent %>%</span>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
|
-
<%
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<button class="button small button--sc" data-toggle="budget-confirm" disabled><%= t(".vote") %></button>
|
15
|
-
<% end %>
|
10
|
+
<% if !current_order_checked_out? && voting_open? %>
|
11
|
+
<button class="button small button--sc" data-toggle="budget-confirm" <%= budget_confirm_disabled_attr %>>
|
12
|
+
<%= t(".vote") %>
|
13
|
+
</button>
|
16
14
|
<% end %>
|
17
15
|
</div>
|
18
16
|
|
19
17
|
<div class="progressbox-fixed-wrapper" data-progressbox-fixed>
|
20
18
|
<div class="budget-summary__progressbox budget-summary__progressbox--fixed">
|
21
|
-
<div class="progress budget-progress budget-progress--fixed" role="progressbar"
|
22
|
-
<div class="progress-meter progress-meter--minimum" style="width: <%=
|
19
|
+
<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">
|
20
|
+
<div class="progress-meter progress-meter--minimum" style="width: <%= current_order_budget_percent_minimum %>%"></div>
|
23
21
|
<div class="progress-meter budget-progress__meter" style="width: <%= current_order_budget_percent %>%">
|
24
|
-
<
|
22
|
+
<span class="progress-meter-text progress-meter-text--right"><%= current_order_budget_percent %>%</span>
|
25
23
|
</div>
|
26
24
|
</div>
|
27
|
-
<%
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<button class="button small button--sc" data-toggle="budget-confirm" disabled><%= t(".vote") %></button>
|
32
|
-
<% end %>
|
25
|
+
<% if !current_order_checked_out? && voting_open? %>
|
26
|
+
<button class="button small button--sc" data-toggle="budget-confirm" <%= budget_confirm_disabled_attr %>>
|
27
|
+
<%= t(".vote") %>
|
28
|
+
</button>
|
33
29
|
<% end %>
|
34
30
|
</div>
|
35
31
|
</div>
|
@@ -9,12 +9,12 @@
|
|
9
9
|
<ul class="budget-summary__selected-list">
|
10
10
|
<% current_order.projects.each do |project| %>
|
11
11
|
<li class="budget-summary__selected-item">
|
12
|
-
<%= link_to translated_attribute(project.title), project %>
|
12
|
+
<%= link_to translated_attribute(project.title), resource_locator([budget, project]).path %>
|
13
13
|
<strong class="budget-summary__selected-number">
|
14
|
-
<%= budget_to_currency project.
|
14
|
+
<%= budget_to_currency project.budget_amount %>
|
15
15
|
</strong>
|
16
16
|
<% unless current_order_checked_out? %>
|
17
|
-
<%= button_to
|
17
|
+
<%= button_to budget_order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true }, form: { style: "display: inline" } do %>
|
18
18
|
<%= icon("trash", aria_label: t(".remove"), role: "img") %>
|
19
19
|
<% end %>
|
20
20
|
<% end %>
|
@@ -1,57 +1 @@
|
|
1
|
-
|
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,40 @@
|
|
1
1
|
<div id="project-<%= project.id %>-budget-button">
|
2
|
-
<% if
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
<% if voted_for?(project) %>
|
3
|
+
<%= action_authorized_button_to(
|
4
|
+
"vote",
|
5
|
+
t(".added"),
|
6
|
+
budget_order_line_item_path(budget, project_id: project),
|
7
|
+
method: :delete,
|
8
|
+
remote: true,
|
9
|
+
data: {
|
10
|
+
disable: true,
|
11
|
+
budget: project.budget_amount,
|
12
|
+
"redirect-url": budget_project_path(budget, project)
|
13
|
+
},
|
14
|
+
disabled: !can_have_order? || current_order_checked_out?,
|
15
|
+
class: "button expanded button--sc success",
|
16
|
+
"aria-label": t(".added_descriptive", resource_name: translated_attribute(project.title))
|
17
|
+
) %>
|
18
|
+
<% elsif current_user.present? %>
|
19
|
+
<%= action_authorized_button_to(
|
20
|
+
"vote",
|
21
|
+
t(".add"),
|
22
|
+
budget_order_line_item_path(budget, project_id: project),
|
23
|
+
method: :post,
|
24
|
+
remote: true,
|
25
|
+
data: {
|
26
|
+
disable: true,
|
27
|
+
budget: project.budget_amount,
|
28
|
+
add: true,
|
29
|
+
"redirect-url": budget_project_path(budget, project)
|
30
|
+
},
|
31
|
+
disabled: !can_have_order? || current_order_checked_out?,
|
32
|
+
class: "button expanded button--sc",
|
33
|
+
"aria-label": t(".add_descriptive", resource_name: translated_attribute(project.title))
|
34
|
+
) %>
|
8
35
|
<% else %>
|
9
|
-
<button class="button expanded button--sc
|
36
|
+
<button class="button expanded button--sc" data-toggle="loginModal">
|
37
|
+
<%= t(".add") %>
|
38
|
+
</button>
|
10
39
|
<% end %>
|
11
40
|
</div>
|
@@ -1,6 +1,13 @@
|
|
1
|
-
<div class="
|
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 %>
|
@@ -1,15 +1,23 @@
|
|
1
1
|
<%= render partial: "decidim/shared/component_announcement" %>
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
<%= cell("decidim/budgets/limit_announcement", budget) %>
|
4
|
+
|
5
|
+
<div class="row columns">
|
6
|
+
<% if voting_finished? %>
|
7
|
+
<h2 class="heading2">
|
8
|
+
<%= t("decidim.budgets.projects.projects_for", name: translated_attribute(budget.title)) %>
|
9
|
+
</h2>
|
10
|
+
<% else %>
|
5
11
|
<%= render partial: "budget_summary", locals: { include_heading: true } %>
|
6
|
-
|
7
|
-
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
|
8
15
|
<div class="row columns">
|
9
|
-
<
|
16
|
+
<h3 class="section-heading">
|
10
17
|
<%= render partial: "count" %>
|
11
|
-
</
|
18
|
+
</h3>
|
12
19
|
</div>
|
20
|
+
|
13
21
|
<div class="row">
|
14
22
|
<div class="columns mediumlarge-4 large-3">
|
15
23
|
<%= render partial: "filters_small_view" %>
|
@@ -17,7 +25,7 @@
|
|
17
25
|
<%= render partial: "filters" %>
|
18
26
|
</div>
|
19
27
|
</div>
|
20
|
-
<div id="projects" class="columns mediumlarge-8 large-9">
|
28
|
+
<div id="projects" class="columns mediumlarge-8 large-9" aria-live="polite">
|
21
29
|
<%= render partial: "projects" %>
|
22
30
|
</div>
|
23
31
|
</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();
|
@@ -5,21 +5,26 @@
|
|
5
5
|
|
6
6
|
<%
|
7
7
|
edit_link(
|
8
|
-
resource_locator(project).edit,
|
8
|
+
resource_locator([project.budget, project]).edit,
|
9
9
|
:update,
|
10
10
|
:project,
|
11
11
|
project: project
|
12
12
|
)
|
13
13
|
%>
|
14
14
|
|
15
|
+
<%= cell("decidim/budgets/limit_announcement", budget) %>
|
16
|
+
|
15
17
|
<div class="row column view-header">
|
16
|
-
<%
|
18
|
+
<% unless voting_finished? %>
|
17
19
|
<%= render partial: "budget_summary", locals: { include_heading: false } %>
|
18
20
|
<% end %>
|
19
|
-
|
20
|
-
|
21
|
-
<%=
|
22
|
-
|
21
|
+
|
22
|
+
<div class="m-bottom">
|
23
|
+
<%= link_to resource_locator(budget).path(filter_link_params), class: "muted-link" do %>
|
24
|
+
<%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
|
25
|
+
<%= t(".view_all_projects") %>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
23
28
|
<h2 class="heading2"><%= translated_attribute project.title %></h2>
|
24
29
|
</div>
|
25
30
|
<div class="row">
|
@@ -29,14 +34,17 @@ edit_link(
|
|
29
34
|
<div class="card__content">
|
30
35
|
<div class="m-bottom">
|
31
36
|
<span class="definition-data__title"><%= t(".budget") %></span>
|
32
|
-
<span class="definition-data__number"><%= budget_to_currency project.
|
37
|
+
<span class="definition-data__number"><%= budget_to_currency project.budget_amount %></span>
|
33
38
|
</div>
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
|
40
|
+
<%= cell("decidim/budgets/project_votes_count", project, layout: :one_line, class: "display-block") %>
|
41
|
+
|
42
|
+
<% if voting_finished? %>
|
43
|
+
<%= cell("decidim/budgets/project_voted_hint", project, class: "display-block") %>
|
44
|
+
<% elsif voting_open? %>
|
45
|
+
<%= render partial: "project_budget_button", locals: { project: project } %>
|
38
46
|
<% end %>
|
39
|
-
|
47
|
+
|
40
48
|
<%= render partial: "decidim/shared/follow_button", locals: { followable: project, large: false } %>
|
41
49
|
</div>
|
42
50
|
</div>
|
@@ -44,8 +52,9 @@ edit_link(
|
|
44
52
|
</div>
|
45
53
|
<div class="columns mediumlarge-8 mediumlarge-pull-4">
|
46
54
|
<div class="section">
|
55
|
+
<%= cell("decidim/budgets/project_selected_status", project, as_label: true) %>
|
47
56
|
<%= decidim_sanitize translated_attribute project.description %>
|
48
|
-
<%= cell "decidim/
|
57
|
+
<%= cell "decidim/budgets/project_tags", project, context: { extra_classes: ["tags--project"] } %>
|
49
58
|
</div>
|
50
59
|
<%= linked_resources_for project, :proposals, "included_proposals" %>
|
51
60
|
<%= linked_resources_for project, :results, "included_projects" %>
|