Skip to content

Commit

Permalink
Merge pull request #43 from takahashim/update-blogs-posts-show
Browse files Browse the repository at this point in the history
update blogs posts template from v0.28.3
  • Loading branch information
ayuki-joto authored Dec 26, 2024
2 parents a4e1d25 + 225c828 commit ec86adf
Showing 1 changed file with 32 additions and 42 deletions.
74 changes: 32 additions & 42 deletions app/views/decidim/blogs/posts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,38 @@
)
%>

<div class="row column view-header">
<div class="m-bottom">
<%= link_to :posts, class: "small hollow" do %>
<%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
<%= t(".back") %>
<% end %>
</div>
<h2 class="heading2"><%= translated_attribute post.title %></h2>
<%= append_javascript_pack_tag "decidim_blogs" %>
<%= append_stylesheet_pack_tag "decidim_blogs" %>

<%= render layout: "layouts/decidim/shared/layout_center", locals: { columns: 8 } do %>

<section class="layout-main__section layout-main__heading">
<div class="flex justify-center">
<h1 class="title-decorator my-12"><%= translated_attribute post.title %></h1>
</div>

<% post_presenter = Decidim::Blogs::PostPresenter.new(post) %>
<%= cell "decidim/author", post_presenter.author, from: post %>
</div>
<div class="row">
<% if show_endorsements_card? %>
<div class="columns section view-side mediumlarge-4 mediumlarge-push-8 large-3 large-push-9">
<div class="card">
<div class="card__content">
<div class="row collapse buttons__row">
<% if endorsements_enabled? %>
<div class="column small-9 collapse">
<%= endorsement_buttons_cell(post) %>
</div>
<% end %>
<div class="column collapse <%= endorsements_enabled? ? "small-3" : "" %>">
<%= link_to "#comments", class: "button small compact hollow button--nomargin expanded" do %>
<%= icon "comment-square", class: "icon--small", aria_label: t(".comments"), role: "img" %> <%= post.comments_count %>
<% end %>
</div>
</div>
<br>
<%= follow_button_for(post) %>
</div>
</div>
<% if post.photo.present? %>
<div class="blog__image grow">
<%= image_tag post.photo.big_url, alt: post.photo.description || post.photo.title || t("alt", scope: "decidim.application.photo") %>
</div>
<% end %>
<div class="columns mediumlarge-8 <%= "mediumlarge-pull-4" if show_endorsements_card? %>">
<div class="section">
<%= decidim_sanitize_editor_admin translated_attribute(post.body) %>
<% end %>

<div class="layout-author">
<%= cell "decidim/author", post_presenter.author, from: post, context_actions: [:date], layout: :compact %>
</div>
<%= cell "decidim/endorsers_list", post %>
</div>
</div>
<%= attachments_for post %>
<%= comments_for post %>
<%= cell("decidim/flag_modal", post) %>
</section>

<section class="layout-main__section">
<div class="editor-content">
<%= decidim_sanitize_editor_admin translated_attribute post.body %>
</div>

<%= attachments_for post %>

<%= render partial: "actions" %>
</section>

<section class="layout-main__section">
<%= comments_for post %>
</section>
<% end %>

0 comments on commit ec86adf

Please sign in to comment.