36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
<.header>
|
|
<a href={@article.url}><%= @article.title %></a>
|
|
<:subtitle>
|
|
<div class="flex">
|
|
<div class="p-4"><%= @article.author.name %></div>
|
|
<div class="p-4"><%= @article.date %></div>
|
|
</div>
|
|
</:subtitle>
|
|
<:actions>
|
|
<.link patch={~p"/articles/#{@article}/show/edit"} phx-click={JS.push_focus()}>
|
|
<.button>Edit article</.button>
|
|
</.link>
|
|
</:actions>
|
|
</.header>
|
|
|
|
<div class="article">
|
|
<a href="#" class="show-link" phx-click={JS.add_class("show-boundary", to: ".article")}>show boundaries</a>
|
|
<a href="#" class="hide-link" phx-click={JS.remove_class("show-boundary", to: ".article")}>hide boundaries</a>
|
|
<%= InternalTree.render_html(@article.content) |> raw %>
|
|
</div>
|
|
|
|
<.link navigate={~p"/translations/new?article_id=#{@article.id}"}>New Translation</.link>
|
|
|
|
<.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>
|