Skip to content

Commit

Permalink
Merge pull request #555 from codeforjapan/update-blogs-show
Browse files Browse the repository at this point in the history
Update a view file of `blogs#show`
  • Loading branch information
ayuki-joto authored Sep 21, 2023
2 parents 5de7423 + b37e1ca commit 2b2a27e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/views/decidim/blogs/posts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
description: translated_attribute(post.body).truncate(Rails.application.config.default_blog_ogp_description_limit),
url: post_url(post.id)
}) %>

<%
doc = Nokogiri::HTML(translated_attribute(post.body))
img = doc.css('img')&.first
Expand All @@ -27,7 +28,9 @@
<% end %>
</div>
<h2 class="heading2"><%= translated_attribute post.title %></h2>
<%= cell "decidim/author", present(post.author), from: post %>

<% post_presenter = Decidim::Blogs::PostPresenter.new(post) %>
<%= cell "decidim/author", post_presenter.author, from: post %>
</div>
<div class="row">
<% if show_endorsements_card? %>
Expand All @@ -54,10 +57,11 @@
<% end %>
<div class="columns mediumlarge-8 <%= "mediumlarge-pull-4" if show_endorsements_card? %>">
<div class="section">
<%= decidim_sanitize_editor translated_attribute post.body %>
<%= decidim_sanitize_editor_admin translated_attribute(post.body) %>
</div>
<%= cell "decidim/endorsers_list", post %>
</div>
</div>
<%= attachments_for post %>
<%= comments_for post %>
<%= cell("decidim/flag_modal", post) %>

0 comments on commit 2b2a27e

Please sign in to comment.