2022-04-06 14:55:12 -04:00
|
|
|
<h1>Show Post</h1>
|
|
|
|
|
|
|
|
<%= if @live_action in [:edit] do %>
|
2022-04-13 16:17:28 -04:00
|
|
|
<.modal return_to={Routes.post_show_path(@socket, :show, @room, @post)}>
|
2022-04-06 14:55:12 -04:00
|
|
|
<.live_component
|
|
|
|
module={AggieditWeb.PostLive.FormComponent}
|
|
|
|
id={@post.id}
|
2022-04-13 14:42:01 -04:00
|
|
|
current_user={@current_user}
|
2022-04-06 14:55:12 -04:00
|
|
|
title={@page_title}
|
|
|
|
action={@live_action}
|
|
|
|
post={@post}
|
2022-04-13 16:17:28 -04:00
|
|
|
return_to={Routes.post_show_path(@socket, :show, @room, @post)}
|
2022-04-06 14:55:12 -04:00
|
|
|
/>
|
|
|
|
</.modal>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<strong>Title:</strong>
|
|
|
|
<%= @post.title %>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<strong>Body:</strong>
|
|
|
|
<%= @post.body %>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
2022-04-13 16:17:28 -04:00
|
|
|
<span><%= live_patch "Edit", to: Routes.post_show_path(@socket, :edit, @room, @post), class: "button" %></span> |
|
|
|
|
<span><%= live_redirect "Back", to: Routes.post_index_path(@socket, :index, @room) %></span>
|