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

This commit is contained in:
inhji 2023-09-08 13:01:26 +02:00
parent ca4d2ca05a
commit 17382a449e

View file

@ -1,39 +1,39 @@
<article class="h-entry hentry"> <article class="h-entry hentry | stack container">
<.header class="max-w-2xl mx-auto" class_title="p-name"> <header class=">
<%= @note.name %> <h1 class="p-name | text-3xl leading-10 font-bold text-theme-base1">
</.header> <%= @note.name %>
</h1>
</header>
<%= if @current_user do %> <section class="print:hidden">
<section class="max-w-2xl mx-auto mt-8 print:hidden"> <ul class="flex gap-3">
<ul class="flex gap-3"> <li>
<li> <a href={~p"/admin/notes/#{@note}/edit"} class="button">
<a href={~p"/admin/notes/#{@note}/edit"} class="button"> <.icon name="hero-pencil-square" /> Edit
<.icon name="hero-pencil-square" /> Edit </a>
</a> </li>
</li> <li><a href={~p"/admin/notes/#{@note}"} class="button">Show in Admin</a></li>
<li><a href={~p"/admin/notes/#{@note}"} class="button">Show in Admin</a></li> </ul>
</ul> </section>
</section>
<% end %>
<aside class="max-w-2xl mx-auto mt-8"> <aside>
<.featured_images note={@note} /> <.featured_images note={@note} />
</aside> </aside>
<%= if has_outline?(@note) do %> <%= if has_outline?(@note) do %>
<aside class="max-w-2xl mx-auto mt-8 prose prose-gruvbox print:hidden"> <aside class="prose print:hidden">
<div class="bg-theme-background1 rounded p-2"> <div class="bg-theme-background1 rounded p-2">
<%= raw(render_outline(@note)) %> <%= raw(render_outline(@note)) %>
</div> </div>
</aside> </aside>
<% end %> <% end %>
<section class="mt-8 mx-auto max-w-2xl prose prose-gruvbox md:prose-lg lg:prose-xl | p-summary e-content"> <section class="p-summary e-content | prose">
<%= Markdown.render(@note.content) |> raw %> <%= Markdown.render(@note.content) |> raw %>
</section> </section>
<%= if not Enum.empty?(@note.links_to) do %> <%= if not Enum.empty?(@note.links_to) do %>
<section class="mt-8 prose prose-gruvbox max-w-2xl mx-auto"> <section class="prose ">
Notes linking here: Notes linking here:
<ul> <ul>
<%= for link <- @note.links_to do %> <%= for link <- @note.links_to do %>
@ -44,12 +44,12 @@
<% end %> <% end %>
<%= if String.length(@note.url || "") > 0 do %> <%= if String.length(@note.url || "") > 0 do %>
<section class="mt-8 max-w-2xl mx-auto text-center text-lg"> <section class="text-center">
<.icon name="hero-link" /> <a href={@note.url}><%= @note.url %></a> <.icon name="hero-link" /> <a href={@note.url}><%= @note.url %></a>
</section> </section>
<% end %> <% end %>
<footer class="max-w-2xl mx-auto mt-8 text-theme-base"> <footer>
<%= if @note.published_at do %> <%= if @note.published_at do %>
<span>Published</span> <span>Published</span>
<% else %> <% else %>
@ -74,7 +74,7 @@
<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="max-w-2xl mx-auto mt-8"> <section>
<%= if !Enum.empty?(@note.images) do %> <%= if !Enum.empty?(@note.images) do %>
<div class="flex flex-wrap gap-3"> <div class="flex flex-wrap gap-3">
<%= for image <- @note.images do %> <%= for image <- @note.images do %>