summaryrefslogtreecommitdiff
path: root/lib/aggiedit_web/live/post_live/show.html.heex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/aggiedit_web/live/post_live/show.html.heex')
-rw-r--r--lib/aggiedit_web/live/post_live/show.html.heex31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/aggiedit_web/live/post_live/show.html.heex b/lib/aggiedit_web/live/post_live/show.html.heex
new file mode 100644
index 0000000..e6eaebe
--- /dev/null
+++ b/lib/aggiedit_web/live/post_live/show.html.heex
@@ -0,0 +1,31 @@
+<h1>Show Post</h1>
+
+<%= if @live_action in [:edit] do %>
+ <.modal return_to={Routes.post_show_path(@socket, :show, @post)}>
+ <.live_component
+ module={AggieditWeb.PostLive.FormComponent}
+ id={@post.id}
+ title={@page_title}
+ action={@live_action}
+ post={@post}
+ return_to={Routes.post_show_path(@socket, :show, @post)}
+ />
+ </.modal>
+<% end %>
+
+<ul>
+
+ <li>
+ <strong>Title:</strong>
+ <%= @post.title %>
+ </li>
+
+ <li>
+ <strong>Body:</strong>
+ <%= @post.body %>
+ </li>
+
+</ul>
+
+<span><%= live_patch "Edit", to: Routes.post_show_path(@socket, :edit, @post), class: "button" %></span> |
+<span><%= live_redirect "Back", to: Routes.post_index_path(@socket, :index) %></span>