2023-09-08 13:01:26 +02:00
|
|
|
<article class="h-entry hentry | stack container">
|
2023-09-08 13:18:29 +02:00
|
|
|
<header>
|
2023-09-08 13:01:26 +02:00
|
|
|
<h1 class="p-name | text-3xl leading-10 font-bold text-theme-base1">
|
|
|
|
<%= @note.name %>
|
|
|
|
</h1>
|
|
|
|
</header>
|
2023-03-15 19:16:01 +01:00
|
|
|
|
2023-09-08 13:01:26 +02:00
|
|
|
<section class="print:hidden">
|
|
|
|
<ul class="flex gap-3">
|
|
|
|
<li>
|
|
|
|
<a href={~p"/admin/notes/#{@note}/edit"} class="button">
|
2023-09-09 10:24:22 +02:00
|
|
|
Edit
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href={~p"/admin/notes/#{@note}"} class="button">
|
|
|
|
Show in Admin
|
2023-09-08 13:01:26 +02:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</section>
|
2023-07-20 20:30:15 +02:00
|
|
|
|
2023-09-08 13:01:26 +02:00
|
|
|
<aside>
|
2023-07-25 06:54:53 +02:00
|
|
|
<.featured_images note={@note} />
|
|
|
|
</aside>
|
|
|
|
|
2023-07-19 22:40:32 +02:00
|
|
|
<%= if has_outline?(@note) do %>
|
2023-09-08 13:21:16 +02:00
|
|
|
<aside class="prose max-w-none print:hidden">
|
2023-07-24 18:39:25 +02:00
|
|
|
<div class="bg-theme-background1 rounded p-2">
|
|
|
|
<%= raw(render_outline(@note)) %>
|
|
|
|
</div>
|
|
|
|
</aside>
|
2023-07-19 22:40:32 +02:00
|
|
|
<% end %>
|
2023-07-11 07:23:07 +02:00
|
|
|
|
2023-09-08 13:21:16 +02:00
|
|
|
<section class="p-summary e-content | prose max-w-none">
|
2023-07-07 14:30:57 +02:00
|
|
|
<%= Markdown.render(@note.content) |> raw %>
|
|
|
|
</section>
|
2023-03-13 03:26:39 +01:00
|
|
|
|
2023-07-13 07:34:21 +02:00
|
|
|
<%= if not Enum.empty?(@note.links_to) do %>
|
2023-09-08 13:01:26 +02:00
|
|
|
<section class="prose ">
|
2023-09-05 21:59:37 +02:00
|
|
|
Notes linking here:
|
|
|
|
<ul>
|
2023-07-16 17:16:44 +02:00
|
|
|
<%= for link <- @note.links_to do %>
|
|
|
|
<li><a href={~p"/note/#{link.slug}"}><%= link.name %></a></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</section>
|
2023-07-13 07:34:21 +02:00
|
|
|
<% end %>
|
|
|
|
|
2023-07-18 07:35:32 +02:00
|
|
|
<%= if String.length(@note.url || "") > 0 do %>
|
2023-09-08 13:01:26 +02:00
|
|
|
<section class="text-center">
|
2023-07-18 07:27:27 +02:00
|
|
|
<.icon name="hero-link" /> <a href={@note.url}><%= @note.url %></a>
|
|
|
|
</section>
|
|
|
|
<% end %>
|
|
|
|
|
2023-09-08 13:01:26 +02:00
|
|
|
<footer>
|
2023-09-09 10:24:22 +02:00
|
|
|
<dl>
|
|
|
|
<dt>
|
|
|
|
<%= if @note.published_at do %>
|
|
|
|
<span>Published</span>
|
|
|
|
<% else %>
|
|
|
|
<span>Unpublished</span>
|
|
|
|
<% end %>
|
|
|
|
</dt>
|
|
|
|
<dd><time class="dt-published"><%= pretty_date(@note.published_at) %></time></dd>
|
|
|
|
<dt>Last updated</dt>
|
|
|
|
<dd>
|
|
|
|
<time class="dt-published"><%= pretty_date(@note.published_at) %></time>
|
|
|
|
</dd>
|
|
|
|
<dt>Tags</dt>
|
|
|
|
<dd><.tags note={@note} /></dd>
|
|
|
|
<dt>Kind</dt>
|
|
|
|
<dd><%= @note.kind %></dd>
|
|
|
|
</dl>
|
2023-07-07 14:30:57 +02:00
|
|
|
|
|
|
|
<a href={~p"/"} class="hidden | h-card u-author">Inhji</a>
|
|
|
|
<a href={~p"/note/#{@note.slug}"} class="hidden | u-url u-uid"><%= @note.name %></a>
|
|
|
|
</footer>
|
2023-07-04 06:57:13 +02:00
|
|
|
|
2023-09-08 13:01:26 +02:00
|
|
|
<section>
|
2023-07-07 14:30:57 +02:00
|
|
|
<%= if !Enum.empty?(@note.images) do %>
|
|
|
|
<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 %>
|
|
|
|
</section>
|
|
|
|
</article>
|