mix phx.gen.live Articles Article articles title:string\ /Crucial/git/phoenix-liveview-book content:text url:string language:string\ date:utc_datetime author_id:references:authors
31 lines
956 B
Plaintext
31 lines
956 B
Plaintext
<.header>
|
|
Article <%= @article.id %>
|
|
<:subtitle>This is a article record from your database.</:subtitle>
|
|
<:actions>
|
|
<.link patch={~p"/articles/#{@article}/show/edit"} phx-click={JS.push_focus()}>
|
|
<.button>Edit article</.button>
|
|
</.link>
|
|
</:actions>
|
|
</.header>
|
|
|
|
<.list>
|
|
<:item title="Title"><%= @article.title %></:item>
|
|
<:item title="Content"><%= @article.content %></:item>
|
|
<:item title="Url"><%= @article.url %></:item>
|
|
<:item title="Language"><%= @article.language %></:item>
|
|
<:item title="Date"><%= @article.date %></:item>
|
|
</.list>
|
|
|
|
<.back navigate={~p"/articles"}>Back to articles</.back>
|
|
|
|
<.modal :if={@live_action == :edit} id="article-modal" show on_cancel={JS.patch(~p"/articles/#{@article}")}>
|
|
<.live_component
|
|
module={OutlookWeb.ArticleLive.FormComponent}
|
|
id={@article.id}
|
|
title={@page_title}
|
|
action={@live_action}
|
|
article={@article}
|
|
navigate={~p"/articles/#{@article}"}
|
|
/>
|
|
</.modal>
|