decidim-budgets 0.22.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -3
- data/app/assets/stylesheets/decidim/budgets/budget/_budget-list.scss +5 -0
- 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 +17 -3
- data/app/cells/decidim/budgets/project_list_item/project_data_vote_button.erb +2 -2
- data/app/cells/decidim/budgets/project_list_item/project_text.erb +11 -5
- data/app/cells/decidim/budgets/project_list_item/show.erb +3 -3
- data/app/cells/decidim/budgets/project_list_item_cell.rb +8 -28
- data/app/cells/decidim/budgets/project_m/data.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 +12 -7
- 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 +8 -1
- data/app/commands/decidim/budgets/checkout.rb +6 -6
- data/app/commands/decidim/budgets/remove_line_item.rb +3 -2
- data/app/controllers/concerns/decidim/budgets/needs_current_order.rb +14 -2
- data/app/controllers/concerns/decidim/budgets/orderable.rb +3 -7
- 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 +7 -7
- 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 +9 -5
- data/app/controllers/decidim/budgets/orders_controller.rb +20 -6
- data/app/controllers/decidim/budgets/projects_controller.rb +19 -18
- data/app/forms/decidim/budgets/admin/budget_form.rb +39 -0
- data/app/forms/decidim/budgets/admin/project_form.rb +14 -10
- 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 +0 -4
- data/app/mailers/decidim/budgets/order_summary_mailer.rb +5 -3
- 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 +22 -19
- data/app/models/decidim/budgets/project.rb +34 -5
- 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 +12 -4
- 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/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 +1 -0
- data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +3 -3
- data/app/views/decidim/budgets/projects/_budget_summary.html.erb +19 -6
- data/app/views/decidim/budgets/projects/_filters.html.erb +6 -2
- data/app/views/decidim/budgets/projects/_linked_projects.html.erb +1 -1
- data/app/views/decidim/budgets/projects/_order_progress.html.erb +10 -6
- data/app/views/decidim/budgets/projects/_order_selected_projects.html.erb +3 -3
- data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +36 -7
- data/app/views/decidim/budgets/projects/index.html.erb +12 -4
- data/app/views/decidim/budgets/projects/show.html.erb +17 -10
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +2 -11
- data/config/locales/bg.yml +6 -0
- data/config/locales/ca.yml +102 -10
- data/config/locales/cs.yml +105 -13
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +90 -9
- data/config/locales/el.yml +3 -9
- data/config/locales/en.yml +101 -9
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +101 -9
- data/config/locales/es-PY.yml +101 -9
- data/config/locales/es.yml +102 -10
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +3 -8
- data/config/locales/fi-plain.yml +102 -10
- data/config/locales/fi.yml +103 -11
- data/config/locales/fr-CA.yml +100 -9
- data/config/locales/fr.yml +100 -9
- data/config/locales/gl.yml +2 -7
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +2 -7
- data/config/locales/id-ID.yml +2 -6
- data/config/locales/is-IS.yml +0 -6
- data/config/locales/is.yml +114 -0
- data/config/locales/it.yml +71 -9
- data/config/locales/ja-JP.yml +1 -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.yml +1 -0
- data/config/locales/{lv-LV.yml → lv.yml} +2 -10
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +88 -10
- data/config/locales/no.yml +22 -9
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +113 -22
- data/config/locales/pt-BR.yml +2 -7
- data/config/locales/pt.yml +3 -9
- data/config/locales/ro-RO.yml +3 -10
- data/config/locales/ru.yml +2 -9
- data/config/locales/sk.yml +2 -11
- data/config/locales/sl.yml +0 -4
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +0 -2
- data/config/locales/sv.yml +80 -9
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +2 -7
- data/config/locales/uk.yml +2 -9
- 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 +10 -5
- data/lib/decidim/budgets/component.rb +83 -38
- data/lib/decidim/budgets/engine.rb +8 -6
- data/lib/decidim/budgets/test/factories.rb +42 -13
- 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 +84 -17
- data/app/cells/decidim/budgets/project_list_item/project_data_number.erb +0 -3
- data/app/cells/decidim/budgets/project_list_item/project_data_votes.erb +0 -7
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Budgets
|
5
|
+
BudgetType = GraphQL::ObjectType.define do
|
6
|
+
interfaces [
|
7
|
+
-> { Decidim::Core::ScopableInterface },
|
8
|
+
-> { Decidim::Core::TraceableInterface }
|
9
|
+
]
|
10
|
+
|
11
|
+
name "Budget"
|
12
|
+
description "A budget"
|
13
|
+
|
14
|
+
field :id, !types.ID, "The internal ID of this budget"
|
15
|
+
field :title, !Decidim::Core::TranslatedFieldType, "The title for this budget"
|
16
|
+
field :description, !Decidim::Core::TranslatedFieldType, "The description for this budget"
|
17
|
+
field :total_budget, !types.Int, "The total budget"
|
18
|
+
field :createdAt, Decidim::Core::DateTimeType, "When this budget was created", property: :created_at
|
19
|
+
field :updatedAt, Decidim::Core::DateTimeType, "When this budget was updated", property: :updated_at
|
20
|
+
|
21
|
+
field :projects, !types[Decidim::Budgets::ProjectType], "The projects for this budget"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -8,24 +8,24 @@ module Decidim
|
|
8
8
|
name "Budgets"
|
9
9
|
description "A budget component of a participatory space."
|
10
10
|
|
11
|
-
connection :
|
11
|
+
connection :budgets, BudgetType.connection_type do
|
12
12
|
resolve ->(component, _args, _ctx) {
|
13
|
-
|
13
|
+
BudgetsTypeHelper.base_scope(component).includes(:component)
|
14
14
|
}
|
15
15
|
end
|
16
16
|
|
17
|
-
field(:
|
17
|
+
field(:budget, BudgetType) do
|
18
18
|
argument :id, !types.ID
|
19
19
|
|
20
20
|
resolve ->(component, args, _ctx) {
|
21
|
-
|
21
|
+
BudgetsTypeHelper.base_scope(component).find_by(id: args[:id])
|
22
22
|
}
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
module
|
26
|
+
module BudgetsTypeHelper
|
27
27
|
def self.base_scope(component)
|
28
|
-
|
28
|
+
Budget.where(component: component)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -16,7 +16,8 @@ module Decidim
|
|
16
16
|
field :id, !types.ID, "The internal ID for this project"
|
17
17
|
field :title, Decidim::Core::TranslatedFieldType, "The title for this project"
|
18
18
|
field :description, Decidim::Core::TranslatedFieldType, "The description for this project"
|
19
|
-
field :
|
19
|
+
field :budget_amount, types.Int, "The budget amount for this project"
|
20
|
+
field :selected, types.Boolean, "Whether this proposal is selected or not", property: :selected?
|
20
21
|
field :createdAt, Decidim::Core::DateTimeType, "When this project was created", property: :created_at
|
21
22
|
field :updatedAt, Decidim::Core::DateTimeType, "When this project was updated", property: :updated_at
|
22
23
|
field :reference, types.String, "The reference for this project"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title"><%= title %></h2>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="card-section">
|
7
|
+
<div class="row column">
|
8
|
+
<%= form.translated :text_field, :title, autofocus: true %>
|
9
|
+
|
10
|
+
<%= form.number_field :weight %>
|
11
|
+
|
12
|
+
<%= form.translated :editor, :description %>
|
13
|
+
|
14
|
+
<%= form.number_field :total_budget %>
|
15
|
+
|
16
|
+
<% if current_component.has_subscopes? %>
|
17
|
+
<div class="row column">
|
18
|
+
<%= scopes_picker_field form, :decidim_scope_id, root: current_component.scope %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
|
6
|
+
<%= link_to t("actions.new", scope: "decidim.budgets", name: t("models.budget.name", scope: "decidim.budgets.admin")), new_budget_path, class: "button tiny button--title" if allowed_to? :create, :budget %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="card-section">
|
11
|
+
<div class="table-scroll">
|
12
|
+
<table class="table-list">
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<th><%= t("models.budget.fields.name", scope: "decidim.budgets") %></th>
|
16
|
+
<th><%= t("models.budget.fields.total_budget", scope: "decidim.budgets") %></th>
|
17
|
+
<th><%= t("models.budget.fields.projects_count", scope: "decidim.budgets") %></th>
|
18
|
+
<%= th_resource_scope_label %>
|
19
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
|
20
|
+
</tr>
|
21
|
+
</thead>
|
22
|
+
<tbody>
|
23
|
+
<% budgets.each do |budget| %>
|
24
|
+
<tr data-id="<%= budget.id %>">
|
25
|
+
<td>
|
26
|
+
<%= link_to translated_attribute(budget.title), resource_locator(budget).path %>
|
27
|
+
</td>
|
28
|
+
<td>
|
29
|
+
<%= number_to_currency budget.total_budget, unit: Decidim.currency_unit, precision: 0 %>
|
30
|
+
</td>
|
31
|
+
<td>
|
32
|
+
<%= link_to budget.projects.count, budget_projects_path(budget) %>
|
33
|
+
</td>
|
34
|
+
<%= td_resource_scope_for(budget.scope) %>
|
35
|
+
<td class="table-list__actions">
|
36
|
+
<%= icon_link_to "eye", resource_locator(budget).path, t("actions.preview", scope: "decidim.budgets"), class: "action-icon--preview", target: :blank %>
|
37
|
+
|
38
|
+
<%= icon_link_to "list", budget_projects_path(budget), t("actions.edit_projects", scope: "decidim.budgets"), class: "action-icon--edit-projects" %>
|
39
|
+
|
40
|
+
<% if allowed_to? :update, :budget, budget: budget %>
|
41
|
+
<%= icon_link_to "pencil", edit_budget_path(budget), t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
|
42
|
+
<% else %>
|
43
|
+
<%= icon "pencil", class: "action-icon action-icon--disabled", role: "img" %>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<% if allowed_to? :delete, :budget, budget: budget %>
|
47
|
+
<%= icon_link_to "circle-x", budget_path(budget), t("actions.destroy", scope: "decidim.budgets"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.budgets") } %>
|
48
|
+
<% else %>
|
49
|
+
<%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
|
50
|
+
<% end %>
|
51
|
+
</td>
|
52
|
+
</tr>
|
53
|
+
<% end %>
|
54
|
+
</tbody>
|
55
|
+
</table>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
</div>
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<div class="card">
|
2
2
|
<div class="card-divider">
|
3
|
-
<h2 class="card-title"
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= title.html_safe %>
|
5
|
+
</h2>
|
4
6
|
</div>
|
5
7
|
|
6
8
|
<div class="card-section">
|
@@ -13,12 +15,12 @@
|
|
13
15
|
</div>
|
14
16
|
|
15
17
|
<div class="row column">
|
16
|
-
<%= form.number_field :
|
18
|
+
<%= form.number_field :budget_amount %>
|
17
19
|
</div>
|
18
20
|
|
19
|
-
<% if
|
21
|
+
<% if current_component.has_subscopes? %>
|
20
22
|
<div class="row column">
|
21
|
-
<%= scopes_picker_field form, :decidim_scope_id %>
|
23
|
+
<%= scopes_picker_field form, :decidim_scope_id, root: budget.scope %>
|
22
24
|
</div>
|
23
25
|
<% end %>
|
24
26
|
|
@@ -31,5 +33,11 @@
|
|
31
33
|
</div>
|
32
34
|
|
33
35
|
<%= render partial: "decidim/admin/shared/gallery", locals: { form: form } %>
|
36
|
+
|
37
|
+
<% if form.object.persisted? %>
|
38
|
+
<div class="row column">
|
39
|
+
<%= form.check_box :selected %>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
34
42
|
</div>
|
35
43
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%= decidim_form_for(@form, html: { class: "form edit_project" }) do |f| %>
|
2
|
-
<%= render partial: "form", object: f, locals: { title: t(".title") } %>
|
1
|
+
<%= decidim_form_for([budget, @form], html: { class: "form edit_project" }) do |f| %>
|
2
|
+
<%= render partial: "form", object: f, locals: { title: "#{translated_attribute(budget.title)} > #{t(".title")}" } %>
|
3
3
|
|
4
4
|
<div class="button--double form-general-submit">
|
5
5
|
<%= f.submit t(".update") %>
|
@@ -1,9 +1,10 @@
|
|
1
1
|
<div class="card">
|
2
2
|
<div class="card-divider">
|
3
3
|
<h2 class="card-title">
|
4
|
+
<%= link_to translated_attribute(budget.title), budgets_path %> >
|
4
5
|
<%= t(".title") %>
|
5
|
-
<%= link_to t("actions.new", scope: "decidim.budgets"),
|
6
|
-
<%= link_to t("actions.import", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")),
|
6
|
+
<%= 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 %>
|
7
|
+
<%= 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 %>
|
7
8
|
</h2>
|
8
9
|
</div>
|
9
10
|
|
@@ -13,7 +14,9 @@
|
|
13
14
|
<thead>
|
14
15
|
<tr>
|
15
16
|
<th><%= t("models.project.fields.title", scope: "decidim.budgets") %></th>
|
16
|
-
<th
|
17
|
+
<th><%= t("index.confirmed_orders_count") %></th>
|
18
|
+
<th><%= t(".selected") %></th>
|
19
|
+
<%= th_resource_scope_label %>
|
17
20
|
<th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
|
18
21
|
</tr>
|
19
22
|
</thead>
|
@@ -23,14 +26,22 @@
|
|
23
26
|
<td>
|
24
27
|
<%= translated_attribute(project.title) %><br>
|
25
28
|
</td>
|
26
|
-
<td
|
29
|
+
<td>
|
27
30
|
<%= project.confirmed_orders_count %>
|
28
31
|
</td>
|
32
|
+
<td>
|
33
|
+
<% if project.selected? %>
|
34
|
+
<%= content_tag :strong, t(".selected"), class: "text-success" %>
|
35
|
+
<% else %>
|
36
|
+
<%= content_tag :span, "×", class: "text-muted" %>
|
37
|
+
<% end %>
|
38
|
+
</td>
|
39
|
+
<%= td_resource_scope_for(project.scope) %>
|
29
40
|
<td class="table-list__actions">
|
30
|
-
<%= icon_link_to "eye", resource_locator(project).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
|
41
|
+
<%= icon_link_to "eye", resource_locator([budget, project]).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
|
31
42
|
|
32
43
|
<% if allowed_to? :update, :project, project: project %>
|
33
|
-
<%= icon_link_to "pencil",
|
44
|
+
<%= icon_link_to "pencil", resource_locator([budget, project]).edit, t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
|
34
45
|
<% end %>
|
35
46
|
|
36
47
|
<% if allowed_to? :update, :project, project: project %>
|
@@ -44,7 +55,9 @@
|
|
44
55
|
<%= resource_permissions_link(project) %>
|
45
56
|
|
46
57
|
<% if allowed_to? :destroy, :project, project: project %>
|
47
|
-
<%= icon_link_to "circle-x",
|
58
|
+
<%= 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") } %>
|
59
|
+
<% else %>
|
60
|
+
<%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
|
48
61
|
<% end %>
|
49
62
|
</td>
|
50
63
|
</tr>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<%= decidim_form_for(@form, html: { class: "form new_project" }) do |f| %>
|
2
|
-
<%= render partial: "form", object: f, locals: { title: t(".title") } %>
|
1
|
+
<%= decidim_form_for([budget, @form], html: { class: "form new_project" }) do |f| %>
|
2
|
+
<%= render partial: "form", object: f, locals: { title: "#{translated_attribute(budget.title)} > #{t(".title")}" } %>
|
3
3
|
|
4
4
|
<div class="button--double form-general-submit">
|
5
5
|
<%= f.submit t(".create") %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= decidim_form_for(@form, url:
|
1
|
+
<%= decidim_form_for(@form, url: budget_proposals_import_path(budget), html: { class: "form import_proposals" }) do |f| %>
|
2
2
|
<% if @form.origin_components.any? %>
|
3
3
|
<div class="card">
|
4
4
|
<div class="card-divider">
|
@@ -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,13 +1,24 @@
|
|
1
|
-
<div class="card budget-summary" data-progress-reference data-safe-url="<%=
|
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"
|
15
|
+
<h3 class="heading3">
|
16
|
+
<% if current_workflow.single? %>
|
17
|
+
<%= t(".title") %>
|
18
|
+
<% else %>
|
19
|
+
<%= translated_attribute(budget.title) %>
|
20
|
+
<% end %>
|
21
|
+
</h3>
|
11
22
|
<p>
|
12
23
|
<% if current_order.minimum_projects_rule? %>
|
13
24
|
<%= t(".description_minimum_projects_rule", minimum_number: current_order.minimum_projects) %>
|
@@ -18,10 +29,10 @@
|
|
18
29
|
<% end %>
|
19
30
|
<% end %>
|
20
31
|
|
21
|
-
<div class="budget-summary__total" data-total-budget="<%=
|
32
|
+
<div class="budget-summary__total" data-total-budget="<%= budget.total_budget %>">
|
22
33
|
<span class="mini-title"><%= t("total_budget") %>
|
23
34
|
<strong class="mini-title__strong mini-title__strong--highlight">
|
24
|
-
<%= budget_to_currency(
|
35
|
+
<%= budget_to_currency(budget.total_budget) %>
|
25
36
|
</strong>
|
26
37
|
</span>
|
27
38
|
</div>
|
@@ -34,6 +45,8 @@
|
|
34
45
|
<%= render partial: "order_total_budget" %>
|
35
46
|
</span>
|
36
47
|
</div>
|
48
|
+
|
49
|
+
<%= cell("decidim/budgets/budget_information_modal", budget) %>
|
37
50
|
</div>
|
38
51
|
|
39
52
|
<%= render partial: "order_selected_projects" %>
|
@@ -14,8 +14,12 @@
|
|
14
14
|
</div>
|
15
15
|
</div>
|
16
16
|
|
17
|
-
<% if
|
18
|
-
<%= 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" %>
|
19
23
|
<% end %>
|
20
24
|
|
21
25
|
<% if current_participatory_space.categories.any? %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% resources.each do |project| %>
|
3
3
|
<div class="card--list__item">
|
4
4
|
<%= icon "actions", class: "card--list__icon", role: "img", "aria-hidden": true, remove_icon_class: true %>
|
5
|
-
<%= link_to resource_locator(project).path, class: "card--list__text card__link card__link--block" do %>
|
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,27 +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
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: <%=
|
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
|
-
<button class="button small button--sc" data-toggle="budget-confirm" <%= budget_confirm_disabled_attr
|
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>
|
12
14
|
<% end %>
|
13
15
|
</div>
|
14
16
|
|
15
17
|
<div class="progressbox-fixed-wrapper" data-progressbox-fixed>
|
16
18
|
<div class="budget-summary__progressbox budget-summary__progressbox--fixed">
|
17
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">
|
18
|
-
<div class="progress-meter progress-meter--minimum" style="width: <%=
|
20
|
+
<div class="progress-meter progress-meter--minimum" style="width: <%= current_order_budget_percent_minimum %>%"></div>
|
19
21
|
<div class="progress-meter budget-progress__meter" style="width: <%= current_order_budget_percent %>%">
|
20
22
|
<span class="progress-meter-text progress-meter-text--right"><%= current_order_budget_percent %>%</span>
|
21
23
|
</div>
|
22
24
|
</div>
|
23
|
-
<%
|
24
|
-
<button class="button small button--sc" data-toggle="budget-confirm" <%= budget_confirm_disabled_attr
|
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>
|
25
29
|
<% end %>
|
26
30
|
</div>
|
27
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 %>
|