From 6fd5fefeb30a251af369b83466c9e183a22bb792 Mon Sep 17 00:00:00 2001 From: Quentin Champenois <26109239+Quentinchampenois@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:57:47 +0200 Subject: [PATCH] fix: Hotfix remove endorsement list from proposals (#39) * fix: Override proposals show view * doc: Add entry to OVERLOADS.md * fix: Remove endorsers list in proposal show view * fix: Ignore false positive missing keys for proposal --- OVERLOADS.md | 3 + .../decidim/proposals/proposals/show.html.erb | 141 ++++++++++++++++++ config/i18n-tasks.yml | 1 + 3 files changed, 145 insertions(+) create mode 100644 app/views/decidim/proposals/proposals/show.html.erb diff --git a/OVERLOADS.md b/OVERLOADS.md index 86198a3b..30253f5f 100644 --- a/OVERLOADS.md +++ b/OVERLOADS.md @@ -1,5 +1,8 @@ # Overrides +## Remove endorsers list from proposals +* `app/views/decidim/proposals/proposals/show.html.erb` + ## 28c8d74 - Add basic tests to reference package (#1), 2021-07-26 * `lib/extends/commands/decidim/admin/create_participatory_space_private_user_extends.rb` * `lib/extends/commands/decidim/admin/impersonate_user_extends.rb` \ No newline at end of file diff --git a/app/views/decidim/proposals/proposals/show.html.erb b/app/views/decidim/proposals/proposals/show.html.erb new file mode 100644 index 00000000..b93bc68d --- /dev/null +++ b/app/views/decidim/proposals/proposals/show.html.erb @@ -0,0 +1,141 @@ +<% add_decidim_meta_tags({ + description: present(@proposal).body, + title: present(@proposal).title, + url: proposal_url(@proposal.id) + }) %> + +<% + edit_link( + resource_locator(@proposal).edit, + :edit, + :proposal, + proposal: @proposal + ) +%> + +<% + extra_admin_link( + resource_locator(@proposal).show(anchor: "proposal-answer"), + :create, + :proposal_answer, + { proposal: @proposal }, + { name: t(".answer"), icon: "comment-square" } + ) +%> + +<%= render partial: "voting_rules" %> +<% if component_settings.participatory_texts_enabled? %> +
+
+ <%= t(".back_to") %> <%= link_to translated_attribute(@participatory_text.title), main_component_path(current_component) %> +
+
+<% end %> +<%= emendation_announcement_for @proposal %> +
+ +
+ <%= link_to proposals_path, class: "small hollow js-back-to-list" do %> + <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %> + <%= t(".back_to_list") %> + <% end %> +
+ + <% if @proposal.emendation? %> +

<%= t(".changes_at_title", title: present(@proposal.amendable).title(links: true, html_escape: true)) %>

+ <% else %> +

<%= present(@proposal).title(links: true, html_escape: true) %>

+ <% end %> + <% unless component_settings.participatory_texts_enabled? %> + <%= cell("decidim/coauthorships", @proposal, has_actions: true, size: 3, context: { current_user: current_user }) %> + <% end %> +
+
+
+
+ <% if @proposal.emendation? %> + <%= cell("decidim/diff", proposal_presenter.versions.last) %> + <% elsif not ["section","subsection"].include? @proposal.participatory_text_level %> + <%== cell("decidim/proposals/proposal_m", @proposal, full_badge: true).badge %> + <%= render_proposal_body(@proposal) %> + <% end %> + <% if component_settings.geocoding_enabled? %> + <%= render partial: "decidim/shared/static_map", locals: { icon_name: "proposals", geolocalizable: @proposal } %> + <% end %> + <% if proposal_has_costs? && current_settings.answers_with_costs? %> + <%= cell("decidim/proposals/cost_report", @proposal) %> + <% end %> + <%= cell "decidim/proposals/proposal_tags", @proposal %> +
+ + <%= cell("decidim/announcement", proposal_reason_callout_announcement, callout_class: proposal_reason_callout_class) if @proposal.answered? && @proposal.published_state? %> + + <%= linked_resources_for @proposal, :results, "included_proposals" %> + <%= linked_resources_for @proposal, :projects, "included_proposals" %> + <%= linked_resources_for @proposal, :meetings, "proposals_from_meeting" %> + <%= linked_resources_for @proposal, :proposals, "copied_from_component" %> + + <%#= cell "decidim/endorsers_list", @proposal %> + <%= amendments_for @proposal %> +
+
+ <% if @proposal.amendable? && allowed_to?(:edit, :proposal, proposal: @proposal) %> + <%= link_to t(".edit_proposal"), edit_proposal_path(@proposal), class: "button hollow expanded button--sc" %> + <% else %> + <%= amend_button_for @proposal %> + <% end %> + + <%= emendation_actions_for @proposal %> + + <% if current_settings.votes_enabled? || show_endorsements_card? || current_user %> + <% if @proposal.withdrawn? %> +
+
+ <% if current_settings.votes_enabled? %> + <%= render partial: "votes_count", locals: { proposal: @proposal, from_proposals_list: false } %> + <% end %> +
+
+ <% else %> +
+
+ <% if current_settings.votes_enabled? %> + <%= render partial: "votes_count", locals: { proposal: @proposal, from_proposals_list: false } %> + <%= render partial: "vote_button", locals: { proposal: @proposal, from_proposals_list: false } %> + <% end %> +
+ <% if endorsements_enabled? %> +
+ <%= endorsement_buttons_cell(@proposal) %> +
+ <% end %> +
"> + <%= link_to "#comments", class: "button small compact hollow secondary button--nomargin expanded" do %> + <%= present(@proposal).title(html_escape: true) %> + <%= icon "comment-square", class: "icon--small", aria_label: t(".comments"), role: "img" %> <%= @proposal.comments_count %> + <% end %> +
+
+
+ <%= follow_button_for(@proposal) %> +
+
+ <% end %> + <% end %> + + <%= amenders_list_for(@proposal) %> + + <%= resource_reference(@proposal) %> + <%= resource_version(proposal_presenter, versions_path: proposal_versions_path(@proposal)) %> + <%= cell("decidim/fingerprint", @proposal) %> + <%= render partial: "decidim/shared/share_modal", locals: { resource: @proposal } %> + <%= embed_modal_for proposal_widget_url(@proposal, format: :js) %> + <%= cell "decidim/proposals/proposal_link_to_collaborative_draft", @proposal %> + <%= cell "decidim/proposals/proposal_link_to_rejected_emendation", @proposal %> +
+
+<%= attachments_for @proposal %> + +<%= comments_for @proposal %> + +<%= cell("decidim/flag_modal", @proposal) %> diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index a779b521..8db96297 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -100,6 +100,7 @@ ignore_missing: - devise.shared.links.forgot_your_password - devise.shared.links.sign_in_with_provider - layouts.decidim.header.user_menu + - decidim.proposals.proposals.show.* # Consider these keys used: ignore_unused: