From 123cb99b80f73170534b201cee3a9900a2ca0b32 Mon Sep 17 00:00:00 2001 From: Joonas Date: Mon, 30 Dec 2024 11:17:31 +0200 Subject: [PATCH] Fix bugs --- .../decidim/ideas/admin/ideas_controller.rb | 4 +++- .../value_types/idea_title_body_presenter.rb | 2 +- .../decidim/ideas/admin/ideas/_form.html.erb | 2 +- .../decidim/ideas/admin/ideas/show.html.erb | 18 ------------------ 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/app/controllers/decidim/ideas/admin/ideas_controller.rb b/app/controllers/decidim/ideas/admin/ideas_controller.rb index 28e3e63..22002cc 100644 --- a/app/controllers/decidim/ideas/admin/ideas_controller.rb +++ b/app/controllers/decidim/ideas/admin/ideas_controller.rb @@ -19,7 +19,9 @@ def show def new enforce_permission_to :create, :idea - @form = form(Admin::IdeaForm) + @form = form(Admin::IdeaForm).from_params( + attachment: form(Decidim::AttachmentForm).from_params({}) + ) end def create diff --git a/app/presenters/decidim/ideas/admin_log/value_types/idea_title_body_presenter.rb b/app/presenters/decidim/ideas/admin_log/value_types/idea_title_body_presenter.rb index ec62d11..665cfdf 100644 --- a/app/presenters/decidim/ideas/admin_log/value_types/idea_title_body_presenter.rb +++ b/app/presenters/decidim/ideas/admin_log/value_types/idea_title_body_presenter.rb @@ -8,7 +8,7 @@ class IdeaTitleBodyPresenter < Decidim::Log::ValueTypes::DefaultPresenter def present return unless value - renderer = Decidim::ContentRenderers::HashtagRenderer.new(value) + renderer = Decidim::ContentRenderers::HashtagRenderer.new(h.decidim_escape_translated(value)) renderer.render(links: false).html_safe end end diff --git a/app/views/decidim/ideas/admin/ideas/_form.html.erb b/app/views/decidim/ideas/admin/ideas/_form.html.erb index 3554549..cf3b2a8 100644 --- a/app/views/decidim/ideas/admin/ideas/_form.html.erb +++ b/app/views/decidim/ideas/admin/ideas/_form.html.erb @@ -82,7 +82,7 @@
<%= t(".image_legend") %> - <%= form.fields_for :image, @form.image do |nested_form| %> + <%= form.fields_for :add_images, @form.attachment do |nested_form| %>
<%= nested_form.text_field :title %>
diff --git a/app/views/decidim/ideas/admin/ideas/show.html.erb b/app/views/decidim/ideas/admin/ideas/show.html.erb index 2512f8a..af9df8b 100644 --- a/app/views/decidim/ideas/admin/ideas/show.html.erb +++ b/app/views/decidim/ideas/admin/ideas/show.html.erb @@ -94,24 +94,6 @@
-
-
- <%= t ".votes_count" %> -
- <%= icon "service-line", class: "fill-gray" %> -

- <%= idea.idea_votes_count %> -

-
- <%= icon "bar-chart-2-line", class: "fill-gray" %> -

- <%= i18n_votes_ranking_for(idea) %> -

-
-
-
-
- <% if idea.documents.any? %>
<%= t ".documents" %>: