Add embedded schema for Artikel

This commit is contained in:
Thelonius Kort
2023-02-28 23:38:56 +01:00
parent ed98f4cbc4
commit 02e6340c0a
6 changed files with 114 additions and 7 deletions

View File

@ -23,14 +23,14 @@ defmodule OutlookWeb.PublicComponents do
end
attr :artikel, :any, required: true
attr :show_author, :boolean, default: true
attr :show_autor, :boolean, default: true
def artikel(assigns) do
~H"""
<.link navigate={~p"/artikel/#{@artikel}"}>
<div class="my-2 px-2 rounded border-2 border-solid border-gray-300 dark:border-stone-800">
<h4 class="font-bold text-stone-800 dark:text-stone-300 py-2"><%= @artikel.title %></h4>
<div :if={@show_author}><small><%= @artikel.article.author.name %></small></div>
<div :if={@show_autor}><small><%= @artikel.autor_name %></small></div>
<div><small><%= @artikel.date |> Calendar.strftime("%d.%m.%Y") %></small></div>
<div><%= @artikel.teaser |> tidy_raw %></div>
</div>