Add autoren and artikel for public viewing
This commit is contained in:
20
lib/outlook_web/controllers/autor_html/index.html.heex
Normal file
20
lib/outlook_web/controllers/autor_html/index.html.heex
Normal file
@ -0,0 +1,20 @@
|
||||
<.header>
|
||||
Listing Autoren
|
||||
<:actions>
|
||||
<.link href={~p"/autoren/new"}>
|
||||
<.button>New Autor</.button>
|
||||
</.link>
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<.table id="autoren" rows={@autoren} row_click={&JS.navigate(~p"/autoren/#{&1}")}>
|
||||
<:col :let={autor} label="Name"><%= autor.name %></:col>
|
||||
<:col :let={autor} label="Description"><%= autor.description %></:col>
|
||||
<:col :let={autor} label="Homepage name"><%= autor.homepage_name %></:col>
|
||||
<:col :let={autor} label="Homepage url"><%= autor.homepage_url %></:col>
|
||||
<:action :let={autor}>
|
||||
<div class="sr-only">
|
||||
<.link navigate={~p"/autoren/#{autor}"}>Show</.link>
|
||||
</div>
|
||||
</:action>
|
||||
</.table>
|
||||
16
lib/outlook_web/controllers/autor_html/show.html.heex
Normal file
16
lib/outlook_web/controllers/autor_html/show.html.heex
Normal file
@ -0,0 +1,16 @@
|
||||
<.header>
|
||||
<%= @autor.name %>
|
||||
<:subtitle><div class="text-lg mb-2"><%= @autor.description %></div></:subtitle>
|
||||
<:subtitle><.link href={@autor.homepage_url}><%= @autor.homepage_name %></.link></:subtitle>
|
||||
</.header>
|
||||
|
||||
|
||||
|
||||
<%= for article <- @autor.articles do %>
|
||||
<div :for={translation <- article.translations} class="my-2 px-2 rounded border-2 border-solid border-gray-300">
|
||||
<.link navigate={~p"/artikel/#{translation}"}><h4 class="font-bold py-2"><%= translation.title %></h4></.link>
|
||||
<div><%= translation.teaser %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<.back navigate={~p"/autoren"}>Back to autoren</.back>
|
||||
Reference in New Issue
Block a user