chiya/lib/chiya_web/controllers/page_html/note.html.heex

32 lines
1.2 KiB
Text
Raw Normal View History

2023-04-03 22:22:02 +02:00
<div class="mx-auto max-w-xl mx-4 lg:mx-0">
<header>
<h1 class="mt-16 text-3xl font-semibold leading-8 text-theme-heading font-serif">
2023-04-03 22:22:02 +02:00
<%= @note.name %>
</h1>
2023-04-06 15:21:03 +02:00
<p class="mt-2 text-sm leading-6 text-theme-base">
<span>Published</span> <time class="text-theme-primary font-semibold"><%= pretty_date(@note.published_at) %></time>
<span>·</span>
<span>Last Updated</span> <time class="text-theme-primary font-semibold"><%= pretty_date(@note.updated_at) %></time>
2023-04-09 13:43:54 +02:00
<%= if @current_user do %>
<span>·</span>
<a href={~p"/admin/notes/#{@note}/edit"} class="text-theme-primary font-semibold">Edit</a>
<% end %>
2023-04-03 22:22:02 +02:00
</p>
</header>
2023-04-03 22:22:02 +02:00
<section class="prose mt-8">
<%= Markdown.render(@note.content) |> raw %>
</section>
2023-03-13 03:26:39 +01:00
2023-04-03 22:22:02 +02:00
<%= if !Enum.empty?(@note.images) do %>
<.line />
2023-03-13 05:59:40 +01:00
2023-04-06 14:21:59 +02:00
<div class="flex flex-wrap gap-3">
2023-04-03 22:22:02 +02:00
<%= for image <- @note.images do %>
<a href={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)} class="lightbox | w-28" data-gallery="note" data-description={ChiyaWeb.Markdown.render(image.content)}>
2023-04-09 13:52:26 +02:00
<img src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)} class="rounded"/>
2023-04-06 14:21:59 +02:00
</a>
2023-04-03 22:22:02 +02:00
<% end %>
</div>
<% end %>
</div>