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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4261c8defc7335c582aafffe209f651b972ca1e3302dad3844ef31e53324f14
|
4
|
+
data.tar.gz: 17ea361750db85baad4063d0f1bb400548f9e07fd39a15e41a78d474908692d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76c72ecf3698d323fa6cc2beef6c08624108789fcad59e85a2afed9eba97f6e868abe01e03aea32cb06f84f1bb45ae04eadecdc0dcab14cdf93b0e2e1f5242d1
|
7
|
+
data.tar.gz: 54515a7042a4327fb35efb96ba26e7f9ea22c41fa6a00752ab85a8d71a466d17e73b8a59a8bc0a5f0b1f5066b26f162ef6e621e1c4656813ebd6230f48d40752
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "cell/partial"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Proposals
|
7
|
+
# This cell renders a proposal with its L-size card.
|
8
|
+
class CollaborativeDraftLCell < Decidim::CardLCell
|
9
|
+
private
|
10
|
+
|
11
|
+
def metadata_cell
|
12
|
+
"decidim/proposals/collaborative_draft_metadata"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,13 +1,5 @@
|
|
1
|
-
<div>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<div>
|
6
|
-
<%= link_help_text %>
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<%= link_to_resource %>
|
10
|
-
|
11
|
-
<div class="mt-xs">
|
12
|
-
<%= link_to_versions %>
|
1
|
+
<div class="flex flex-col gap-2 items-center">
|
2
|
+
<h3 class="h3"><%= t("final_proposal", scope: "decidim.proposals.collaborative_drafts.show") %></h3>
|
3
|
+
<p class="text-center text-gray-2"><%= t("final_proposal_help_text", scope: "decidim.proposals.collaborative_drafts.show") %></p>
|
4
|
+
<%= link_to t("published_proposal", scope: "decidim.proposals.collaborative_drafts.show"), resource_locator(@proposal).path, class: "button button__lg button__secondary w-full mt-4" %>
|
13
5
|
</div>
|
@@ -16,35 +16,6 @@ module Decidim
|
|
16
16
|
@proposal ||= model.linked_resources(:proposal, "created_from_collaborative_draft").first
|
17
17
|
end
|
18
18
|
|
19
|
-
def link_to_resource
|
20
|
-
link_to resource_locator(proposal).path, class: "button secondary light expanded button--sc mt-s" do
|
21
|
-
t("published_proposal", scope: "decidim.proposals.collaborative_drafts.show")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def link_header
|
26
|
-
tag.strong(class: "text-large") do
|
27
|
-
t("final_proposal", scope: "decidim.proposals.collaborative_drafts.show")
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def link_help_text
|
32
|
-
tag.span(class: "text-medium") do
|
33
|
-
t("final_proposal_help_text", scope: "decidim.proposals.collaborative_drafts.show")
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def link_to_versions
|
38
|
-
@path ||= decidim_proposals.collaborative_draft_versions_path(
|
39
|
-
collaborative_draft_id: model.id
|
40
|
-
)
|
41
|
-
link_to @path, class: "text-medium" do
|
42
|
-
tag.u do
|
43
|
-
t("version_history", scope: "decidim.proposals.collaborative_drafts.show")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
19
|
def decidim
|
49
20
|
Decidim::Core::Engine.routes.url_helpers
|
50
21
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Proposals
|
5
|
+
# This cell renders metadata for an instance of a CollaborativeDraft
|
6
|
+
class CollaborativeDraftMetadataCell < Decidim::CardMetadataCell
|
7
|
+
include Decidim::Proposals::ApplicationHelper
|
8
|
+
|
9
|
+
delegate :state, to: :model
|
10
|
+
|
11
|
+
def initialize(*)
|
12
|
+
super
|
13
|
+
|
14
|
+
@items.prepend(*collaborative_draft_items)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def collaborative_draft_items
|
20
|
+
[coauthors_item, comments_count_item, endorsements_count_item, state_item]
|
21
|
+
end
|
22
|
+
|
23
|
+
def state_item
|
24
|
+
return if state.blank?
|
25
|
+
|
26
|
+
{ text: content_tag(:span, humanize_collaborative_draft_state(state), class: "label #{collaborative_drafts_state_class(state)}") }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -3,16 +3,10 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Proposals
|
5
5
|
module ContentBlocks
|
6
|
-
class HighlightedProposalsCell < Decidim::ContentBlocks::
|
7
|
-
def base_relation
|
8
|
-
@base_relation ||= Decidim::Proposals::Proposal.published.not_hidden.except_withdrawn.where(component: published_components)
|
9
|
-
end
|
10
|
-
|
6
|
+
class HighlightedProposalsCell < Decidim::ContentBlocks::HighlightedElementsWithCellForListCell
|
11
7
|
private
|
12
8
|
|
13
|
-
def
|
14
|
-
Decidim::Proposals.config.process_group_highlighted_proposals_limit
|
15
|
-
end
|
9
|
+
def list_cell_path = "decidim/proposals/highlighted_proposals_for_component"
|
16
10
|
end
|
17
11
|
end
|
18
12
|
end
|
@@ -1,35 +1,6 @@
|
|
1
|
-
<div id="proposal-costs" class="
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<%= t("decidim.proposals.proposals.show.estimated_cost") %>
|
7
|
-
</h3>
|
8
|
-
<div>
|
9
|
-
<strong class="data-title__main">
|
10
|
-
<%= cost %>
|
11
|
-
</strong>
|
12
|
-
</div>
|
13
|
-
<div class="data-title__sub">
|
14
|
-
<%= execution_period %>
|
15
|
-
</div>
|
16
|
-
</div>
|
17
|
-
</div>
|
18
|
-
<div id="execution-cost-short" class="text-toggle__short">
|
19
|
-
<%= cost_report_short %>
|
20
|
-
<% if needs_text_toggle? %>
|
21
|
-
<button class="muted-link" data-toggle="proposal-costs">
|
22
|
-
<%= t("decidim.proposals.proposals.show.read_more") %>
|
23
|
-
</button>
|
24
|
-
<% end %>
|
25
|
-
</div>
|
26
|
-
<% if needs_text_toggle? %>
|
27
|
-
<div id="execution-cost-long" class="text-toggle__long">
|
28
|
-
<%= cost_report %>
|
29
|
-
<button class="muted-link" data-toggle="proposal-costs">
|
30
|
-
<%= t("decidim.proposals.proposals.show.read_less") %>
|
31
|
-
</button>
|
32
|
-
</div>
|
33
|
-
<% end %>
|
34
|
-
</div>
|
1
|
+
<div id="proposal-costs" class="proposal__cost">
|
2
|
+
<h2 class="h4"><%= t("decidim.proposals.proposals.show.estimated_cost") %></h2>
|
3
|
+
<div class="h2"><%= cost %></div>
|
4
|
+
<div class="proposal__cost-period"><%= execution_period %></div>
|
5
|
+
<%= cost_report %>
|
35
6
|
</div>
|
@@ -21,19 +21,6 @@ module Decidim
|
|
21
21
|
decidim_sanitize_editor(translated_attribute(model.cost_report).html_safe)
|
22
22
|
end
|
23
23
|
|
24
|
-
def needs_text_toggle?
|
25
|
-
cost_report != cost_report_short
|
26
|
-
end
|
27
|
-
|
28
|
-
def cost_report_short
|
29
|
-
decidim_sanitize_editor(
|
30
|
-
html_truncate(
|
31
|
-
translated_attribute(model.cost_report).html_safe,
|
32
|
-
length: 200
|
33
|
-
)
|
34
|
-
)
|
35
|
-
end
|
36
|
-
|
37
24
|
def execution_period
|
38
25
|
decidim_sanitize_editor(translated_attribute(model.execution_period).html_safe)
|
39
26
|
end
|
@@ -1,19 +1,31 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
<%=
|
4
|
-
</
|
1
|
+
<div class="content-block__title">
|
2
|
+
<h2 class="h2 decorator">
|
3
|
+
<%= single_component? ? translated_attribute(model.name) : t("decidim.components.proposals.name") %>
|
4
|
+
</h2>
|
5
|
+
<div class="label text-lg"><%= proposals_count %></div>
|
6
|
+
<% if single_component? %>
|
7
|
+
<%= link_to decidim_proposals.root_path, class: "button button__sm button__text-secondary" do %>
|
8
|
+
<span><%= t("decidim.participatory_spaces.highlighted_proposals.see_all") %></span>
|
9
|
+
<%= icon "arrow-right-line" %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
5
13
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
size: proposals_count
|
12
|
-
) %>
|
14
|
+
<div class="flex items-start justify-between">
|
15
|
+
<div class="grow space-y-6">
|
16
|
+
<span class="content-block__span">
|
17
|
+
<%= t("decidim.participatory_spaces.highlighted_proposals.last") %>
|
18
|
+
</span>
|
13
19
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
<% proposals_to_render.each do |p| %>
|
21
|
+
<%= card_for p, link_whole_card: true, title_tag: :h3, **options.slice(:show_space) %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<% if single_component? %>
|
26
|
+
<%= link_to decidim_proposals.new_proposal_path, class: "button button__sm md:button__lg button__secondary" do %>
|
27
|
+
<span><%= t("decidim.proposals.actions.new") %></span>
|
28
|
+
<%= icon "add-line" %>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
</div>
|
@@ -9,25 +9,47 @@ module Decidim
|
|
9
9
|
# view hook.
|
10
10
|
class HighlightedProposalsForComponentCell < Decidim::ViewModel
|
11
11
|
include Decidim::ComponentPathHelper
|
12
|
+
include Decidim::CardHelper
|
12
13
|
|
13
14
|
def show
|
14
|
-
render unless
|
15
|
+
render unless items_blank?
|
16
|
+
end
|
17
|
+
|
18
|
+
def items_blank?
|
19
|
+
proposals_count.zero?
|
15
20
|
end
|
16
21
|
|
17
22
|
private
|
18
23
|
|
24
|
+
def proposals_count
|
25
|
+
@proposals_count ||= base_relation.size
|
26
|
+
end
|
27
|
+
|
19
28
|
def proposals
|
20
|
-
@proposals ||=
|
21
|
-
|
22
|
-
|
29
|
+
@proposals ||= case options[:order]
|
30
|
+
when "recent"
|
31
|
+
base_relation.order_by_most_recent
|
32
|
+
else
|
33
|
+
base_relation.order_randomly(random_seed)
|
34
|
+
end
|
23
35
|
end
|
24
36
|
|
25
|
-
def
|
26
|
-
|
37
|
+
def base_relation
|
38
|
+
Decidim::Proposals::Proposal.published.not_hidden.except_withdrawn.where(component: model)
|
27
39
|
end
|
28
40
|
|
29
|
-
def
|
30
|
-
|
41
|
+
def decidim_proposals
|
42
|
+
return unless single_component?
|
43
|
+
|
44
|
+
Decidim::EngineRouter.main_proxy(model)
|
45
|
+
end
|
46
|
+
|
47
|
+
def single_component?
|
48
|
+
@single_component ||= model.is_a?(Decidim::Component)
|
49
|
+
end
|
50
|
+
|
51
|
+
def proposals_to_render
|
52
|
+
@proposals_to_render ||= proposals.includes([:amendable, :category, :component, :scope]).limit(Decidim::Proposals.config.participatory_space_highlighted_proposals_limit)
|
31
53
|
end
|
32
54
|
|
33
55
|
def cache_hash
|
@@ -37,6 +59,10 @@ module Decidim
|
|
37
59
|
hash << I18n.locale.to_s
|
38
60
|
hash.join(Decidim.cache_key_separator)
|
39
61
|
end
|
62
|
+
|
63
|
+
def random_seed
|
64
|
+
(rand * 2) - 1
|
65
|
+
end
|
40
66
|
end
|
41
67
|
end
|
42
68
|
end
|
@@ -1,27 +1,19 @@
|
|
1
1
|
<%= button_reveal_modal %>
|
2
2
|
|
3
|
-
|
4
|
-
<div
|
5
|
-
|
3
|
+
<%= decidim_modal id: modal_id do %>
|
4
|
+
<div data-dialog-container>
|
5
|
+
<%= icon "draft-line" %>
|
6
|
+
<h3 class="h3" id="dialog-title-<%= modal_id %>" tabindex="-1" data-dialog-title>
|
6
7
|
<%= modal_title %>
|
7
8
|
</h3>
|
8
9
|
|
9
|
-
<
|
10
|
-
|
11
|
-
</
|
10
|
+
<p>
|
11
|
+
<%= modal_body %>
|
12
|
+
</p>
|
12
13
|
</div>
|
13
14
|
|
14
|
-
<div
|
15
|
-
<div>
|
16
|
-
<p>
|
17
|
-
<%= modal_body %>
|
18
|
-
</p>
|
19
|
-
</div>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<div class="row">
|
15
|
+
<div data-dialog-actions>
|
23
16
|
<%= button_cancel %>
|
24
|
-
|
25
17
|
<%= button_continue %>
|
26
18
|
</div>
|
27
|
-
|
19
|
+
<% end %>
|
@@ -33,11 +33,11 @@ module Decidim
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def button_reveal_modal
|
36
|
-
data = { open: modal_id }
|
36
|
+
data = { "dialog-open": modal_id }
|
37
37
|
label = t(action, scope: "decidim.proposals.collaborative_drafts.show")
|
38
|
-
css = publish? ? "button
|
38
|
+
css = publish? ? "button button__lg button__secondary w-full" : "text-secondary"
|
39
39
|
|
40
|
-
button_tag label, type: "button", class: css, data:
|
40
|
+
button_tag label, type: "button", class: css, data:
|
41
41
|
end
|
42
42
|
|
43
43
|
def modal_title
|
@@ -51,8 +51,8 @@ module Decidim
|
|
51
51
|
def button_continue
|
52
52
|
label = t("ok", scope: "decidim.proposals.collaborative_drafts.collaborative_draft.#{action}.irreversible_action_modal")
|
53
53
|
path = resource_path action
|
54
|
-
css = "button
|
55
|
-
button_to label, path, class: css
|
54
|
+
css = "button button__lg button__secondary"
|
55
|
+
button_to label, path, class: css
|
56
56
|
end
|
57
57
|
|
58
58
|
def close_label
|
@@ -60,10 +60,8 @@ module Decidim
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def button_cancel
|
63
|
-
|
64
|
-
|
65
|
-
close_label
|
66
|
-
end
|
63
|
+
button_tag type: "button", class: "button button__lg button__transparent-secondary", "data-dialog-close": modal_id do
|
64
|
+
close_label
|
67
65
|
end
|
68
66
|
end
|
69
67
|
|
@@ -1,33 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%=
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
<% if amendmendment_creation_enabled? || visible_emendations.any? %>
|
2
|
+
<%= link_to amend_resource_path, disabled: amend_button_disabled?, class: "proposal-participatory__button" do %>
|
3
|
+
<%= icon "chat-1-line" %>
|
4
|
+
<span><%= t("amend", scope: "decidim.proposals.participatory_text_proposal.buttons") %></span>
|
5
|
+
<div class="label"><%= visible_emendations.count %></div>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% if component_settings.comments_enabled? %>
|
10
|
+
<% if current_settings.comments_blocked? %>
|
11
|
+
<%= content_tag :button, disabled: true, class: "proposal-participatory__button" do %>
|
12
|
+
<%= icon "chat-1-line" %>
|
13
|
+
<span><%= t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %></span>
|
14
|
+
<div class="label"><%= model.comments_count %></div>
|
13
15
|
<% end %>
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<%= model.comments_count %>
|
20
|
-
<% end %>
|
21
|
-
<%= content_tag :button, t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons"), class: "column button hollow secondary button--sc disabled", disabled: true, title: t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %>
|
22
|
-
<% else %>
|
23
|
-
<%= link_to resource_comments_path, class: "column medium-4 button light secondary" do %>
|
24
|
-
<%= icon "comment-square", class: "icon--small", aria_label: t("comments", scope: "decidim.proposals.participatory_text_proposal.buttons"), role: "img" %> <%= model.comments_count %>
|
25
|
-
<% end %>
|
26
|
-
<%= action_authorized_link_to :comment, resource_comments_path, resource: model, class: "column button hollow secondary button--sc" do %>
|
27
|
-
<%= t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %>
|
28
|
-
<% end %>
|
29
|
-
<% end %>
|
30
|
-
</div>
|
16
|
+
<% else %>
|
17
|
+
<%= link_to resource_comments_path, class: "proposal-participatory__button" do %>
|
18
|
+
<%= icon "chat-1-line" %>
|
19
|
+
<span><%= t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %></span>
|
20
|
+
<div class="label"><%= model.comments_count %></div>
|
31
21
|
<% end %>
|
32
|
-
|
33
|
-
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
@@ -1,9 +1,5 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<% end %>
|
7
|
-
</div>
|
8
|
-
<%= render :buttons %>
|
9
|
-
</div>
|
1
|
+
<section id="<%= dom_id(model) %>" class="proposal-participatory__section">
|
2
|
+
<%= link_to section_title, resource_path, class: "proposal-participatory__title" %>
|
3
|
+
<div class="proposal-participatory__text"><%= body %></div>
|
4
|
+
<div class="flex"><%= render :buttons %></div>
|
5
|
+
</section>
|
@@ -18,15 +18,6 @@ module Decidim
|
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
-
def title
|
22
|
-
case model.participatory_text_level
|
23
|
-
when "section"
|
24
|
-
"<h5><strong>#{section_title}</strong></h5>"
|
25
|
-
else
|
26
|
-
"<h6><strong>#{section_title}</strong></h6>"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
21
|
def section_title
|
31
22
|
decidim_html_escape(present(model).title).html_safe
|
32
23
|
end
|
@@ -5,18 +5,7 @@ module Decidim
|
|
5
5
|
# A cell to display when actions happen on a proposal.
|
6
6
|
class ProposalActivityCell < ActivityCell
|
7
7
|
def title
|
8
|
-
|
9
|
-
when "update"
|
10
|
-
I18n.t(
|
11
|
-
"decidim.proposals.last_activity.proposal_updated_at_html",
|
12
|
-
link: participatory_space_link
|
13
|
-
)
|
14
|
-
else
|
15
|
-
I18n.t(
|
16
|
-
"decidim.proposals.last_activity.new_proposal_at_html",
|
17
|
-
link: participatory_space_link
|
18
|
-
)
|
19
|
-
end
|
8
|
+
action == "update" ? I18n.t("decidim.proposals.last_activity.proposal_updated") : I18n.t("decidim.proposals.last_activity.new_proposal")
|
20
9
|
end
|
21
10
|
|
22
11
|
def resource_link_text
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "cell/partial"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Proposals
|
7
|
+
# This cell renders the List (:l) proposal card
|
8
|
+
# for an instance of a Proposal
|
9
|
+
class ProposalLCell < Decidim::CardLCell
|
10
|
+
delegate :component_settings, to: :controller
|
11
|
+
|
12
|
+
alias proposal model
|
13
|
+
|
14
|
+
def title
|
15
|
+
present(proposal).title(html_escape: true)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def metadata_cell
|
21
|
+
"decidim/proposals/proposal_metadata"
|
22
|
+
end
|
23
|
+
|
24
|
+
def cache_hash
|
25
|
+
hash = []
|
26
|
+
hash << I18n.locale.to_s
|
27
|
+
hash << model.cache_key_with_version
|
28
|
+
hash << model.proposal_votes_count
|
29
|
+
hash << model.endorsements_count
|
30
|
+
hash << model.comments_count
|
31
|
+
hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
|
32
|
+
hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
|
33
|
+
hash << render_space? ? 1 : 0
|
34
|
+
if current_user
|
35
|
+
hash << current_user.cache_key_with_version
|
36
|
+
hash << current_user.follows?(model) ? 1 : 0
|
37
|
+
end
|
38
|
+
hash << model.follows_count
|
39
|
+
hash << Digest::MD5.hexdigest(model.authors.map(&:cache_key_with_version).to_s)
|
40
|
+
hash << (model.must_render_translation?(model.organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
|
41
|
+
hash << model.component.participatory_space.active_step.id if model.component.participatory_space.try(:active_step)
|
42
|
+
|
43
|
+
hash.join(Decidim.cache_key_separator)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -12,10 +12,12 @@ module Decidim
|
|
12
12
|
@linked_resource ||= model.linked_resources(:collaborative_draft, "created_from_collaborative_draft").first
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
def link_to_resource_url
|
16
|
+
resource_locator(linked_resource).path
|
17
|
+
end
|
18
|
+
|
19
|
+
def link_to_resource_text
|
20
|
+
t("link_to_collaborative_draft_text", scope: "decidim.proposals.proposals.show")
|
19
21
|
end
|
20
22
|
|
21
23
|
def link_help_text
|
@@ -12,13 +12,15 @@ module Decidim
|
|
12
12
|
@linked_resource ||= model.linked_promoted_resource
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
def link_to_resource_url
|
16
|
+
resource_locator(linked_resource).path
|
17
|
+
end
|
18
|
+
|
19
|
+
def link_to_resource_text
|
20
|
+
if model.emendation?
|
21
|
+
t("link_to_proposal_from_emendation_text", scope: "decidim.proposals.proposals.show")
|
22
|
+
else
|
23
|
+
t("link_to_promoted_emendation_text", scope: "decidim.proposals.proposals.show")
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<div class="text-center
|
2
|
-
|
3
|
-
|
4
|
-
<div class="text-center">
|
5
|
-
<small>
|
6
|
-
<%= link_help_text %>
|
7
|
-
</small>
|
8
|
-
</div>
|
1
|
+
<div class="text-center space-y-4">
|
2
|
+
<span class="block text-gray-2 text-xs"><%= link_help_text %></span>
|
3
|
+
<%= link_to link_to_resource_text, link_to_resource_url, class: "text-secondary hover:underline block" %>
|
9
4
|
</div>
|