2023-03-15 19:16:01 +01:00
|
|
|
<header>
|
|
|
|
<h1 class="text-lg font-semibold leading-8 text-theme-heading"><%= @note.name %></h1>
|
|
|
|
<p class="mt-2 text-sm leading-6 text-theme-muted">
|
|
|
|
<%= pretty_date(@note.published_at) %>
|
|
|
|
</p>
|
|
|
|
</header>
|
|
|
|
|
2023-03-13 03:26:39 +01:00
|
|
|
|
|
|
|
<section class="prose mt-8">
|
|
|
|
<%= Markdown.render(@note.content) |> raw %>
|
|
|
|
</section>
|
2023-03-13 05:59:40 +01:00
|
|
|
|
|
|
|
<%= if !Enum.empty?(@note.images) do %>
|
|
|
|
<.line />
|
|
|
|
|
2023-03-22 08:36:45 +01:00
|
|
|
<div class="flex flex-wrap gap-3" id="images">
|
2023-03-13 05:59:40 +01:00
|
|
|
<%= for image <- @note.images do %>
|
|
|
|
<article>
|
|
|
|
<a href={"#image-#{image.id}"}>
|
|
|
|
<img
|
2023-03-22 10:39:58 +01:00
|
|
|
class="rounded-lg w-28 border"
|
2023-03-23 08:17:47 +01:00
|
|
|
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
|
2023-03-13 05:59:40 +01:00
|
|
|
/>
|
|
|
|
</a>
|
2023-03-22 08:36:45 +01:00
|
|
|
<a href="#images" class="lightbox" id={"image-#{image.id}"}>
|
2023-03-23 08:17:47 +01:00
|
|
|
<span style={"background-image: url('#{ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}')"}>
|
2023-03-13 05:59:40 +01:00
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</article>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|