33 lines
No EOL
1.2 KiB
Text
33 lines
No EOL
1.2 KiB
Text
<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">
|
|
<%= @note.name %>
|
|
</h1>
|
|
<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>
|
|
<%= if @current_user do %>
|
|
<span>·</span>
|
|
<a href={~p"/admin/notes/#{@note}/edit"} class="text-theme-primary font-semibold">Edit</a>
|
|
<% end %>
|
|
</p>
|
|
</header>
|
|
|
|
<section class="prose mt-8">
|
|
<%= Markdown.render(@note.content) |> raw %>
|
|
</section>
|
|
|
|
<%= if !Enum.empty?(@note.images) do %>
|
|
<.line />
|
|
|
|
<div class="flex flex-wrap gap-3">
|
|
<%= 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)}>
|
|
<img src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
|
|
/>
|
|
</a>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div> |