Files
something-erlang/lib/something_erlang_web/live/thread_live/show.html.heex
Rüdiger Diedrich de9afd2907 grover
2022-07-21 18:42:42 +02:00

29 lines
837 B
Plaintext

<%= if @live_action in [:edit] do %>
<.modal return_to={Routes.thread_show_path(@socket, :show, @thread)}>
<.live_component
module={SomethingErlangWeb.ThreadLive.FormComponent}
id={@thread.id}
title={@page_title}
action={@live_action}
thread={@thread}
return_to={Routes.thread_show_path(@socket, :show, @thread)}
/>
</.modal>
<% end %>
<h2>
<%= @thread.title %>
</h2>
<div class="thread my-8">
<%= for post <- @thread.posts do %>
<.post author={post.userinfo} article={post.postbody} />
<% end %>
</div>
<span><%= live_redirect "Back", to: Routes.thread_index_path(@socket, :index) %></span>
<span><%= @thread.page %></span>
<span><%= live_redirect "Next Page", class: "link",
to: Routes.thread_show_path(@socket, :show, @thread.id, page: @thread.page+1) %></span>