2023-04-03 22:22:02 +02:00
|
|
|
<div class="mx-auto max-w-xl mx-4 lg:mx-0">
|
|
|
|
<header>
|
2023-04-04 15:36:57 +02:00
|
|
|
<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">
|
2023-04-10 12:08:19 +02:00
|
|
|
<span>Published</span>
|
|
|
|
<time class="text-theme-primary font-semibold"><%= pretty_date(@note.published_at) %></time>
|
2023-04-06 15:21:03 +02:00
|
|
|
<span>·</span>
|
2023-04-10 12:08:19 +02:00
|
|
|
<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 %>
|
2023-04-10 12:08:19 +02:00
|
|
|
<span>·</span>
|
|
|
|
<a href={~p"/admin/notes/#{@note}/edit"} class="text-theme-primary font-semibold">Edit</a>
|
2023-04-09 13:43:54 +02:00
|
|
|
<% end %>
|
2023-04-03 22:22:02 +02:00
|
|
|
</p>
|
|
|
|
</header>
|
2023-03-15 19:16:01 +01:00
|
|
|
|
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 %>
|
2023-04-10 12:08:19 +02:00
|
|
|
<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)}
|
|
|
|
>
|
|
|
|
<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 %>
|
2023-04-10 12:08:19 +02:00
|
|
|
</div>
|