decidim-proposals 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/app/cells/decidim/proposals/collaborative_draft_cell.rb +1 -1
- data/app/cells/decidim/proposals/collaborative_draft_l_cell.rb +16 -0
- data/app/cells/decidim/proposals/collaborative_draft_link_to_proposal/show.erb +4 -12
- data/app/cells/decidim/proposals/collaborative_draft_link_to_proposal_cell.rb +0 -29
- data/app/cells/decidim/proposals/collaborative_draft_metadata_cell.rb +30 -0
- data/app/cells/decidim/proposals/content_blocks/highlighted_proposals_cell.rb +2 -8
- data/app/cells/decidim/proposals/cost_report/show.erb +5 -34
- data/app/cells/decidim/proposals/cost_report_cell.rb +0 -13
- data/app/cells/decidim/proposals/highlighted_proposals_for_component/show.erb +29 -17
- data/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb +34 -8
- data/app/cells/decidim/proposals/irreversible_action_modal/show.erb +9 -17
- data/app/cells/decidim/proposals/irreversible_action_modal_cell.rb +7 -9
- data/app/cells/decidim/proposals/participatory_text_proposal/buttons.erb +21 -31
- data/app/cells/decidim/proposals/participatory_text_proposal/show.erb +5 -9
- data/app/cells/decidim/proposals/participatory_text_proposal_cell.rb +0 -9
- data/app/cells/decidim/proposals/proposal_activity_cell.rb +1 -12
- data/app/cells/decidim/proposals/proposal_cell.rb +6 -1
- data/app/cells/decidim/proposals/proposal_l_cell.rb +47 -0
- data/app/cells/decidim/proposals/proposal_link_to_collaborative_draft_cell.rb +6 -4
- data/app/cells/decidim/proposals/proposal_link_to_rejected_emendation_cell.rb +9 -7
- data/app/cells/decidim/proposals/proposal_linked_resources/show.erb +3 -8
- data/app/cells/decidim/proposals/proposal_metadata_cell.rb +61 -0
- data/app/cells/decidim/proposals/proposal_s_cell.rb +21 -0
- data/app/cells/decidim/proposals/proposals_picker/show.erb +13 -13
- data/app/cells/decidim/proposals/proposals_picker_cell.rb +15 -38
- data/app/commands/decidim/proposals/accept_access_to_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/admin/answer_proposal.rb +1 -1
- data/app/commands/decidim/proposals/admin/assign_proposals_to_valuator.rb +3 -3
- data/app/commands/decidim/proposals/admin/create_proposal.rb +2 -2
- data/app/commands/decidim/proposals/admin/create_proposal_note.rb +4 -4
- data/app/commands/decidim/proposals/admin/discard_participatory_text.rb +1 -1
- data/app/commands/decidim/proposals/admin/import_participatory_text.rb +1 -1
- data/app/commands/decidim/proposals/admin/import_proposals.rb +2 -13
- data/app/commands/decidim/proposals/admin/merge_proposals.rb +1 -1
- data/app/commands/decidim/proposals/admin/notify_proposal_answer.rb +3 -3
- data/app/commands/decidim/proposals/admin/publish_answers.rb +1 -1
- data/app/commands/decidim/proposals/admin/publish_participatory_text.rb +2 -2
- data/app/commands/decidim/proposals/admin/split_proposals.rb +1 -1
- data/app/commands/decidim/proposals/admin/unassign_proposals_from_valuator.rb +2 -2
- data/app/commands/decidim/proposals/admin/update_participatory_text.rb +1 -1
- data/app/commands/decidim/proposals/admin/update_proposal.rb +5 -1
- data/app/commands/decidim/proposals/admin/update_proposal_scope.rb +1 -1
- data/app/commands/decidim/proposals/create_collaborative_draft.rb +13 -3
- data/app/commands/decidim/proposals/create_proposal.rb +14 -5
- data/app/commands/decidim/proposals/hashtags_methods.rb +1 -1
- data/app/commands/decidim/proposals/publish_proposal.rb +1 -1
- data/app/commands/decidim/proposals/reject_access_to_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/request_access_to_collaborative_draft.rb +1 -1
- data/app/commands/decidim/proposals/unvote_proposal.rb +2 -2
- data/app/commands/decidim/proposals/update_collaborative_draft.rb +12 -2
- data/app/commands/decidim/proposals/update_proposal.rb +16 -14
- data/app/commands/decidim/proposals/vote_proposal.rb +2 -2
- data/app/controllers/concerns/decidim/proposals/admin/filterable.rb +4 -13
- data/app/controllers/decidim/proposals/admin/proposal_answers_controller.rb +2 -2
- data/app/controllers/decidim/proposals/admin/proposal_notes_controller.rb +1 -1
- data/app/controllers/decidim/proposals/admin/proposals_controller.rb +2 -2
- data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +3 -9
- data/app/controllers/decidim/proposals/proposal_votes_controller.rb +3 -3
- data/app/controllers/decidim/proposals/proposals_controller.rb +42 -12
- data/app/events/decidim/proposals/accepted_proposal_event.rb +1 -1
- data/app/events/decidim/proposals/admin/proposal_note_created_event.rb +1 -1
- data/app/events/decidim/proposals/admin/update_proposal_category_event.rb +1 -1
- data/app/events/decidim/proposals/admin/update_proposal_scope_event.rb +1 -1
- data/app/events/decidim/proposals/collaborative_draft_access_accepted_event.rb +1 -1
- data/app/events/decidim/proposals/collaborative_draft_access_rejected_event.rb +1 -1
- data/app/events/decidim/proposals/collaborative_draft_access_request_event.rb +1 -1
- data/app/events/decidim/proposals/collaborative_draft_access_requested_event.rb +1 -1
- data/app/events/decidim/proposals/collaborative_draft_access_requester_accepted_event.rb +1 -1
- data/app/events/decidim/proposals/collaborative_draft_access_requester_rejected_event.rb +1 -1
- data/app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb +1 -1
- data/app/events/decidim/proposals/evaluating_proposal_event.rb +1 -1
- data/app/events/decidim/proposals/proposal_endorsed_event.rb +1 -1
- data/app/events/decidim/proposals/proposal_mentioned_event.rb +1 -1
- data/app/events/decidim/proposals/publish_proposal_event.rb +1 -1
- data/app/events/decidim/proposals/rejected_proposal_event.rb +1 -1
- data/app/forms/decidim/proposals/admin/import_participatory_text_form.rb +1 -1
- data/app/forms/decidim/proposals/admin/proposal_base_form.rb +2 -2
- data/app/forms/decidim/proposals/admin/proposal_form.rb +1 -1
- data/app/forms/decidim/proposals/admin/proposals_fork_form.rb +1 -1
- data/app/forms/decidim/proposals/admin/valuation_assignment_form.rb +1 -1
- data/app/forms/decidim/proposals/proposal_form.rb +9 -27
- data/app/helpers/decidim/proposals/admin/proposal_bulk_actions_helper.rb +1 -1
- data/app/helpers/decidim/proposals/admin/proposals_helper.rb +13 -13
- data/app/helpers/decidim/proposals/application_helper.rb +80 -28
- data/app/helpers/decidim/proposals/collaborative_draft_helper.rb +44 -4
- data/app/helpers/decidim/proposals/map_helper.rb +3 -4
- data/app/helpers/decidim/proposals/participatory_texts_helper.rb +1 -9
- data/app/helpers/decidim/proposals/proposal_cells_helper.rb +1 -1
- data/app/helpers/decidim/proposals/proposal_votes_helper.rb +2 -24
- data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +14 -81
- data/app/helpers/decidim/proposals/proposals_helper.rb +0 -12
- data/app/jobs/decidim/proposals/hide_all_created_by_author_job.rb +20 -0
- data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +1 -1
- data/app/jobs/decidim/proposals/settings_change_job.rb +2 -2
- data/app/models/decidim/proposals/collaborative_draft.rb +4 -16
- data/app/models/decidim/proposals/proposal.rb +33 -16
- data/app/models/decidim/proposals/proposal_vote.rb +3 -3
- data/app/models/decidim/proposals/valuation_assignment.rb +1 -2
- data/app/packs/documents/decidim/proposals/participatory_texts/participatory_text.md +9 -4
- data/app/packs/entrypoints/decidim_proposals.js +4 -0
- data/app/packs/entrypoints/decidim_proposals_admin.js +0 -1
- data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_accepted_proposals.svg +68 -1
- data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_proposal_votes.svg +34 -1
- data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_proposals.svg +64 -1
- data/app/packs/src/decidim/proposals/add_proposal.js +25 -39
- data/app/packs/src/decidim/proposals/admin/proposals.js +0 -7
- data/app/packs/src/decidim/proposals/choose_proposals.js +20 -0
- data/app/packs/stylesheets/decidim/proposals/proposals.scss +97 -0
- data/app/permissions/decidim/proposals/admin/permissions.rb +3 -3
- data/app/permissions/decidim/proposals/permissions.rb +1 -10
- data/app/presenters/decidim/proposals/admin_log/proposal_note_presenter.rb +2 -2
- data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +7 -3
- data/app/presenters/decidim/proposals/admin_log/valuation_assignment_presenter.rb +2 -2
- data/app/presenters/decidim/proposals/admin_log/value_types/proposal_title_body_presenter.rb +3 -1
- data/app/presenters/decidim/proposals/log/resource_presenter.rb +22 -0
- data/app/presenters/decidim/proposals/log/valuation_assignment_presenter.rb +1 -1
- data/app/presenters/decidim/proposals/proposal_presenter.rb +6 -2
- data/app/services/decidim/proposals/diff_renderer.rb +3 -3
- data/app/services/decidim/proposals/proposal_builder.rb +6 -6
- data/app/views/decidim/proposals/admin/participatory_texts/_article-preview.html.erb +2 -4
- data/app/views/decidim/proposals/admin/participatory_texts/_bulk-actions.html.erb +2 -2
- data/app/views/decidim/proposals/admin/participatory_texts/index.html.erb +58 -46
- data/app/views/decidim/proposals/admin/participatory_texts/new_import.html.erb +31 -33
- data/app/views/decidim/proposals/admin/proposal_answers/_form.html.erb +17 -11
- data/app/views/decidim/proposals/admin/proposal_notes/_form.html.erb +5 -6
- data/app/views/decidim/proposals/admin/proposal_notes/_proposal_notes.html.erb +28 -36
- data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +27 -30
- data/app/views/decidim/proposals/admin/proposals/_documents.html.erb +13 -0
- data/app/views/decidim/proposals/admin/proposals/_endorsers.html.erb +25 -0
- data/app/views/decidim/proposals/admin/proposals/_form.html.erb +70 -90
- data/app/views/decidim/proposals/admin/proposals/_meetings.html.erb +13 -0
- data/app/views/decidim/proposals/admin/proposals/_photos.html.erb +13 -0
- data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +31 -25
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_assign_to_valuator.html.erb +3 -3
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_dropdown.html.erb +3 -2
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_merge.html.erb +4 -4
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_publish_answers.html.erb +3 -3
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_recategorize.html.erb +3 -3
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_scope-change.html.erb +4 -8
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_split.html.erb +3 -3
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_unassign_from_valuator.html.erb +3 -3
- data/app/views/decidim/proposals/admin/proposals/edit.html.erb +17 -7
- data/app/views/decidim/proposals/admin/proposals/index.html.erb +50 -63
- data/app/views/decidim/proposals/admin/proposals/new.html.erb +16 -6
- data/app/views/decidim/proposals/admin/proposals/publish_answers.js.erb +2 -2
- data/app/views/decidim/proposals/admin/proposals/show.html.erb +204 -162
- data/app/views/decidim/proposals/admin/proposals/update_attribute.js.erb +5 -6
- data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +48 -34
- data/app/views/decidim/proposals/collaborative_drafts/_accept_request_access_form.html.erb +1 -1
- data/app/views/decidim/proposals/collaborative_drafts/_actions.html.erb +7 -0
- data/app/views/decidim/proposals/collaborative_drafts/_collaborative_draft_aside.html.erb +53 -0
- data/app/views/decidim/proposals/collaborative_drafts/_collaborative_drafts.html.erb +12 -13
- data/app/views/decidim/proposals/collaborative_drafts/_collaborator_requests.html.erb +8 -12
- data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +26 -54
- data/app/views/decidim/proposals/collaborative_drafts/_reject_request_access_form.html.erb +1 -3
- data/app/views/decidim/proposals/collaborative_drafts/_request_access_form.html.erb +1 -1
- data/app/views/decidim/proposals/collaborative_drafts/edit.html.erb +23 -25
- data/app/views/decidim/proposals/collaborative_drafts/index.html.erb +30 -22
- data/app/views/decidim/proposals/collaborative_drafts/index.js.erb +0 -5
- data/app/views/decidim/proposals/collaborative_drafts/new.html.erb +22 -18
- data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +39 -109
- data/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb +2 -2
- data/app/views/decidim/proposals/proposals/_actions.html.erb +13 -0
- data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +31 -70
- data/app/views/decidim/proposals/proposals/_linked_proposals.html.erb +3 -35
- data/app/views/decidim/proposals/proposals/_proposal_aside.html.erb +40 -0
- data/app/views/decidim/proposals/proposals/_proposals.html.erb +18 -39
- data/app/views/decidim/proposals/proposals/_proposals_picker.html.erb +5 -0
- data/app/views/decidim/proposals/proposals/_remaining_votes_count.html.erb +3 -3
- data/app/views/decidim/proposals/proposals/_vote_button.html.erb +16 -17
- data/app/views/decidim/proposals/proposals/_votes_count.html.erb +3 -6
- data/app/views/decidim/proposals/proposals/_voting_rules.html.erb +28 -41
- data/app/views/decidim/proposals/proposals/_wizard_header.html.erb +19 -25
- data/app/views/decidim/proposals/proposals/compare.html.erb +17 -16
- data/app/views/decidim/proposals/proposals/complete.html.erb +26 -21
- data/app/views/decidim/proposals/proposals/edit.html.erb +32 -27
- data/app/views/decidim/proposals/proposals/edit_draft.html.erb +21 -19
- data/app/views/decidim/proposals/proposals/index.html.erb +56 -47
- data/app/views/decidim/proposals/proposals/index.js.erb +0 -5
- data/app/views/decidim/proposals/proposals/new.html.erb +30 -35
- data/app/views/decidim/proposals/proposals/participatory_texts/_proposal_vote_button.html.erb +5 -5
- data/app/views/decidim/proposals/proposals/participatory_texts/_view_index.html.erb +15 -8
- data/app/views/decidim/proposals/proposals/participatory_texts/participatory_text.html.erb +32 -15
- data/app/views/decidim/proposals/proposals/preview.html.erb +37 -34
- data/app/views/decidim/proposals/proposals/show.html.erb +90 -108
- data/app/views/decidim/proposals/versions/show.html.erb +14 -6
- data/config/assets.rb +0 -1
- data/config/brakeman.ignore +31 -56
- data/config/locales/ar.yml +23 -158
- data/config/locales/bg.yml +1 -776
- data/config/locales/ca.yml +92 -150
- data/config/locales/cs.yml +75 -135
- data/config/locales/de.yml +83 -141
- data/config/locales/el.yml +58 -121
- data/config/locales/en.yml +76 -134
- data/config/locales/es-MX.yml +77 -135
- data/config/locales/es-PY.yml +76 -134
- data/config/locales/es.yml +84 -142
- data/config/locales/eu.yml +77 -135
- data/config/locales/fi-plain.yml +68 -126
- data/config/locales/fi.yml +76 -134
- data/config/locales/fr-CA.yml +73 -132
- data/config/locales/fr.yml +77 -136
- data/config/locales/ga-IE.yml +0 -45
- data/config/locales/gl.yml +12 -131
- data/config/locales/hu.yml +45 -149
- data/config/locales/id-ID.yml +9 -114
- data/config/locales/is-IS.yml +5 -60
- data/config/locales/it.yml +14 -146
- data/config/locales/ja.yml +78 -141
- data/config/locales/lb.yml +0 -5
- data/config/locales/lt.yml +65 -126
- data/config/locales/lv.yml +13 -144
- data/config/locales/nl.yml +16 -148
- data/config/locales/no.yml +11 -134
- data/config/locales/pl.yml +16 -239
- data/config/locales/pt-BR.yml +14 -199
- data/config/locales/pt.yml +11 -142
- data/config/locales/ro-RO.yml +12 -146
- data/config/locales/ru.yml +5 -70
- data/config/locales/sk.yml +19 -145
- data/config/locales/sr-CS.yml +0 -23
- data/config/locales/sv.yml +60 -195
- data/config/locales/tr-TR.yml +16 -150
- data/config/locales/uk.yml +5 -70
- data/config/locales/zh-CN.yml +9 -135
- data/config/locales/zh-TW.yml +35 -107
- data/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb +1 -1
- data/db/migrate/20230427105700_change_states_on_collaborative_drafts.rb +34 -0
- data/db/migrate/20230427105700_change_states_on_proposals.rb +34 -0
- data/lib/decidim/api/proposals_type.rb +2 -2
- data/lib/decidim/proposals/component.rb +11 -289
- data/lib/decidim/proposals/doc_to_markdown.rb +0 -4
- data/lib/decidim/proposals/engine.rb +43 -7
- data/lib/decidim/proposals/import/proposal_answer_creator.rb +1 -1
- data/lib/decidim/proposals/import/proposal_creator.rb +10 -10
- data/lib/decidim/proposals/markdown_to_proposals.rb +8 -2
- data/lib/decidim/proposals/proposal_serializer.rb +4 -56
- data/lib/decidim/proposals/seeds.rb +278 -0
- data/lib/decidim/proposals/test/factories.rb +106 -85
- data/lib/decidim/proposals/valuatable.rb +1 -2
- data/lib/decidim/proposals/version.rb +1 -1
- metadata +55 -66
- data/app/cells/decidim/proposals/collaborative_draft_m/footer.erb +0 -6
- data/app/cells/decidim/proposals/collaborative_draft_m/tags.erb +0 -1
- data/app/cells/decidim/proposals/collaborative_draft_m_cell.rb +0 -44
- data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/elements.erb +0 -5
- data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/heading.erb +0 -1
- data/app/cells/decidim/proposals/proposal_link_to_rejected_emendation/show.erb +0 -9
- data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -26
- data/app/cells/decidim/proposals/proposal_m/tags.erb +0 -1
- data/app/cells/decidim/proposals/proposal_m_cell.rb +0 -151
- data/app/cells/decidim/proposals/proposal_tags/show.erb +0 -33
- data/app/cells/decidim/proposals/proposal_tags_cell.rb +0 -35
- data/app/cells/decidim/proposals/proposals_picker/proposals.erb +0 -12
- data/app/controllers/concerns/decidim/proposals/admin/picker.rb +0 -21
- data/app/controllers/decidim/proposals/widgets_controller.rb +0 -29
- data/app/helpers/decidim/proposals/admin/filterable_helper.rb +0 -17
- data/app/helpers/decidim/proposals/admin/proposals_picker_helper.rb +0 -30
- data/app/packs/src/decidim/proposals/admin/proposals_picker.js +0 -50
- data/app/packs/stylesheets/decidim/proposals/_proposals.scss +0 -1
- data/app/packs/stylesheets/decidim/proposals/proposals/_preview.scss +0 -3
- data/app/views/decidim/proposals/collaborative_drafts/_count.html.erb +0 -1
- data/app/views/decidim/proposals/collaborative_drafts/_filters.html.erb +0 -32
- data/app/views/decidim/proposals/collaborative_drafts/_filters_small_view.html.erb +0 -18
- data/app/views/decidim/proposals/collaborative_drafts/_new_collaborative_draft_button.html.erb +0 -11
- data/app/views/decidim/proposals/collaborative_drafts/_wizard_aside.html.erb +0 -13
- data/app/views/decidim/proposals/collaborative_drafts/_wizard_header.html.erb +0 -14
- data/app/views/decidim/proposals/proposals/_count.html.erb +0 -1
- data/app/views/decidim/proposals/proposals/_dynamic_map_instructions.html.erb +0 -4
- data/app/views/decidim/proposals/proposals/_filters.html.erb +0 -48
- data/app/views/decidim/proposals/proposals/_filters_small_view.html.erb +0 -18
- data/app/views/decidim/proposals/proposals/_proposal_similar.html.erb +0 -22
- data/app/views/decidim/proposals/proposals/_wizard_aside.html.erb +0 -20
- data/app/views/decidim/proposals/proposals/participatory_texts/_index.html.erb +0 -19
- data/app/views/decidim/proposals/versions/index.html.erb +0 -16
- data/config/locales/he-IL.yml +0 -1
- data/db/migrate/20240404202756_add_valuation_assignments_count_to_decidim_proposals_proposals.rb +0 -16
- data/decidim-proposals.gemspec +0 -40
- data/lib/decidim/proposals/test/capybara_proposals_picker.rb +0 -59
@@ -41,16 +41,16 @@ module Decidim
|
|
41
41
|
{
|
42
42
|
t("proposals.filters.type", scope: "decidim.proposals") => {
|
43
43
|
link_to(t("proposals", scope: "decidim.proposals.application_helper.filter_type_values"), q: ransak_params_for_query(is_emendation_true: "0"),
|
44
|
-
per_page:
|
44
|
+
per_page:) => nil,
|
45
45
|
link_to(t("amendments", scope: "decidim.proposals.application_helper.filter_type_values"), q: ransak_params_for_query(is_emendation_true: "1"),
|
46
|
-
per_page:
|
46
|
+
per_page:) => nil
|
47
47
|
},
|
48
48
|
t("models.proposal.fields.state", scope: "decidim.proposals") =>
|
49
|
-
Decidim::Proposals::Proposal::
|
49
|
+
Decidim::Proposals::Proposal::STATES.each_pair do |state, hash|
|
50
50
|
if state == "not_answered"
|
51
|
-
hash[link_to((humanize_proposal_state state), q: ransak_params_for_query(state_null: 1), per_page:
|
51
|
+
hash[link_to((humanize_proposal_state state), q: ransak_params_for_query(state_null: 1), per_page:)] = nil
|
52
52
|
else
|
53
|
-
hash[link_to((humanize_proposal_state state), q: ransak_params_for_query(state_eq: state), per_page:
|
53
|
+
hash[link_to((humanize_proposal_state state), q: ransak_params_for_query(state_eq: state), per_page:)] = nil
|
54
54
|
end
|
55
55
|
end,
|
56
56
|
t("models.proposal.fields.category", scope: "decidim.proposals") => admin_filter_categories_tree(categories.first_class),
|
@@ -80,7 +80,7 @@ module Decidim
|
|
80
80
|
else
|
81
81
|
t("proposals", scope: "decidim.proposals.application_helper.filter_type_values")
|
82
82
|
end
|
83
|
-
tag += icon_link_to("
|
83
|
+
tag += icon_link_to("delete-bin-line", url_for(q: ransak_params_for_query_without(:is_emendation_true), per_page:), t("decidim.admin.actions.cancel"),
|
84
84
|
class: "action-icon--remove")
|
85
85
|
tag.html_safe
|
86
86
|
end
|
@@ -89,7 +89,7 @@ module Decidim
|
|
89
89
|
html << tag.span(class: "label secondary") do
|
90
90
|
tag = "#{t("models.proposal.fields.state", scope: "decidim.proposals")}: "
|
91
91
|
tag += humanize_proposal_state "not_answered"
|
92
|
-
tag += icon_link_to("
|
92
|
+
tag += icon_link_to("delete-bin-line", url_for(q: ransak_params_for_query_without(:state_null), per_page:), t("decidim.admin.actions.cancel"),
|
93
93
|
class: "action-icon--remove")
|
94
94
|
tag.html_safe
|
95
95
|
end
|
@@ -98,7 +98,7 @@ module Decidim
|
|
98
98
|
html << tag.span(class: "label secondary") do
|
99
99
|
tag = "#{t("models.proposal.fields.state", scope: "decidim.proposals")}: "
|
100
100
|
tag += humanize_proposal_state params[:q][:state_eq]
|
101
|
-
tag += icon_link_to("
|
101
|
+
tag += icon_link_to("delete-bin-line", url_for(q: ransak_params_for_query_without(:state_eq), per_page:), t("decidim.admin.actions.cancel"),
|
102
102
|
class: "action-icon--remove")
|
103
103
|
tag.html_safe
|
104
104
|
end
|
@@ -107,7 +107,7 @@ module Decidim
|
|
107
107
|
html << tag.span(class: "label secondary") do
|
108
108
|
tag = "#{t("models.proposal.fields.category", scope: "decidim.proposals")}: "
|
109
109
|
tag += translated_attribute categories.find(params[:q][:category_id_eq]).name
|
110
|
-
tag += icon_link_to("
|
110
|
+
tag += icon_link_to("delete-bin-line", url_for(q: ransak_params_for_query_without(:category_id_eq), per_page:), t("decidim.admin.actions.cancel"),
|
111
111
|
class: "action-icon--remove")
|
112
112
|
tag.html_safe
|
113
113
|
end
|
@@ -116,7 +116,7 @@ module Decidim
|
|
116
116
|
html << tag.span(class: "label secondary") do
|
117
117
|
tag = "#{t("models.proposal.fields.scope", scope: "decidim.proposals")}: "
|
118
118
|
tag += translated_attribute Decidim::Scope.where(decidim_organization_id: current_component.organization.id).find(params[:q][:scope_id_eq]).name
|
119
|
-
tag += icon_link_to("
|
119
|
+
tag += icon_link_to("delete-bin-line", url_for(q: ransak_params_for_query_without(:scope_id_eq), per_page:), t("decidim.admin.actions.cancel"),
|
120
120
|
class: "action-icon--remove")
|
121
121
|
tag.html_safe
|
122
122
|
end
|
@@ -125,14 +125,14 @@ module Decidim
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def icon_with_link_to_proposal(proposal)
|
128
|
-
icon, tooltip = if allowed_to?(:create, :proposal_answer, proposal:
|
128
|
+
icon, tooltip = if allowed_to?(:create, :proposal_answer, proposal:) && !proposal.emendation?
|
129
129
|
[
|
130
|
-
"
|
130
|
+
"question-answer-line",
|
131
131
|
t(:answer_proposal, scope: "decidim.proposals.actions")
|
132
132
|
]
|
133
133
|
else
|
134
134
|
[
|
135
|
-
"
|
135
|
+
"information-line",
|
136
136
|
t(:show, scope: "decidim.proposals.actions")
|
137
137
|
]
|
138
138
|
end
|
@@ -39,13 +39,13 @@ module Decidim
|
|
39
39
|
|
40
40
|
case state
|
41
41
|
when "accepted"
|
42
|
-
"
|
42
|
+
"success"
|
43
43
|
when "rejected", "withdrawn"
|
44
|
-
"
|
44
|
+
"alert"
|
45
45
|
when "evaluating"
|
46
|
-
"
|
46
|
+
"warning"
|
47
47
|
else
|
48
|
-
"
|
48
|
+
"info"
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -91,7 +91,7 @@ module Decidim
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# If the proposal is official or the rich text editor is enabled on the
|
94
|
-
# frontend, the proposal body is considered as safe content; that
|
94
|
+
# frontend, the proposal body is considered as safe content; that is unless
|
95
95
|
# the proposal comes from a collaborative_draft or a participatory_text.
|
96
96
|
def safe_content?
|
97
97
|
(rich_text_editor_in_public_views? && not_from_collaborative_draft(@proposal)) ||
|
@@ -110,7 +110,7 @@ module Decidim
|
|
110
110
|
if safe_content?
|
111
111
|
Decidim::ContentProcessor.render_without_format(sanitized).html_safe
|
112
112
|
else
|
113
|
-
Decidim::ContentProcessor.render(sanitized
|
113
|
+
Decidim::ContentProcessor.render(sanitized)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
@@ -119,7 +119,7 @@ module Decidim
|
|
119
119
|
options = {
|
120
120
|
class: "js-hashtags",
|
121
121
|
hashtaggable: true,
|
122
|
-
value: form_presenter.body(extras: false).strip
|
122
|
+
value: form_presenter.body(extras: false, strip_tags: !current_organization.rich_text_editor_in_public_views).strip
|
123
123
|
}
|
124
124
|
|
125
125
|
text_editor_for(form, :body, options)
|
@@ -138,20 +138,8 @@ module Decidim
|
|
138
138
|
).count
|
139
139
|
end
|
140
140
|
|
141
|
-
def votes_count_for(model, from_proposals_list)
|
142
|
-
render partial: "decidim/proposals/proposals/participatory_texts/proposal_votes_count.html", locals: { proposal: model, from_proposals_list: from_proposals_list }
|
143
|
-
end
|
144
|
-
|
145
|
-
def vote_button_for(model, from_proposals_list)
|
146
|
-
render partial: "decidim/proposals/proposals/participatory_texts/proposal_vote_button.html", locals: { proposal: model, from_proposals_list: from_proposals_list }
|
147
|
-
end
|
148
|
-
|
149
|
-
def form_has_address?
|
150
|
-
@form.address.present? || @form.has_address
|
151
|
-
end
|
152
|
-
|
153
141
|
def show_voting_rules?
|
154
|
-
return false
|
142
|
+
return false unless votes_enabled?
|
155
143
|
|
156
144
|
return true if vote_limit_enabled?
|
157
145
|
return true if threshold_per_proposal_enabled?
|
@@ -171,25 +159,89 @@ module Decidim
|
|
171
159
|
# Options to filter Proposals by activity.
|
172
160
|
def activity_filter_values
|
173
161
|
base = [
|
174
|
-
["all", t(".all")],
|
175
|
-
["my_proposals", t(".my_proposals")]
|
162
|
+
["all", t("decidim.proposals.proposals.filters.all")],
|
163
|
+
["my_proposals", t("decidim.proposals.proposals.filters.my_proposals")]
|
176
164
|
]
|
177
|
-
base += [["voted", t(".voted")]] if current_settings.votes_enabled?
|
165
|
+
base += [["voted", t("decidim.proposals.proposals.filters.voted")]] if current_settings.votes_enabled?
|
178
166
|
base
|
179
167
|
end
|
180
168
|
|
169
|
+
# Explicitely commenting the used I18n keys so their are not flagged as unused
|
170
|
+
# i18n-tasks-use t('decidim.proposals.application_helper.filter_origin_values.official')
|
171
|
+
# i18n-tasks-use t('decidim.proposals.application_helper.filter_origin_values.participants')
|
172
|
+
# i18n-tasks-use t('decidim.proposals.application_helper.filter_origin_values.user_groups')
|
173
|
+
# i18n-tasks-use t('decidim.proposals.application_helper.filter_origin_values.official')
|
174
|
+
# i18n-tasks-use t('decidim.proposals.application_helper.filter_origin_values.meetings')
|
175
|
+
# i18n-tasks-use t('decidim.proposals.application_helper.filter_origin_values.all')
|
181
176
|
def filter_origin_values
|
177
|
+
scope = "decidim.proposals.application_helper.filter_origin_values"
|
182
178
|
origin_values = []
|
183
|
-
origin_values << TreePoint.new("official", t("
|
184
|
-
origin_values << TreePoint.new("participants", t("
|
185
|
-
origin_values << TreePoint.new("user_group", t("
|
186
|
-
origin_values << TreePoint.new("meeting", t("
|
179
|
+
origin_values << TreePoint.new("official", t("official", scope:)) if component_settings.official_proposals_enabled
|
180
|
+
origin_values << TreePoint.new("participants", t("participants", scope:))
|
181
|
+
origin_values << TreePoint.new("user_group", t("user_groups", scope:)) if current_organization.user_groups_enabled?
|
182
|
+
origin_values << TreePoint.new("meeting", t("meetings", scope:))
|
187
183
|
|
188
184
|
TreeNode.new(
|
189
|
-
TreePoint.new("", t("
|
185
|
+
TreePoint.new("", t("all", scope:)),
|
190
186
|
origin_values
|
191
187
|
)
|
192
188
|
end
|
189
|
+
|
190
|
+
def filter_proposals_state_values
|
191
|
+
Decidim::CheckBoxesTreeHelper::TreeNode.new(
|
192
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("", t("decidim.proposals.application_helper.filter_state_values.all")),
|
193
|
+
[
|
194
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("accepted", t("decidim.proposals.application_helper.filter_state_values.accepted")),
|
195
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("evaluating", t("decidim.proposals.application_helper.filter_state_values.evaluating")),
|
196
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("state_not_published", t("decidim.proposals.application_helper.filter_state_values.not_answered")),
|
197
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("rejected", t("decidim.proposals.application_helper.filter_state_values.rejected"))
|
198
|
+
]
|
199
|
+
)
|
200
|
+
end
|
201
|
+
|
202
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
203
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
204
|
+
def filter_sections
|
205
|
+
@filter_sections ||= begin
|
206
|
+
items = []
|
207
|
+
if component_settings.proposal_answering_enabled && current_settings.proposal_answering_enabled
|
208
|
+
items.append(method: :with_any_state, collection: filter_proposals_state_values, label_scope: "decidim.proposals.proposals.filters", id: "state")
|
209
|
+
end
|
210
|
+
if current_component.has_subscopes?
|
211
|
+
items.append(method: :with_any_scope, collection: filter_scopes_values, label_scope: "decidim.proposals.proposals.filters", id: "scope")
|
212
|
+
end
|
213
|
+
if current_component.categories.any?
|
214
|
+
items.append(method: :with_any_category, collection: filter_categories_values, label_scope: "decidim.proposals.proposals.filters", id: "category")
|
215
|
+
end
|
216
|
+
if component_settings.official_proposals_enabled
|
217
|
+
items.append(method: :with_any_origin, collection: filter_origin_values, label_scope: "decidim.proposals.proposals.filters", id: "origin")
|
218
|
+
end
|
219
|
+
if current_user
|
220
|
+
items.append(method: :activity, collection: activity_filter_values, label_scope: "decidim.proposals.proposals.filters", id: "activity", type: :radio_buttons)
|
221
|
+
end
|
222
|
+
if @proposals.only_emendations.any?
|
223
|
+
items.append(method: :type, collection: filter_type_values, label_scope: "decidim.proposals.proposals.filters", id: "amendment_type", type: :radio_buttons)
|
224
|
+
end
|
225
|
+
if linked_classes_for(Decidim::Proposals::Proposal).any?
|
226
|
+
items.append(
|
227
|
+
method: :related_to,
|
228
|
+
collection: linked_classes_filter_values_for(Decidim::Proposals::Proposal),
|
229
|
+
label_scope: "decidim.proposals.proposals.filters",
|
230
|
+
id: "related_to",
|
231
|
+
type: :radio_buttons
|
232
|
+
)
|
233
|
+
end
|
234
|
+
end
|
235
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
236
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
237
|
+
|
238
|
+
items.reject { |item| item[:collection].blank? }
|
239
|
+
end
|
240
|
+
|
241
|
+
def component_name
|
242
|
+
i18n_key = controller_name == "collaborative_drafts" ? "decidim.proposals.collaborative_drafts.name" : "decidim.components.proposals.name"
|
243
|
+
(defined?(current_component) && translated_attribute(current_component&.name).presence) || t(i18n_key)
|
244
|
+
end
|
193
245
|
end
|
194
246
|
end
|
195
247
|
end
|
@@ -8,15 +8,28 @@ module Decidim
|
|
8
8
|
def filter_collaborative_drafts_state_values
|
9
9
|
scope = "decidim.proposals.collaborative_drafts.filters"
|
10
10
|
Decidim::CheckBoxesTreeHelper::TreeNode.new(
|
11
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("", t("all", scope:
|
11
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("", t("all", scope:)),
|
12
12
|
[
|
13
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("open", t("open", scope:
|
14
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("withdrawn", t("withdrawn", scope:
|
15
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("published", t("published", scope:
|
13
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("open", t("open", scope:)),
|
14
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("withdrawn", t("withdrawn", scope:)),
|
15
|
+
Decidim::CheckBoxesTreeHelper::TreePoint.new("published", t("published", scope:))
|
16
16
|
]
|
17
17
|
)
|
18
18
|
end
|
19
19
|
|
20
|
+
def humanize_collaborative_draft_state(state)
|
21
|
+
I18n.t(state, scope: "decidim.proposals.collaborative_drafts.states", default: :open)
|
22
|
+
end
|
23
|
+
|
24
|
+
def collaborative_drafts_state_class(type)
|
25
|
+
case type
|
26
|
+
when "withdrawn"
|
27
|
+
"alert"
|
28
|
+
when "open", "published"
|
29
|
+
"success"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
20
33
|
def accept_request_button_label
|
21
34
|
t("accept_request", scope: "decidim.proposals.collaborative_drafts.requests.collaboration_requests")
|
22
35
|
end
|
@@ -24,6 +37,33 @@ module Decidim
|
|
24
37
|
def reject_request_button_label
|
25
38
|
t("reject_request", scope: "decidim.proposals.collaborative_drafts.requests.collaboration_requests")
|
26
39
|
end
|
40
|
+
|
41
|
+
def collaborative_drafts_filter_sections
|
42
|
+
@collaborative_drafts_filter_sections ||= begin
|
43
|
+
items = [{
|
44
|
+
method: :with_any_state,
|
45
|
+
collection: filter_collaborative_drafts_state_values,
|
46
|
+
label_scope: "decidim.proposals.collaborative_drafts.filters",
|
47
|
+
id: "state"
|
48
|
+
}]
|
49
|
+
if current_component.has_subscopes?
|
50
|
+
items.append(method: :with_any_scope, collection: filter_scopes_values, label_scope: "decidim.proposals.collaborative_drafts.filters", id: "scope")
|
51
|
+
end
|
52
|
+
if current_component.categories.any?
|
53
|
+
items.append(method: :with_any_category, collection: filter_categories_values, label_scope: "decidim.proposals.collaborative_drafts.filters", id: "category")
|
54
|
+
end
|
55
|
+
if linked_classes_for(Decidim::Proposals::CollaborativeDraft).any?
|
56
|
+
items.append(
|
57
|
+
method: :related_to,
|
58
|
+
collection: linked_classes_filter_values_for(Decidim::Proposals::CollaborativeDraft),
|
59
|
+
label_scope: "decidim.proposals.collaborative_drafts.filters",
|
60
|
+
id: "related_to",
|
61
|
+
type: :radio_buttons
|
62
|
+
)
|
63
|
+
end
|
64
|
+
items.reject { |item| item[:collection].blank? }
|
65
|
+
end
|
66
|
+
end
|
27
67
|
end
|
28
68
|
end
|
29
69
|
end
|
@@ -19,9 +19,8 @@ module Decidim
|
|
19
19
|
.slice(:latitude, :longitude, :address)
|
20
20
|
.merge(
|
21
21
|
title: decidim_html_escape(present(proposal).title),
|
22
|
-
|
23
|
-
|
24
|
-
link: proposal_path(proposal)
|
22
|
+
link: proposal_path(proposal),
|
23
|
+
items: cell("decidim/proposals/proposal_metadata", proposal).send(:proposal_items_for_map).to_json
|
25
24
|
)
|
26
25
|
end
|
27
26
|
|
@@ -33,7 +32,7 @@ module Decidim
|
|
33
32
|
:longitude,
|
34
33
|
:address
|
35
34
|
).merge(
|
36
|
-
icon: icon("
|
35
|
+
icon: icon("chat-new-line", width: 40, height: 70, remove_icon_class: true)
|
37
36
|
)
|
38
37
|
}
|
39
38
|
end
|
@@ -11,18 +11,10 @@ module Decidim
|
|
11
11
|
# Returns a string with the title of the section, subsection or article.
|
12
12
|
def preview_participatory_text_section_title(proposal)
|
13
13
|
title = decidim_html_escape(present(proposal).title)
|
14
|
-
translated = t(proposal.participatory_text_level, scope: "decidim.proposals.admin.participatory_texts.sections", title:
|
14
|
+
translated = t(proposal.participatory_text_level, scope: "decidim.proposals.admin.participatory_texts.sections", title:)
|
15
15
|
translated.html_safe
|
16
16
|
end
|
17
17
|
|
18
|
-
def render_participatory_text_title(participatory_text)
|
19
|
-
if participatory_text.nil?
|
20
|
-
t("alternative_title", scope: "decidim.proposals.participatory_text_proposal")
|
21
|
-
else
|
22
|
-
translated_attribute(participatory_text.title)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
18
|
# Public: A formatted collection of mime_type to be used
|
27
19
|
# in forms.
|
28
20
|
def mime_types_with_document_examples
|
@@ -4,33 +4,11 @@ module Decidim
|
|
4
4
|
module Proposals
|
5
5
|
# Simple helpers to handle markup variations for proposal votes partials
|
6
6
|
module ProposalVotesHelper
|
7
|
-
# Returns the css classes used for proposal votes count in both proposals list and show pages
|
8
|
-
#
|
9
|
-
# from_proposals_list - A boolean to indicate if the template is rendered from the proposals list page
|
10
|
-
#
|
11
|
-
# Returns a hash with the css classes for the count number and label
|
12
|
-
def votes_count_classes(from_proposals_list)
|
13
|
-
return { number: "card__support__number", label: "" } if from_proposals_list
|
14
|
-
|
15
|
-
{ number: "extra__suport-number", label: "extra__suport-text" }
|
16
|
-
end
|
17
|
-
|
18
|
-
# Returns the css classes used for proposal vote button in both proposals list and show pages
|
19
|
-
#
|
20
|
-
# from_proposals_list - A boolean to indicate if the template is rendered from the proposals list page
|
21
|
-
#
|
22
|
-
# Returns a string with the value of the css classes.
|
23
|
-
def vote_button_classes(from_proposals_list)
|
24
|
-
return "card__button" if from_proposals_list
|
25
|
-
|
26
|
-
"expanded"
|
27
|
-
end
|
28
|
-
|
29
7
|
# Public: Gets the vote limit for each user, if set.
|
30
8
|
#
|
31
9
|
# Returns an Integer if set, nil otherwise.
|
32
10
|
def vote_limit
|
33
|
-
return nil if component_settings.vote_limit
|
11
|
+
return nil if component_settings.vote_limit&.zero?
|
34
12
|
|
35
13
|
component_settings.vote_limit
|
36
14
|
end
|
@@ -53,7 +31,7 @@ module Decidim
|
|
53
31
|
#
|
54
32
|
# Returns an Integer with the maximum amount of votes, nil otherwise.
|
55
33
|
def threshold_per_proposal
|
56
|
-
return nil unless component_settings.threshold_per_proposal
|
34
|
+
return nil unless component_settings.threshold_per_proposal&.positive?
|
57
35
|
|
58
36
|
component_settings.threshold_per_proposal
|
59
37
|
end
|
@@ -4,37 +4,19 @@ module Decidim
|
|
4
4
|
module Proposals
|
5
5
|
# Simple helpers to handle markup variations for proposal wizard partials
|
6
6
|
module ProposalWizardHelper
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
elsif step_i < proposal_wizard_step_number(current_step)
|
18
|
-
%(step--past #{step})
|
19
|
-
else
|
20
|
-
%()
|
7
|
+
def wizard_steps(current_step)
|
8
|
+
scope = "decidim.proposals.proposals.wizard_steps"
|
9
|
+
inactive_data = { data: { past: "" } }
|
10
|
+
content_tag(:ol, id: "wizard-steps", class: "wizard-steps") do
|
11
|
+
proposal_wizard_steps.map do |wizard_step|
|
12
|
+
active = current_step == wizard_step
|
13
|
+
inactive_data = {} if active
|
14
|
+
attributes = active ? { "aria-current": "step", "aria-label": "#{t("current_step", scope:)}: #{t(wizard_step, scope:)}", data: { active: "" } } : inactive_data
|
15
|
+
content_tag(:li, t(wizard_step, scope:), attributes)
|
16
|
+
end.join.html_safe
|
21
17
|
end
|
22
18
|
end
|
23
19
|
|
24
|
-
# Returns the number of the step
|
25
|
-
#
|
26
|
-
# step - A symbol of the target step
|
27
|
-
def proposal_wizard_step_number(step)
|
28
|
-
step.to_s.split("_").last.to_i
|
29
|
-
end
|
30
|
-
|
31
|
-
# Returns the name of the step, translated
|
32
|
-
#
|
33
|
-
# step - A symbol of the target step
|
34
|
-
def proposal_wizard_step_name(step)
|
35
|
-
t("decidim.proposals.proposals.wizard_steps.#{step}")
|
36
|
-
end
|
37
|
-
|
38
20
|
# Returns the page title of the given step, translated
|
39
21
|
#
|
40
22
|
# action_name - A string of the rendered action
|
@@ -51,55 +33,6 @@ module Decidim
|
|
51
33
|
t("decidim.proposals.proposals.#{step_title}.title")
|
52
34
|
end
|
53
35
|
|
54
|
-
# Returns the list item of the given step, in html
|
55
|
-
#
|
56
|
-
# step - A symbol of the target step
|
57
|
-
# current_step - A symbol of the current step
|
58
|
-
def proposal_wizard_stepper_step(step, current_step)
|
59
|
-
attributes = { class: proposal_wizard_step_classes(step, current_step).to_s }
|
60
|
-
step_title = proposal_wizard_step_name(step)
|
61
|
-
if step.to_s.split("_").last.to_i == proposal_wizard_step_number(current_step)
|
62
|
-
current_step_title = proposal_wizard_step_name("current_step")
|
63
|
-
step_title = content_tag(:span, "#{current_step_title}: ", class: "show-for-sr") + step_title
|
64
|
-
attributes["aria-current"] = "step"
|
65
|
-
end
|
66
|
-
|
67
|
-
content_tag(:li, step_title, attributes)
|
68
|
-
end
|
69
|
-
|
70
|
-
# Returns the list with all the steps, in html
|
71
|
-
#
|
72
|
-
# current_step - A symbol of the current step
|
73
|
-
def proposal_wizard_stepper(current_step)
|
74
|
-
content_tag :ol, class: "wizard__steps" do
|
75
|
-
%(
|
76
|
-
#{proposal_wizard_stepper_step(ProposalsController::STEP1, current_step)}
|
77
|
-
#{proposal_wizard_stepper_step(ProposalsController::STEP2, current_step)}
|
78
|
-
#{proposal_wizard_stepper_step(ProposalsController::STEP3, current_step)}
|
79
|
-
#{proposal_wizard_stepper_step(ProposalsController::STEP4, current_step)}
|
80
|
-
).html_safe
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
# Returns a string with the current step number and the total steps number
|
85
|
-
#
|
86
|
-
def proposal_wizard_current_step_of(step)
|
87
|
-
current_step_num = proposal_wizard_step_number(step)
|
88
|
-
see_steps = content_tag(:span, class: "hide-for-large") do
|
89
|
-
concat " ("
|
90
|
-
concat content_tag :a, t(:"decidim.proposals.proposals.wizard_steps.see_steps"), "data-toggle": "steps"
|
91
|
-
concat ")"
|
92
|
-
end
|
93
|
-
content_tag :span, class: "text-small" do
|
94
|
-
concat t(:"decidim.proposals.proposals.wizard_steps.step_of", current_step_num: current_step_num, total_steps: total_steps)
|
95
|
-
concat see_steps
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
def proposal_wizard_steps_title
|
100
|
-
t("title", scope: "decidim.proposals.proposals.wizard_steps")
|
101
|
-
end
|
102
|
-
|
103
36
|
# Returns a boolean if the step has a help text defined
|
104
37
|
#
|
105
38
|
# step - A symbol of the target step
|
@@ -107,16 +40,16 @@ module Decidim
|
|
107
40
|
translated_attribute(component_settings.try("proposal_wizard_#{step}_help_text")).present?
|
108
41
|
end
|
109
42
|
|
43
|
+
def proposal_wizard_steps
|
44
|
+
[ProposalsController::STEP1, ProposalsController::STEP2, ProposalsController::STEP3, ProposalsController::STEP4]
|
45
|
+
end
|
46
|
+
|
110
47
|
private
|
111
48
|
|
112
49
|
def total_steps
|
113
50
|
4
|
114
51
|
end
|
115
52
|
|
116
|
-
def wizard_aside_info_text
|
117
|
-
t("info", scope: "decidim.proposals.proposals.wizard_aside").html_safe
|
118
|
-
end
|
119
|
-
|
120
53
|
# Renders the back link except for step_2: compare
|
121
54
|
def proposal_wizard_aside_link_to_back(step)
|
122
55
|
case step
|
@@ -35,18 +35,6 @@ module Decidim
|
|
35
35
|
t(i18n_key, scope: "decidim.proposals.proposals.show")
|
36
36
|
end
|
37
37
|
|
38
|
-
def filter_proposals_state_values
|
39
|
-
Decidim::CheckBoxesTreeHelper::TreeNode.new(
|
40
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("", t("decidim.proposals.application_helper.filter_state_values.all")),
|
41
|
-
[
|
42
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("accepted", t("decidim.proposals.application_helper.filter_state_values.accepted")),
|
43
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("evaluating", t("decidim.proposals.application_helper.filter_state_values.evaluating")),
|
44
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("state_not_published", t("decidim.proposals.application_helper.filter_state_values.not_answered")),
|
45
|
-
Decidim::CheckBoxesTreeHelper::TreePoint.new("rejected", t("decidim.proposals.application_helper.filter_state_values.rejected"))
|
46
|
-
]
|
47
|
-
)
|
48
|
-
end
|
49
|
-
|
50
38
|
def proposal_has_costs?
|
51
39
|
@proposal.cost.present? &&
|
52
40
|
translated_attribute(@proposal.cost_report).present? &&
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Proposals
|
5
|
+
class HideAllCreatedByAuthorJob < ::Decidim::HideAllCreatedByAuthorJob
|
6
|
+
protected
|
7
|
+
|
8
|
+
def perform(resource:, extra: {})
|
9
|
+
return unless extra.fetch(:hide, false)
|
10
|
+
|
11
|
+
Decidim::Proposals::Proposal.not_hidden.from_author(resource).find_each do |content|
|
12
|
+
hide_content(content, extra[:event_author], extra[:justification])
|
13
|
+
end
|
14
|
+
Decidim::Proposals::CollaborativeDraft.not_hidden.from_author(resource).find_each do |content|
|
15
|
+
hide_content(content, extra[:event_author], extra[:justification])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -14,7 +14,7 @@ module Decidim
|
|
14
14
|
event: "decidim.events.proposals.proposal_mentioned",
|
15
15
|
event_class: Decidim::Proposals::ProposalMentionedEvent,
|
16
16
|
resource: comment.root_commentable,
|
17
|
-
affected_users
|
17
|
+
affected_users:,
|
18
18
|
extra: {
|
19
19
|
comment_id: comment.id,
|
20
20
|
mentioned_proposal_id: proposal_id
|
@@ -31,10 +31,10 @@ module Decidim
|
|
31
31
|
|
32
32
|
geocoded_by :address
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
scope :
|
34
|
+
STATES = { open: 0, published: 10, withdrawn: -1 }.freeze
|
35
|
+
|
36
|
+
enum state: STATES, _default: "open"
|
37
|
+
scope :except_withdrawn, -> { not_withdrawn.or(where(state: nil)) }
|
38
38
|
|
39
39
|
scope_search_multi :with_any_state, [:open, :published, :withdrawn]
|
40
40
|
|
@@ -45,18 +45,6 @@ module Decidim
|
|
45
45
|
authored_by?(user)
|
46
46
|
end
|
47
47
|
|
48
|
-
def open?
|
49
|
-
state == "open"
|
50
|
-
end
|
51
|
-
|
52
|
-
def withdrawn?
|
53
|
-
state == "withdrawn"
|
54
|
-
end
|
55
|
-
|
56
|
-
def published?
|
57
|
-
state == "published"
|
58
|
-
end
|
59
|
-
|
60
48
|
# Public: Overrides the `reported_content_url` Reportable concern method.
|
61
49
|
def reported_content_url
|
62
50
|
ResourceLocatorPresenter.new(self).url
|