diff --git a/lib/outlook/public.ex b/lib/outlook/public.ex index 3b1474e..f8b5644 100644 --- a/lib/outlook/public.ex +++ b/lib/outlook/public.ex @@ -45,7 +45,7 @@ implement to_param protocol (no more needed for Outlook.Translations.Translation url_org: a.url, date_org: a.date, autor_name: au.name, - author_id: au.id + autor_id: au.id ], where: t.id == ^id and t.public == true case Repo.one(q) do diff --git a/lib/outlook/public/artikel.ex b/lib/outlook/public/artikel.ex index 2c803c7..55feac2 100644 --- a/lib/outlook/public/artikel.ex +++ b/lib/outlook/public/artikel.ex @@ -11,7 +11,7 @@ defmodule Outlook.Public.Artikel do field :url_org, :string field :date_org, :utc_datetime field :autor_name, :string - field :author_id, :integer + field :autor_id, :integer field :teaser, :string # field :autor, Autor end diff --git a/lib/outlook/public/autor.ex b/lib/outlook/public/autor.ex new file mode 100644 index 0000000..9e8c58c --- /dev/null +++ b/lib/outlook/public/autor.ex @@ -0,0 +1,13 @@ +defmodule Outlook.Public.Autor do + use Ecto.Schema + + alias Outlook.Public.Artikel + + embedded_schema do + field :name, :string + field :description, :string + field :homepage_name, :string + field :homepage_url, :string + has_many :artikel, Artikel + end +end diff --git a/lib/outlook_web/controllers/artikel_html/show.html.heex b/lib/outlook_web/controllers/artikel_html/show.html.heex index fa2390b..8542ec4 100644 --- a/lib/outlook_web/controllers/artikel_html/show.html.heex +++ b/lib/outlook_web/controllers/artikel_html/show.html.heex @@ -1,6 +1,6 @@

<%= @artikel.title %>

-

<.link href={~p"/autoren/#{@artikel.author_id}"}><%= @artikel.autor_name %> +

<.link href={~p"/autoren/#{@artikel.autor_id}"}><%= @artikel.autor_name %>     —    <%= Calendar.strftime(@artikel.date_org, "%d.%m.%Y") %>

Original Artikel: <.link class="hover:text-sky-700" href={@artikel.url_org} > @@ -14,4 +14,4 @@
<%= @artikel.public_content |> raw %>
-<.back navigate={~p"/autoren/#{@artikel.author_id}"}>Back to Autor +<.back navigate={~p"/autoren/#{@artikel.autor_id}"}>Back to Autor