defmodule OutlookWeb.PublicComponents do @moduledoc """ Provides components for showing and listing artikel and autoren. """ use Phoenix.Component import OutlookWeb.ViewHelpers use Phoenix.VerifiedRoutes, endpoint: OutlookWeb.Endpoint, router: OutlookWeb.Router, statics: OutlookWeb.static_paths() import Phoenix.HTML alias Phoenix.LiveView.JS attr :autor, :any, required: true def autor(assigns) do ~H"""
<%= @autor.name %>
<%= @autor.description |> tidy_raw %>
""" end attr :artikel, :any, required: true attr :show_author, :boolean, default: true def artikel(assigns) do ~H""" <.link navigate={~p"/artikel/#{@artikel}"}>

<%= @artikel.title %>

<%= @artikel.article.author.name %>
<%= @artikel.date |> Calendar.strftime("%d.%m.%Y") %>
<%= @artikel.teaser |> tidy_raw %>
""" end end