Add importing html and save it to Article
Additionally defines a wizard logic which is partially unused yet.
This commit is contained in:
@ -13,7 +13,7 @@ defmodule OutlookWeb.AuthorLive.Show do
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(:page_title, page_title(socket.assigns.live_action))
|
||||
|> assign(:author, Authors.get_author!(id))}
|
||||
|> assign(:author, Authors.get_author_with_articles!(id))}
|
||||
end
|
||||
|
||||
defp page_title(:show), do: "Show Author"
|
||||
|
||||
@ -18,6 +18,26 @@
|
||||
<:item title="Homepage url"><%= @author.homepage_url %></:item>
|
||||
</.list>
|
||||
|
||||
<.table id="articles" rows={@author.articles} row_click={&JS.navigate(~p"/articles/#{&1}")}>
|
||||
<:col :let={article} label="Title"><%= article.title %></:col>
|
||||
<%!-- <:col :let={article} label="Content"><%= article.content %></:col> --%>
|
||||
<:col :let={article} label="Url"><%= article.url %></:col>
|
||||
<:col :let={article} label="Language"><%= article.language %></:col>
|
||||
<:col :let={article} label="Date"><%= article.date %></:col>
|
||||
<:action :let={article}>
|
||||
<div class="sr-only">
|
||||
<.link navigate={~p"/articles/#{article}"}>Show</.link>
|
||||
</div>
|
||||
<.link patch={~p"/articles/#{article}/edit"}>Edit</.link>
|
||||
</:action>
|
||||
<:action :let={article}>
|
||||
<.link phx-click={JS.push("delete", value: %{id: article.id})} data-confirm="Are you sure?">
|
||||
Delete
|
||||
</.link>
|
||||
</:action>
|
||||
</.table>
|
||||
|
||||
|
||||
<.back navigate={~p"/authors"}>Back to authors</.back>
|
||||
|
||||
<.modal :if={@live_action == :edit} id="author-modal" show on_cancel={JS.patch(~p"/authors/#{@author}")}>
|
||||
|
||||
Reference in New Issue
Block a user