chiya/lib/chiya_web/controllers/note_html/edit_image.html.heex
2023-07-24 22:35:46 +02:00

31 lines
1 KiB
Text

<.header>
Edit Image <%= @image.id %>
<:subtitle>Use this form to manage note image records in your database.</:subtitle>
</.header>
<img
class="rounded-lg border border-theme-dim"
src={ChiyaWeb.Uploaders.NoteImage.url({@image.path, @image}, :full_dithered)}
/>
<pre class="mt-4 p-1 bg-gray-100 text-black rounded select-all">![<%= @image.content %>](<%= ChiyaWeb.Uploaders.NoteImage.url({@image.path, @image}, :full_dithered) %>)</pre>
<.simple_form
:let={f}
for={@changeset}
action={~p"/admin/notes/#{@image.note.id}/image/#{@image.id}"}
>
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input field={f[:id]} type="hidden" value={@image.id} />
<.input field={f[:content]} type="textarea" label="Content" />
<.input field={f[:featured]} type="checkbox" label="Featured" />
<:actions>
<.button type="submit">Save</.button>
</:actions>
</.simple_form>
<.back navigate={~p"/admin/notes/#{@image.note_id}"}>Back to notes</.back>