update
This commit is contained in:
parent
e2967f68b2
commit
ef2a6c41b4
39 changed files with 2349 additions and 30 deletions
30
lib/zoeyscomputer_web/live/image_live/show.html.heex
Normal file
30
lib/zoeyscomputer_web/live/image_live/show.html.heex
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<.header>
|
||||
uploaded by <%= @image.user.email %>
|
||||
<:actions>
|
||||
<%= if(@image.user.email == @current_user.email) do %>
|
||||
<.link patch={~p"/images/#{@image.file}/show/edit"} phx-click={JS.push_focus()}>
|
||||
<.button>Edit image</.button>
|
||||
</.link>
|
||||
<% end %>
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<img src={"https://s3.zoeys.computer/imgs/uploads/#{@image.file}.png"} />
|
||||
|
||||
<.back navigate={~p"/images"}>Back to images</.back>
|
||||
|
||||
<.modal
|
||||
:if={@live_action == :edit}
|
||||
id="image-modal"
|
||||
show
|
||||
on_cancel={JS.patch(~p"/images/#{@image.file}")}
|
||||
>
|
||||
<.live_component
|
||||
module={ZoeyscomputerWeb.ImageLive.FormComponent}
|
||||
id={@image.id}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
image={@image}
|
||||
patch={~p"/images/#{@image.file}"}
|
||||
/>
|
||||
</.modal>
|
||||
Loading…
Add table
Add a link
Reference in a new issue