mirror of
https://github.com/fergalmoran/malarkey.git
synced 2025-12-22 09:48:46 +00:00
30 lines
872 B
Plaintext
30 lines
872 B
Plaintext
<.header>
|
|
Post <%= @post.id %>
|
|
<:subtitle>This is a post record from your database.</:subtitle>
|
|
<:actions>
|
|
<.link patch={~p"/posts/#{@post}/show/edit"} phx-click={JS.push_focus()}>
|
|
<.button>Edit post</.button>
|
|
</.link>
|
|
</:actions>
|
|
</.header>
|
|
|
|
<.list>
|
|
<:item title="Username"><%= @post.user.username %></:item>
|
|
<:item title="Body"><%= @post.body %></:item>
|
|
<:item title="Likes count"><%= @post.likes_count %></:item>
|
|
<:item title="Repost count"><%= @post.repost_count %></:item>
|
|
</.list>
|
|
|
|
<.back navigate={~p"/posts"}>Back to posts</.back>
|
|
|
|
<.modal :if={@live_action == :edit} id="post-modal" show on_cancel={JS.patch(~p"/posts/#{@post}")}>
|
|
<.live_component
|
|
module={MalarkeyWeb.PostLive.FormComponent}
|
|
id={@post.id}
|
|
title={@page_title}
|
|
action={@live_action}
|
|
post={@post}
|
|
navigate={~p"/posts/#{@post}"}
|
|
/>
|
|
</.modal>
|