„lib/chiya_web/controllers/page_html/note.html.heex“ ändern

This commit is contained in:
inhji 2023-07-07 14:30:57 +02:00
parent 968b565336
commit a2bc863887

View file

@ -1,59 +1,58 @@
<section class="max-w-2xl mx-auto"> <article class="h-entry hentry">
<article class="h-entry hentry"> <.header class_title="max-w-2xl mx-auto | p-name">
<.header class_title="p-name"> <:title><%= @note.name %></:title>
<:title><%= @note.name %></:title> </.header>
</.header>
<section class="mt-8 prose prose-gruvbox md:prose-lg lg:prose-xl | p-summary e-content"> <section class="mt-8 prose prose-gruvbox md:prose-lg lg:prose-xl | p-summary e-content">
<%= Markdown.render(@note.content) |> raw %> <%= Markdown.render(@note.content) |> raw %>
</section> </section>
<footer class="mt-8 text-theme-base"> <footer class="max-w-2xl mx-auto mt-8 text-theme-base">
<%= if @note.published_at do %> <%= if @note.published_at do %>
<span>Published</span> <span>Published</span>
<% else %> <% else %>
<span>Unpublished</span> <span>Unpublished</span>
<% end %> <% end %>
<time class="font-semibold | dt-published"><%= pretty_date(@note.published_at) %></time> <time class="font-semibold | dt-published"><%= pretty_date(@note.published_at) %></time>
<.dot />
<span>Last Updated</span>
<time class="font-semibold" datetime={datetime(@note.updated_at)}>
<%= pretty_date(@note.updated_at) %>
</time>
<%= if not Enum.empty?(@note.tags) do %>
<.dot /> <.dot />
<span>Last Updated</span> <span>Tags</span>
<time class="font-semibold" datetime={datetime(@note.updated_at)}> <.tags note={@note} />
<%= pretty_date(@note.updated_at) %> <% end %>
</time> <%= if @current_user do %>
<%= if not Enum.empty?(@note.tags) do %> <.dot />
<.dot /> <a href={~p"/admin/notes/#{@note}"} class="underline-link font-semibold">Show in Admin</a>
<span>Tags</span> <% end %>
<.tags note={@note} />
<% end %>
<%= if @current_user do %>
<.dot />
<a href={~p"/admin/notes/#{@note}"} class="underline-link font-semibold">Show in Admin</a>
<% end %>
<a href={~p"/"} class="hidden | h-card u-author">Inhji</a> <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> <a href={~p"/note/#{@note.slug}"} class="hidden | u-url u-uid"><%= @note.name %></a>
</footer> </footer>
<section class="mt-8"> <section class="max-w-2xl mx-auto mt-8">
<%= if !Enum.empty?(@note.images) do %> <%= if !Enum.empty?(@note.images) do %>
<.line /> <.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)}
class="rounded"
/>
</a>
<% end %>
</div>
<% end %>
</section>
</article>
<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>
</section>