Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Dec 30, 2024
1 parent a553bf0 commit 123cb99
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
4 changes: 3 additions & 1 deletion app/controllers/decidim/ideas/admin/ideas_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/decidim/ideas/admin/ideas/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<div class="row column">
<fieldset>
<legend><%= t(".image_legend") %></legend>
<%= form.fields_for :image, @form.image do |nested_form| %>
<%= form.fields_for :add_images, @form.attachment do |nested_form| %>
<div class="row column">
<%= nested_form.text_field :title %>
</div>
Expand Down
18 changes: 0 additions & 18 deletions app/views/decidim/ideas/admin/ideas/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,6 @@
</div>
</div>

<div class="card-section">
<div class="row column" data-supports>
<span class="component__show-title"><%= t ".votes_count" %></span>
<div class="flex items-center gap-x-2 mt-2">
<%= icon "service-line", class: "fill-gray" %>
<p class="component__show-icon-text" data-count>
<%= idea.idea_votes_count %>
</p>
<div class="flex items-center gap-x-2 border-l border-gray pl-2">
<%= icon "bar-chart-2-line", class: "fill-gray" %>
<p class="component__show-icon-text" data-ranking>
<%= i18n_votes_ranking_for(idea) %>
</p>
</div>
</div>
</div>
</div>

<% if idea.documents.any? %>
<div class="row column">
<strong><%= t ".documents" %>:</strong>
Expand Down

0 comments on commit 123cb99

Please sign in to comment.