Merge pull request 'devel' (#232) from devel into main

Reviewed-on: #232
This commit is contained in:
inhji 2023-07-25 07:32:35 +02:00
commit 6b22726198
2 changed files with 13 additions and 2 deletions

View file

@ -56,7 +56,7 @@ defmodule Chiya.Notes.Note do
end end
def note_path_admin(note) do def note_path_admin(note) do
~p"/admin/note/#{note.slug}" ~p"/admin/notes/#{note.slug}"
end end
def note_url(note) do def note_url(note) do

View file

@ -123,6 +123,10 @@ defmodule ChiyaWeb.PublicComponents do
attr :notes, :list, required: true attr :notes, :list, required: true
@doc """
Default note list that renders a list of rounded boxes,
which show the note title and an excerpt of the content
"""
def note_list_headers(assigns) do def note_list_headers(assigns) do
~H""" ~H"""
<section class="note-list default | mt-6 sm:w-auto flex flex-col gap-3"> <section class="note-list default | mt-6 sm:w-auto flex flex-col gap-3">
@ -158,9 +162,16 @@ defmodule ChiyaWeb.PublicComponents do
<article class="mt-4 first:mt-0"> <article class="mt-4 first:mt-0">
<.featured_images note={note} /> <.featured_images note={note} />
<div class="prose prose-gruvbox mt-2"> <header class="mt-4 text-lg">
<%= if(note.kind == :bookmark) do %>
<strong><%= note.name %></strong>
<% end %>
</header>
<div class="prose prose-gruvbox mt-4">
<%= raw(render(note.content)) %> <%= raw(render(note.content)) %>
</div> </div>
<footer class="mt-4"> <footer class="mt-4">
<time class="text-theme-base/75"> <time class="text-theme-base/75">
<%= pretty_datetime(note.published_at) %> <%= pretty_datetime(note.published_at) %>