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

64 lines
2.1 KiB
Text
Raw Normal View History

<article class="h-entry hentry">
<header class="mx-auto max-w-2xl">
<h1 class="mt-16 lg:text-5xl md:text-4xl text-3xl font-bold text-theme-base | p-name">
2023-04-03 22:22:02 +02:00
<%= @note.name %>
</h1>
2023-05-23 22:19:37 +02:00
<p class="mt-2 leading-6 text-theme-base">
2023-04-30 11:56:45 +02:00
<%= if @note.published_at do %>
2023-05-07 10:32:26 +02:00
<span>Published</span>
2023-04-30 11:56:45 +02:00
<% else %>
2023-05-07 10:32:26 +02:00
<span>Unpublished</span>
2023-04-30 11:56:45 +02:00
<% end %>
<time class="font-semibold | dt-published"><%= pretty_date(@note.published_at) %></time>
2023-05-23 22:19:37 +02:00
<.dot />
2023-04-10 12:08:19 +02:00
<span>Last Updated</span>
<time class="font-semibold" datetime={datetime(@note.updated_at)}><%= pretty_date(@note.updated_at) %></time>
2023-05-20 19:26:58 +02:00
<%= if not Enum.empty?(@note.tags) do %>
<.dot />
<span>Tags</span>
<span>
<%= for tag <- @note.tags do %>
2023-06-02 07:07:22 +02:00
<a href={~p"/tagged-with/#{tag.slug}"} class="underline-link font-semibold">
<%= tag.name %>
</a>
<% end %>
</span>
2023-05-20 19:26:58 +02:00
<% end %>
2023-04-09 13:43:54 +02:00
<%= if @current_user do %>
2023-05-23 22:19:37 +02:00
<.dot />
<a href={~p"/admin/notes/#{@note}"} class="underline-link font-semibold">Show in Admin</a>
2023-04-09 13:43:54 +02:00
<% end %>
2023-04-03 22:22:02 +02:00
</p>
</header>
<section class="mx-auto mt-8 prose prose-gruvbox md:prose-lg lg:prose-xl | p-summary e-content">
2023-04-03 22:22:02 +02:00
<%= Markdown.render(@note.content) |> raw %>
</section>
2023-03-13 03:26:39 +01:00
<footer class="mt-8 mx-auto max-w-2xl">
<a href={~p"/note/#{@note.slug}"} class="text-theme-base underline-link font-semibold | u-url u-uid">Permalink</a>
2023-06-30 13:18:32 +02:00
</footer>
<section class="mt-8 mx-auto max-w-2xl">
2023-05-22 20:05:44 +02:00
<%= if !Enum.empty?(@note.images) do %>
<.line />
2023-03-13 05:59:40 +01:00
2023-05-22 20:05:44 +02:00
<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)}
class="rounded"
/>
</a>
<% end %>
</div>
<% end %>
2023-05-22 20:05:44 +02:00
</section>
</article>