Add long urls for Artikel

This commit is contained in:
Thelonius Kort
2023-02-12 18:43:30 +01:00
parent 239177db50
commit b0267ef752
7 changed files with 54 additions and 10 deletions

View File

@ -3,6 +3,12 @@ defmodule OutlookWeb.PublicComponents do
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
@ -25,7 +31,7 @@ defmodule OutlookWeb.PublicComponents do
def artikel(assigns) do
~H"""
<.link navigate={"/artikel/#{@artikel.id}"}>
<.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>