Add Articles
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
This commit is contained in:
30
lib/outlook_web/live/article_live/show.html.heex
Normal file
30
lib/outlook_web/live/article_live/show.html.heex
Normal file
@ -0,0 +1,30 @@
|
||||
<.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>
|
||||
Reference in New Issue
Block a user