This commit is contained in:
Rüdiger Diedrich
2022-07-21 18:42:42 +02:00
parent 7035fe5b2d
commit de9afd2907
8 changed files with 191 additions and 24 deletions

View File

@ -1,5 +1,3 @@
<h1>Show Thread</h1>
<%= if @live_action in [:edit] do %>
<.modal return_to={Routes.thread_show_path(@socket, :show, @thread)}>
<.live_component
@ -13,19 +11,18 @@
</.modal>
<% end %>
<ul>
<h2>
<%= @thread.title %>
</h2>
<li>
<strong>Title:</strong>
<%= @thread.title %>
</li>
<div class="thread my-8">
<%= for post <- @thread.posts do %>
<.post author={post.userinfo} article={post.postbody} />
<% end %>
</div>
<li>
<strong>Thread:</strong>
<%= @thread.thread_id %>
</li>
</ul>
<span><%= live_patch "Edit", to: Routes.thread_show_path(@socket, :edit, @thread), class: "button" %></span> |
<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>