decidim-budgets 0.27.9 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/stylesheets/decidim/budgets/budget/_budget-vote-button.scss +5 -5
- data/app/cells/decidim/budgets/base_cell.rb +1 -1
- data/app/cells/decidim/budgets/budget_cell.rb +6 -1
- data/app/cells/decidim/budgets/budget_information_modal/show.erb +14 -26
- data/app/cells/decidim/budgets/budget_list_item/projects_count.erb +6 -0
- data/app/cells/decidim/budgets/budget_list_item/show.erb +35 -30
- data/app/cells/decidim/budgets/budget_list_item/vote_action.erb +13 -0
- data/app/cells/decidim/budgets/budget_list_item_cell.rb +24 -1
- data/app/cells/decidim/budgets/budget_metadata_cell.rb +29 -0
- data/app/cells/decidim/budgets/budget_s_cell.rb +15 -0
- data/app/cells/decidim/budgets/budgets_header/show.erb +2 -6
- data/app/cells/decidim/budgets/budgets_list/card_list.erb +8 -13
- data/app/cells/decidim/budgets/budgets_list/main_list.erb +5 -0
- data/app/cells/decidim/budgets/budgets_list/show.erb +12 -16
- data/app/cells/decidim/budgets/budgets_list/voted.erb +8 -44
- data/app/cells/decidim/budgets/budgets_list_cell.rb +34 -0
- data/app/cells/decidim/budgets/limit_announcement/show.erb +3 -0
- data/app/cells/decidim/budgets/limit_announcement_cell.rb +2 -2
- data/app/cells/decidim/budgets/order_activity_cell.rb +1 -4
- data/app/cells/decidim/budgets/project_cell.rb +6 -1
- data/app/cells/decidim/budgets/project_l/extra_data.erb +6 -0
- data/app/cells/decidim/budgets/project_l/metadata.erb +4 -0
- data/app/cells/decidim/budgets/project_l_cell.rb +38 -0
- data/app/cells/decidim/budgets/project_metadata_cell.rb +78 -0
- data/app/cells/decidim/budgets/project_s_cell.rb +21 -0
- data/app/cells/decidim/budgets/project_tags/show.erb +1 -0
- data/app/cells/decidim/budgets/project_vote_button/show.erb +21 -15
- data/app/cells/decidim/budgets/project_vote_button_cell.rb +69 -1
- data/app/cells/decidim/budgets/project_voted_hint_cell.rb +1 -1
- data/app/cells/decidim/budgets/project_votes_count_cell.rb +9 -8
- data/app/commands/decidim/budgets/admin/create_project.rb +0 -1
- data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_project.rb +1 -2
- data/app/commands/decidim/budgets/admin/update_project_scope.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_project_selection.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_projects_budget.rb +57 -0
- data/app/controllers/concerns/decidim/budgets/admin/filterable.rb +1 -1
- data/app/controllers/concerns/decidim/budgets/needs_current_order.rb +2 -2
- data/app/controllers/decidim/budgets/admin/budgets_controller.rb +5 -5
- data/app/controllers/decidim/budgets/admin/projects_controller.rb +52 -10
- data/app/controllers/decidim/budgets/admin/proposals_imports_controller.rb +1 -1
- data/app/controllers/decidim/budgets/application_controller.rb +0 -4
- data/app/controllers/decidim/budgets/budgets_controller.rb +9 -0
- data/app/controllers/decidim/budgets/line_items_controller.rb +10 -16
- data/app/controllers/decidim/budgets/orders_controller.rb +7 -2
- data/app/controllers/decidim/budgets/projects_controller.rb +51 -4
- data/app/forms/decidim/budgets/admin/project_form.rb +1 -1
- data/app/helpers/decidim/budgets/application_helper.rb +4 -0
- data/app/helpers/decidim/budgets/projects_helper.rb +89 -33
- data/app/jobs/decidim/budgets/send_vote_reminder_job.rb +1 -1
- data/app/mailers/decidim/budgets/order_summary_mailer.rb +1 -1
- data/app/mailers/decidim/budgets/vote_reminder_mailer.rb +1 -1
- data/app/models/decidim/budgets/budget.rb +1 -0
- data/app/models/decidim/budgets/project.rb +17 -7
- data/app/packs/entrypoints/decidim_budgets.js +2 -0
- data/app/packs/src/decidim/budgets/exit_handler.js +11 -8
- data/app/packs/src/decidim/budgets/progressFixed.js +25 -11
- data/app/packs/src/decidim/budgets/projects.js +15 -10
- data/app/packs/stylesheets/budgets.scss +273 -0
- data/app/presenters/decidim/budgets/admin_log/budget_presenter.rb +2 -2
- data/app/presenters/decidim/budgets/admin_log/project_presenter.rb +2 -2
- data/app/services/decidim/budgets/order_reminder_generator.rb +4 -4
- data/app/views/decidim/budgets/admin/budgets/_form.html.erb +17 -12
- data/app/views/decidim/budgets/admin/budgets/edit.html.erb +16 -6
- data/app/views/decidim/budgets/admin/budgets/index.html.erb +58 -64
- data/app/views/decidim/budgets/admin/budgets/new.html.erb +16 -6
- data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +19 -10
- data/app/views/decidim/budgets/admin/projects/_form.html.erb +31 -35
- data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +15 -13
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_budget-change.html.erb +22 -0
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +3 -3
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +8 -2
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +3 -3
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +5 -8
- data/app/views/decidim/budgets/admin/projects/edit.html.erb +16 -6
- data/app/views/decidim/budgets/admin/projects/index.html.erb +26 -31
- data/app/views/decidim/budgets/admin/projects/new.html.erb +16 -6
- data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +8 -4
- data/app/views/decidim/budgets/admin/proposals_imports/new.html.erb +40 -28
- data/app/views/decidim/budgets/budgets/index.html.erb +21 -3
- data/app/views/decidim/budgets/budgets/index.js.erb +6 -0
- data/app/views/decidim/budgets/line_items/update_budget.js.erb +21 -11
- data/app/views/decidim/budgets/projects/_addition_selector.html.erb +16 -0
- data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +42 -31
- data/app/views/decidim/budgets/projects/_budget_excess.html.erb +12 -12
- data/app/views/decidim/budgets/projects/_budget_summary.html.erb +2 -75
- data/app/views/decidim/budgets/projects/_exit_modal.html.erb +15 -18
- data/app/views/decidim/budgets/projects/_linked_projects.html.erb +3 -12
- data/app/views/decidim/budgets/projects/_order.html.erb +1 -0
- data/app/views/decidim/budgets/projects/_order_progress_progressbar_marks_right.html.erb +10 -0
- data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +113 -0
- data/app/views/decidim/budgets/projects/_order_total_budget.html.erb +6 -7
- data/app/views/decidim/budgets/projects/_project.html.erb +2 -1
- data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +11 -19
- data/app/views/decidim/budgets/projects/_projects.html.erb +8 -6
- data/app/views/decidim/budgets/projects/_projects_count.html.erb +5 -0
- data/app/views/decidim/budgets/projects/_projects_list.html.erb +3 -0
- data/app/views/decidim/budgets/projects/index.html.erb +58 -55
- data/app/views/decidim/budgets/projects/index.js.erb +5 -4
- data/app/views/decidim/budgets/projects/show.html.erb +78 -51
- data/config/assets.rb +0 -1
- data/config/locales/ar.yml +0 -50
- data/config/locales/bg.yml +0 -381
- data/config/locales/ca.yml +75 -84
- data/config/locales/cs.yml +73 -82
- data/config/locales/de.yml +76 -85
- data/config/locales/el.yml +34 -72
- data/config/locales/en.yml +79 -88
- data/config/locales/es-MX.yml +73 -82
- data/config/locales/es-PY.yml +73 -82
- data/config/locales/es.yml +75 -84
- data/config/locales/eu.yml +74 -86
- data/config/locales/fi-plain.yml +75 -84
- data/config/locales/fi.yml +79 -88
- data/config/locales/fr-CA.yml +74 -86
- data/config/locales/fr.yml +78 -90
- data/config/locales/ga-IE.yml +0 -12
- data/config/locales/gl.yml +0 -58
- data/config/locales/hu.yml +58 -81
- data/config/locales/id-ID.yml +0 -38
- data/config/locales/is-IS.yml +0 -22
- data/config/locales/it.yml +0 -84
- data/config/locales/ja.yml +69 -81
- data/config/locales/ko.yml +0 -54
- data/config/locales/lb.yml +0 -85
- data/config/locales/lt.yml +59 -82
- data/config/locales/lv.yml +0 -44
- data/config/locales/nl.yml +0 -96
- data/config/locales/no.yml +0 -84
- data/config/locales/pl.yml +0 -167
- data/config/locales/pt-BR.yml +9 -141
- data/config/locales/pt.yml +0 -85
- data/config/locales/ro-RO.yml +0 -95
- data/config/locales/ru.yml +0 -41
- data/config/locales/sk.yml +0 -44
- data/config/locales/sq-AL.yml +0 -52
- data/config/locales/sr-CS.yml +0 -4
- data/config/locales/sv.yml +42 -150
- data/config/locales/tr-TR.yml +2 -82
- data/config/locales/uk.yml +0 -41
- data/config/locales/zh-CN.yml +0 -65
- data/config/locales/zh-TW.yml +13 -59
- data/lib/decidim/budgets/admin_engine.rb +3 -2
- data/lib/decidim/budgets/component.rb +4 -90
- data/lib/decidim/budgets/engine.rb +30 -10
- data/lib/decidim/budgets/project_serializer.rb +3 -3
- data/lib/decidim/budgets/seeds.rb +69 -0
- data/lib/decidim/budgets/test/factories.rb +23 -37
- data/lib/decidim/budgets/version.rb +1 -1
- data/lib/decidim/budgets/workflows/base.rb +1 -1
- metadata +46 -42
- data/app/cells/decidim/budgets/budget_m/data.erb +0 -12
- data/app/cells/decidim/budgets/budget_m/footer.erb +0 -5
- data/app/cells/decidim/budgets/budget_m_cell.rb +0 -16
- data/app/cells/decidim/budgets/project_list_item/project_data.erb +0 -19
- data/app/cells/decidim/budgets/project_list_item/project_image.erb +0 -5
- data/app/cells/decidim/budgets/project_list_item/project_text.erb +0 -23
- data/app/cells/decidim/budgets/project_list_item/show.erb +0 -5
- data/app/cells/decidim/budgets/project_list_item_cell.rb +0 -70
- data/app/cells/decidim/budgets/project_m/data.erb +0 -12
- data/app/cells/decidim/budgets/project_m/footer.erb +0 -5
- data/app/cells/decidim/budgets/project_m_cell.rb +0 -22
- data/app/packs/stylesheets/decidim/budgets/_budgets.scss +0 -3
- data/app/packs/stylesheets/decidim/budgets/budget/_budget-list.scss +0 -198
- data/app/packs/stylesheets/decidim/budgets/budget/_budget-meter.scss +0 -83
- data/app/packs/stylesheets/decidim/budgets/budget/_progress.scss +0 -19
- data/app/views/decidim/budgets/admin/projects/proposals_picker.html.erb +0 -1
- data/app/views/decidim/budgets/projects/_filters.html.erb +0 -30
- data/app/views/decidim/budgets/projects/_filters_small_view.html.erb +0 -18
- data/app/views/decidim/budgets/projects/_order_progress.html.erb +0 -32
- data/app/views/decidim/budgets/projects/_order_selected_projects.html.erb +0 -27
- data/config/locales/he-IL.yml +0 -1
- data/decidim-budgets.gemspec +0 -34
- data/lib/decidim/budgets/seeds/city.jpeg +0 -0
@@ -1,51 +1,47 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<div class="card-section">
|
9
|
-
<div class="row column">
|
10
|
-
<%= form.translated :text_field, :title, autofocus: true %>
|
11
|
-
</div>
|
12
|
-
|
13
|
-
<div class="row column">
|
14
|
-
<%= form.translated :editor, :description %>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<div class="row column">
|
18
|
-
<%= form.number_field :budget_amount %>
|
19
|
-
</div>
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card pt-4">
|
3
|
+
<div class="card-section">
|
4
|
+
<div class="row column">
|
5
|
+
<%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
|
6
|
+
</div>
|
20
7
|
|
21
|
-
<% if @form.geocoding_enabled? %>
|
22
8
|
<div class="row column">
|
23
|
-
<%= form.
|
9
|
+
<%= form.translated :editor, :description, aria: { label: :description } %>
|
24
10
|
</div>
|
25
|
-
<% end %>
|
26
11
|
|
27
|
-
<% if current_component.has_subscopes? %>
|
28
12
|
<div class="row column">
|
29
|
-
<%=
|
13
|
+
<%= form.number_field :budget_amount %>
|
30
14
|
</div>
|
31
|
-
<% end %>
|
32
15
|
|
33
|
-
|
34
|
-
|
35
|
-
|
16
|
+
<% if @form.geocoding_enabled? %>
|
17
|
+
<div class="row column">
|
18
|
+
<%= form.geocoding_field :address %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<% if current_component.has_subscopes? %>
|
23
|
+
<div class="row column">
|
24
|
+
<%= scopes_select_field form, :decidim_scope_id, root: budget.scope %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
36
27
|
|
37
|
-
<% if Decidim::Budgets.enable_proposal_linking %>
|
38
28
|
<div class="row column">
|
39
|
-
<%=
|
29
|
+
<%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: true, disable_parents: false %>
|
40
30
|
</div>
|
41
|
-
<% end %>
|
42
31
|
|
43
|
-
|
44
|
-
|
45
|
-
<% if form.object.persisted? %>
|
32
|
+
<% if Decidim::Budgets.enable_proposal_linking %>
|
46
33
|
<div class="row column">
|
47
|
-
<%= form
|
34
|
+
<%= render partial: "decidim/proposals/proposals/proposals_picker", locals: { form:, field: :proposals } %>
|
48
35
|
</div>
|
49
36
|
<% end %>
|
37
|
+
|
38
|
+
<%= render partial: "decidim/admin/shared/gallery", locals: { form: } %>
|
39
|
+
|
40
|
+
<% if form.object.persisted? %>
|
41
|
+
<div class="row column">
|
42
|
+
<%= form.check_box :selected %>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
</div>
|
50
46
|
</div>
|
51
47
|
</div>
|
@@ -6,47 +6,49 @@
|
|
6
6
|
<%= project.id %><br>
|
7
7
|
</td>
|
8
8
|
<td>
|
9
|
-
|
9
|
+
<% if allowed_to? :update, :project, project: project %>
|
10
|
+
<%= link_to translated_attribute(project.title), resource_locator([budget, project]).edit %><br>
|
11
|
+
<% else %>
|
12
|
+
<%= translated_attribute(project.title) %><br>
|
13
|
+
<% end %>
|
10
14
|
</td>
|
11
15
|
<td>
|
12
16
|
<% if project.category %>
|
13
17
|
<%= translated_attribute project.category.name %>
|
14
18
|
<% end %>
|
15
19
|
</td>
|
16
|
-
|
17
|
-
<%= td_resource_scope_for(project.scope) %>
|
18
|
-
<% end %>
|
20
|
+
<%= td_resource_scope_for(project.scope) %>
|
19
21
|
<td>
|
20
22
|
<%= project.confirmed_orders_count %>
|
21
23
|
</td>
|
22
24
|
<td>
|
23
25
|
<% if project.selected? %>
|
24
|
-
<%= content_tag :strong, t("
|
26
|
+
<%= content_tag :strong, t("projects.index.selected", scope: "decidim.budgets.admin"), class: "text-success" %>
|
25
27
|
<% else %>
|
26
|
-
<%= content_tag :
|
28
|
+
<%= content_tag :span, "close-line", class: "text-muted" %>
|
27
29
|
<% end %>
|
28
30
|
</td>
|
29
31
|
<td class="table-list__actions">
|
30
|
-
<%= icon_link_to "eye", resource_locator([budget, project]).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
|
31
|
-
|
32
32
|
<% if allowed_to? :update, :project, project: project %>
|
33
|
-
<%= icon_link_to "pencil", resource_locator([budget, project]).edit, t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
|
33
|
+
<%= icon_link_to "pencil-line", resource_locator([budget, project]).edit, t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
|
34
34
|
<% end %>
|
35
35
|
|
36
36
|
<% if allowed_to? :update, :project, project: project %>
|
37
|
-
|
37
|
+
<%= icon_link_to "folder-line", project_attachment_collections_path(project), t("actions.attachment_collections", scope: "decidim.budgets"), class: "action-icon--attachment_collections" %>
|
38
38
|
<% end %>
|
39
39
|
|
40
40
|
<% if allowed_to? :update, :project, project: project %>
|
41
|
-
<%= icon_link_to "
|
41
|
+
<%= icon_link_to "attachment-line", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
|
42
42
|
<% end %>
|
43
43
|
|
44
|
+
<%= icon_link_to "eye-line", resource_locator([budget, project]).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview", data: { "external-link": false } %>
|
45
|
+
|
44
46
|
<%= resource_permissions_link(project) %>
|
45
47
|
|
46
48
|
<% if allowed_to? :destroy, :project, project: project %>
|
47
|
-
<%= icon_link_to "
|
49
|
+
<%= icon_link_to "delete-bin-line", 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") } %>
|
48
50
|
<% else %>
|
49
|
-
<%= icon "
|
51
|
+
<%= icon "delete-bin-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.destroy", scope: "decidim.budgets") %>
|
50
52
|
<% end %>
|
51
53
|
</td>
|
52
54
|
</tr>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div id="js-budget-change-projects-actions" class="hide js-bulk-action-form">
|
2
|
+
<%= form_tag(update_budget_budget_projects_path, method: :post, remote: true, id: "js-form-budget-change-projects", class: "form form-defaults flex items-center gap-x-2") do %>
|
3
|
+
|
4
|
+
<div class="checkboxes hide">
|
5
|
+
<% projects.each do |project| %>
|
6
|
+
<%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<%= budgets_select_tag(:reference_id) %>
|
11
|
+
|
12
|
+
<%= submit_tag(
|
13
|
+
t("decidim.budgets.admin.projects.index.update_budget_button"),
|
14
|
+
id: "js-submit-budget-change-projects",
|
15
|
+
class: "button button__sm button__secondary small button--simple float-left"
|
16
|
+
) %>
|
17
|
+
|
18
|
+
<button id="js-cancel-budget-change-projects" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button">
|
19
|
+
<%= t("decidim.budgets.admin.projects.index.cancel") %>
|
20
|
+
</button>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="js-change-selected-projects-actions" class="hide js-bulk-action-form">
|
2
|
-
<%= form_tag(update_selected_budget_projects_path, method: :post, remote: true, id: "js-form-change-selected-projects", class: "flex
|
2
|
+
<%= form_tag(update_selected_budget_projects_path, method: :post, remote: true, id: "js-form-change-selected-projects", class: "form form-defaults flex items-center gap-x-2") do %>
|
3
3
|
<div class="checkboxes hide">
|
4
4
|
<% projects.each do |project| %>
|
5
5
|
<%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
|
@@ -8,8 +8,8 @@
|
|
8
8
|
|
9
9
|
<%= bulk_selections %>
|
10
10
|
|
11
|
-
<%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-selected", class: "button small button--simple float-left") %>
|
11
|
+
<%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-selected", class: "button button__sm button__secondary small button--simple float-left") %>
|
12
12
|
|
13
|
-
<button id="js-cancel-edit-selected" class="button
|
13
|
+
<button id="js-cancel-edit-selected" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button"><%= t("decidim.budgets.admin.projects.index.cancel") %></button>
|
14
14
|
<% end %>
|
15
15
|
</div>
|
@@ -1,10 +1,11 @@
|
|
1
1
|
<div id="js-bulk-actions-wrapper">
|
2
2
|
<button
|
3
3
|
id="js-bulk-actions-button"
|
4
|
-
class="button
|
4
|
+
class="button button__sm button__secondary"
|
5
5
|
type="button"
|
6
6
|
data-toggle="js-bulk-actions-dropdown">
|
7
7
|
<%= t("decidim.budgets.admin.projects.index.actions") %>
|
8
|
+
<%= icon "arrow-down-s-line", class: "dropdown-filter-icon" %>
|
8
9
|
</button>
|
9
10
|
|
10
11
|
<div
|
@@ -15,7 +16,7 @@
|
|
15
16
|
data-dropdown="dropdown"
|
16
17
|
data-auto-focus="false"
|
17
18
|
data-events="resize">
|
18
|
-
<ul
|
19
|
+
<ul>
|
19
20
|
<li>
|
20
21
|
<button type="button" data-action="recategorize-projects">
|
21
22
|
<%= t("decidim.budgets.admin.projects.index.change_category") %>
|
@@ -31,6 +32,11 @@
|
|
31
32
|
<%= t("decidim.budgets.admin.projects.index.change_selected") %>
|
32
33
|
</button>
|
33
34
|
</li>
|
35
|
+
<li>
|
36
|
+
<button type="button" data-action="budget-change-projects">
|
37
|
+
<%= t("decidim.budgets.admin.projects.index.change_budget") %>
|
38
|
+
</button>
|
39
|
+
</li>
|
34
40
|
</ul>
|
35
41
|
</div>
|
36
42
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div id="js-recategorize-projects-actions" class="hide js-bulk-action-form">
|
2
|
-
<%= form_tag(update_category_budget_projects_path, method: :post, remote: true, id: "js-form-recategorize-projects", class: "flex
|
2
|
+
<%= form_tag(update_category_budget_projects_path, method: :post, remote: true, id: "js-form-recategorize-projects", class: "form form-defaults flex items-center gap-x-2") do %>
|
3
3
|
<div class="checkboxes hide">
|
4
4
|
<% projects.each do |project| %>
|
5
5
|
<%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
|
@@ -8,8 +8,8 @@
|
|
8
8
|
|
9
9
|
<%= bulk_categories_select current_component.categories %>
|
10
10
|
|
11
|
-
<%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-category", class: "button small button--simple float-left") %>
|
11
|
+
<%= submit_tag(t("decidim.budgets.admin.projects.index.update"), id: "js-submit-edit-category", class: "button button__sm button__secondary small button--simple float-left") %>
|
12
12
|
|
13
|
-
<button id="js-cancel-edit-category" class="button
|
13
|
+
<button id="js-cancel-edit-category" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button"><%= t("decidim.budgets.admin.projects.index.cancel") %></button>
|
14
14
|
<% end %>
|
15
15
|
</div>
|
@@ -1,24 +1,21 @@
|
|
1
1
|
<div id="js-scope-change-projects-actions" class="hide js-bulk-action-form">
|
2
|
-
<%= form_tag(update_scope_budget_projects_path, method: :post, remote: true, id: "js-form-scope-change-projects", class: "flex
|
2
|
+
<%= form_tag(update_scope_budget_projects_path, method: :post, remote: true, id: "js-form-scope-change-projects", class: "form form-defaults flex items-center gap-x-2") do %>
|
3
|
+
|
3
4
|
<div class="checkboxes hide">
|
4
5
|
<% projects.each do |project| %>
|
5
6
|
<%= check_box_tag "project_ids[]", project.id, false, class: "js-check-all-resources js-resource-id-#{project.id}" %>
|
6
7
|
<% end %>
|
7
8
|
</div>
|
8
9
|
|
9
|
-
<%=
|
10
|
-
:scope_id,
|
11
|
-
try(:current_participatory_space)&.scope,
|
12
|
-
field: t("models.project.fields.scope", scope: "decidim.budgets")
|
13
|
-
) %>
|
10
|
+
<%= scopes_select_tag(:scope_id) %>
|
14
11
|
|
15
12
|
<%= submit_tag(
|
16
13
|
t("decidim.budgets.admin.projects.index.update_scope_button"),
|
17
14
|
id: "js-submit-scope-change-projects",
|
18
|
-
class: "button small button--simple float-left"
|
15
|
+
class: "button button__sm button__secondary small button--simple float-left"
|
19
16
|
) %>
|
20
17
|
|
21
|
-
<button id="js-cancel-scope-change-projects" class="button
|
18
|
+
<button id="js-cancel-scope-change-projects" class="button button__sm button__secondary clear compact js-cancel-bulk-action" type="button">
|
22
19
|
<%= t("decidim.budgets.admin.projects.index.cancel") %>
|
23
20
|
</button>
|
24
21
|
<% end %>
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= "#{translated_attribute(budget.title)} #{t(".title")}" %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for([budget, @form], html: { class: "form-defaults form edit_project" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f %>
|
11
|
+
<div class="item__edit-sticky">
|
12
|
+
<div class="item__edit-sticky-container">
|
13
|
+
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
7
17
|
</div>
|
8
|
-
|
18
|
+
</div>
|
@@ -1,42 +1,37 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
<div class="card
|
3
|
-
<div class="
|
4
|
-
<h2 class="
|
2
|
+
<div class="card">
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h2 class="item_show__header-title">
|
5
5
|
<div>
|
6
|
-
<%= link_to
|
6
|
+
<%= link_to translated_attribute(budget.title), budgets_path %> >
|
7
7
|
<%= t(".title") %>
|
8
8
|
<span id="js-selected-resources-count" class="component-counter component-counter--inline" title="<%= t("decidim.budgets.admin.projects.index.selected") %>"></span>
|
9
9
|
</div>
|
10
10
|
<%= render partial: "bulk-actions" %>
|
11
11
|
</h2>
|
12
12
|
</div>
|
13
|
-
|
14
13
|
<%= admin_filter_selector(:projects) %>
|
15
|
-
<div class="
|
16
|
-
<
|
17
|
-
<
|
18
|
-
<
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
</tbody>
|
37
|
-
</table>
|
38
|
-
<%= paginate projects, theme: "decidim" %>
|
39
|
-
</div>
|
14
|
+
<div class="table-scroll">
|
15
|
+
<table class="table-list">
|
16
|
+
<thead>
|
17
|
+
<tr>
|
18
|
+
<th><%= check_box_tag "projects_bulk", "all", false, class: "js-check-all" %></th>
|
19
|
+
<th><%= sort_link(query, :id, t("models.project.fields.id", scope: "decidim.budgets"), default_order: :desc) %>
|
20
|
+
<th><%= sort_link(query, :title, t("models.project.fields.title", scope: "decidim.budgets")) %></th>
|
21
|
+
<th><%= sort_link(query, :category_name, t("models.project.fields.category", scope: "decidim.budgets") ) %></th>
|
22
|
+
<%= th_scope_sort_link %>
|
23
|
+
<th><%= sort_link(query, :confirmed_orders_count, t("index.confirmed_orders_count")) %></th>
|
24
|
+
<th><%= sort_link(query, :selected, t(".selected")) %></th>
|
25
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
|
26
|
+
</tr>
|
27
|
+
</thead>
|
28
|
+
<tbody>
|
29
|
+
<% projects.each do |project| %>
|
30
|
+
<%= render partial: "project-tr", locals: { project: } %>
|
31
|
+
<% end %>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
34
|
+
<%= decidim_paginate projects %>
|
40
35
|
</div>
|
41
36
|
<div class="card-divider">
|
42
37
|
<strong><%= t ".finished_orders" %>: </strong><span><%= finished_orders.count %></span>
|
@@ -45,4 +40,4 @@
|
|
45
40
|
</div>
|
46
41
|
</div>
|
47
42
|
|
48
|
-
<%=
|
43
|
+
<%= append_javascript_pack_tag "decidim_budgets_admin" %>
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<% add_decidim_page_title("#{translated_attribute(budget.title)} - #{t(".title")}") %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= "#{translated_attribute(budget.title)} > #{t(".title")}".html_safe %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for([budget, @form], html: { class: "form-defaults form new_project" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f %>
|
11
|
+
<div class="item__edit-sticky">
|
12
|
+
<div class="item__edit-sticky-container">
|
13
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
7
17
|
</div>
|
8
|
-
|
18
|
+
</div>
|
@@ -1,19 +1,23 @@
|
|
1
1
|
<% if flash.now[:error].present? %>
|
2
2
|
$("<%= form_selector %> <%= attribute_selector %>").addClass("is-invalid-input")
|
3
|
-
$("<%= escape_javascript(render partial: %q
|
3
|
+
$("<%= escape_javascript(render partial: %q(decidim/admin/shared/js-callout), locals: { css: %q(alert), text: flash.now[:error] }) %>").appendTo(".callout-wrapper");
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<% if flash.now[:alert].present? %>
|
7
7
|
$("<%= form_selector %> <%= attribute_selector %>").removeClass("is-invalid-input")
|
8
|
-
$("<%= escape_javascript(render partial: %q
|
8
|
+
$("<%= escape_javascript(render partial: %q(decidim/admin/shared/js-callout), locals: { css: %q(warning), text: flash.now[:alert] }) %>").appendTo(".callout-wrapper");
|
9
9
|
<% end %>
|
10
10
|
|
11
11
|
<% if flash.now[:notice].present? %>
|
12
|
-
$("<%= escape_javascript(render partial: %q
|
12
|
+
$("<%= escape_javascript(render partial: %q(decidim/admin/shared/js-callout), locals: { css: %q(success), text: flash.now[:notice] }) %>").appendTo(".callout-wrapper");
|
13
|
+
|
14
|
+
<% @moved_items&.each do |id| %>
|
15
|
+
$(".table-list [data-id='<%= id %>']").remove()
|
16
|
+
<% end %>
|
13
17
|
|
14
18
|
<% project_ids.each do |id| %>
|
15
19
|
$(".table-list [data-id='<%= id %>']")
|
16
|
-
.replaceWith("<%= escape_javascript(render partial: %q
|
20
|
+
.replaceWith("<%= escape_javascript(render partial: %q(project-tr), locals: { project: Decidim::Budgets::Project.find(id) }) %>");
|
17
21
|
<% end %>
|
18
22
|
|
19
23
|
$("<%= form_selector %> <%= attribute_selector %>").removeClass("is-invalid-input")
|
@@ -1,33 +1,45 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
<%= decidim_form_for(@form, url: budget_proposals_import_path(budget), html: { class: "form import_proposals" }) do |f| %>
|
3
|
-
<% if @form.origin_components.any? %>
|
4
|
-
<div class="card">
|
5
|
-
<div class="card-divider">
|
6
|
-
<h2 class="card-title"><%= t(".title") %></h2>
|
7
|
-
</div>
|
8
2
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h2 class="item_show__header-title">
|
5
|
+
<%= t(".title") %>
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="item__edit item__edit-1col">
|
10
|
+
<div class="item__edit-form">
|
11
|
+
<%= decidim_form_for(@form, url: budget_proposals_import_path(budget), html: { class: "form form-defaults import_proposals" }) do |f| %>
|
12
|
+
<% if @form.origin_components.any? %>
|
13
|
+
<div class="form__wrapper">
|
14
|
+
<div class="card">
|
15
|
+
<div class="card-divider"></div>
|
16
|
+
<div class="card-section">
|
17
|
+
<div class="row column">
|
18
|
+
<%= f.select :origin_component_id, @form.origin_components_collection, prompt: t(".select_component"), label: t(".origin_component_id") %>
|
19
|
+
</div>
|
20
|
+
<% if current_component.scopes_enabled? %>
|
21
|
+
<div class="row column">
|
22
|
+
<%= scopes_select_field f, :scope_id, root: budget.scope %>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
<div class="row column">
|
26
|
+
<%= f.number_field :default_budget, label: t(".default_budget") %>
|
27
|
+
</div>
|
28
|
+
<div class="row column">
|
29
|
+
<%= f.check_box :import_all_accepted_proposals, label: t(".import_all_accepted_proposals") %>
|
30
|
+
</div>
|
31
|
+
</div>
|
16
32
|
</div>
|
17
|
-
<% end %>
|
18
|
-
<div class="row column">
|
19
|
-
<%= f.number_field :default_budget, label: t(".default_budget") %>
|
20
|
-
</div>
|
21
|
-
<div class="row column">
|
22
|
-
<%= f.check_box :import_all_accepted_proposals, label: t(".import_all_accepted_proposals") %>
|
23
33
|
</div>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
34
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
35
|
+
<div class="item__edit-sticky">
|
36
|
+
<div class="item__edit-sticky-container">
|
37
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<% else %>
|
41
|
+
<p><%= t(".no_components") %></p>
|
42
|
+
<% end %>
|
43
|
+
<% end %>
|
44
|
+
</div>
|
45
|
+
</div>
|
@@ -1,5 +1,23 @@
|
|
1
|
-
|
1
|
+
<% add_decidim_page_title component_name %>
|
2
|
+
<%= append_javascript_pack_tag "decidim_budgets" %>
|
3
|
+
<%= append_stylesheet_pack_tag "decidim_budgets", media: "all" %>
|
2
4
|
|
3
|
-
|
5
|
+
<% content_for :aside do %>
|
6
|
+
<h1 class="title-decorator"><%= component_name %></h1>
|
7
|
+
<% end %>
|
4
8
|
|
5
|
-
<%=
|
9
|
+
<%= render layout: "layouts/decidim/shared/layout_two_col" do %>
|
10
|
+
<%= render partial: "decidim/shared/component_announcement" %>
|
11
|
+
|
12
|
+
<% if current_workflow.budgets.empty? %>
|
13
|
+
<%= cell("decidim/announcement", t("empty", scope: "decidim.budgets.budgets_list")) %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<section class="layout-main__section">
|
17
|
+
<%= cell("decidim/budgets/budgets_header", current_workflow) %>
|
18
|
+
</section>
|
19
|
+
|
20
|
+
<section class="layout-main__section layout-main__heading">
|
21
|
+
<%= cell("decidim/budgets/budgets_list", current_workflow) %>
|
22
|
+
</section>
|
23
|
+
<% end %>
|
@@ -1,24 +1,34 @@
|
|
1
|
-
var $
|
2
|
-
var $
|
3
|
-
var $orderProgress = $('#order-progress');
|
1
|
+
var $orderSelectedProjectsCount = $('#order-selected-projects-count');
|
2
|
+
var $orderProgress = document.querySelectorAll('[id^=order-progress] .budget-summary__content');
|
4
3
|
var $projectItem = $('#project-<%= project.id %>-item');
|
5
4
|
var $projectBudgetButton = $('#project-<%= project.id %>-budget-button');
|
6
5
|
var $budgetConfirm = $('#budget-confirm');
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
morphdom($budgetConfirm[0], '<%= j(render partial: "decidim/budgets/projects/budget_confirm").strip.html_safe %>')
|
7
|
+
$orderProgress.forEach((orderProgress) => {
|
8
|
+
var $orderTotalBudget = $(orderProgress).find("[id^=order-total-budget]");
|
9
|
+
$orderTotalBudget.html('<%= j(render partial: "decidim/budgets/projects/order_total_budget").strip.html_safe %>');
|
12
10
|
|
13
|
-
|
14
|
-
|
11
|
+
if(orderProgress.dataset.orderProgressResponsive) {
|
12
|
+
morphdom(orderProgress, '<%= j(render partial: "decidim/budgets/projects/order_progress_summary_content", locals: { include_heading: true, responsive: true }).strip.html_safe %>');
|
13
|
+
} else {
|
14
|
+
morphdom(orderProgress, '<%= j(render partial: "decidim/budgets/projects/order_progress_summary_content", locals: { include_heading: true, responsive: false }).strip.html_safe %>');
|
15
|
+
}
|
16
|
+
})
|
17
|
+
morphdom($budgetConfirm[0], '<%= j(render partial: "decidim/budgets/projects/budget_confirm").strip.html_safe %>')
|
18
|
+
if ($orderSelectedProjectsCount.length > 0) {
|
19
|
+
morphdom($orderSelectedProjectsCount[0], '<%= j(render partial: "decidim/budgets/projects/projects_count", locals: { count: current_order.projects.size }).strip.html_safe %>')
|
20
|
+
}
|
15
21
|
|
16
22
|
if ($projectItem.length > 0) {
|
17
|
-
|
23
|
+
<% if params[:action] == "destroy" && params[:show_only_added] == "true" %>
|
24
|
+
$projectItem[0].remove();
|
25
|
+
<% else %>
|
26
|
+
morphdom($projectItem[0], '<%= j(render partial: "decidim/budgets/projects/project", locals: { project: }).strip.html_safe %>');
|
27
|
+
<% end %>
|
18
28
|
}
|
19
29
|
|
20
30
|
if ($projectBudgetButton.length > 0) {
|
21
|
-
morphdom($projectBudgetButton[0], '<%= j(render partial: "decidim/budgets/projects/project_budget_button", locals: { project:
|
31
|
+
morphdom($projectBudgetButton[0], '<%= j(render partial: "decidim/budgets/projects/project_budget_button", locals: { project: }).strip.html_safe %>');
|
22
32
|
}
|
23
33
|
|
24
34
|
window.DecidimBudgets.checkProgressPosition();
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= filter_form_for filter, url_for, data: { filters: "", component: "accordion" } do |form| %>
|
2
|
+
<%= form.collection_radio_buttons(
|
3
|
+
:addition_type,
|
4
|
+
filter_addition_type_values(added_count: search.result.with_order(current_order).size),
|
5
|
+
:first,
|
6
|
+
:last
|
7
|
+
) do |builder|
|
8
|
+
builder.label(class: "button button__xs button__pill #{filter.addition_type == builder.value ? 'button__pill--active' : ''}") do %>
|
9
|
+
<span>
|
10
|
+
<%= builder.text[:text] %>
|
11
|
+
</span>
|
12
|
+
<%= render partial: "projects_count", locals: { count: builder.text[:count] } %>
|
13
|
+
<%= builder.radio_button(class: "!hidden") %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|