summaryrefslogtreecommitdiff
path: root/lib/aggiedit_web/live/post_live/show.html.heex
blob: fd57bbbe0248665b4072c4958590391909a37aed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<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}
      current_user={@current_user}
      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>