mix format

This commit is contained in:
Inhji 2023-04-29 09:43:34 +02:00
parent 1c8487a77c
commit 5ab196ae16
4 changed files with 62 additions and 52 deletions

View file

@ -124,7 +124,6 @@ defmodule Chiya.Notes.References do
{:error, changelog} ->
Logger.warn("Reference was not added.")
Logger.error(inspect(changelog))
end
end

View file

@ -85,16 +85,14 @@ defmodule ChiyaWeb.AdminComponents do
<.link
href={~p"/"}
class="flex gap-3 text-sm leading-6 font-semibold text-gray-900 dark:text-gray-100 dark:hover:text-gray-300 hover:text-gray-700"
><%= @settings.title %></.link>
>
<%= @settings.title %>
</.link>
</li>
<li class="flex-1"></li>
<%= if @current_user do %>
<li>
<.link
href="#"
id="dark-mode-toggle"
class="text-sm leading-6"
>
<.link href="#" id="dark-mode-toggle" class="text-sm leading-6">
<span class="inline dark:hidden">🌙</span>
<span class="hidden dark:inline"></span>
</.link>
@ -103,22 +101,22 @@ defmodule ChiyaWeb.AdminComponents do
<.link
href={~p"/admin"}
class="text-sm leading-6 text-gray-900 dark:text-gray-100 dark:hover:text-gray-300 hover:text-gray-700"
>Admin</.link>
>
Admin
</.link>
</li>
<li>
<.link
href={~p"/user/log_out"}
method="delete"
class="text-sm leading-6 text-gray-900 dark:text-gray-100 dark:hover:text-gray-300 hover:text-gray-700"
>Log out</.link>
>
Log out
</.link>
</li>
<% else %>
<li>
<.link
href="#"
id="dark-mode-toggle"
class="text-sm leading-6"
>
<.link href="#" id="dark-mode-toggle" class="text-sm leading-6">
<span class="inline dark:hidden">🌙</span>
<span class="hidden dark:inline"></span>
</.link>

View file

@ -31,9 +31,14 @@ defmodule ChiyaWeb.PublicComponents do
<div>
<h1 class="text-lg font-semibold leading-8 text-gray-800 dark:text-gray-200">
<%= render_slot(@inner_block) %>
<span :if={@inline} class="text-sm leading-6 font-normal text-gray-600 dark:text-gray-400"><%= render_slot(@subtitle) %></span>
<span :if={@inline} class="text-sm leading-6 font-normal text-gray-600 dark:text-gray-400">
<%= render_slot(@subtitle) %>
</span>
</h1>
<p :if={@subtitle != [] && @inline == false} class="mt-2 text-sm leading-6 text-gray-600 dark:text-gray-400">
<p
:if={@subtitle != [] && @inline == false}
class="mt-2 text-sm leading-6 text-gray-600 dark:text-gray-400"
>
<%= render_slot(@subtitle) %>
</p>
</div>

View file

@ -24,46 +24,54 @@
</div>
<%= if @channel do %>
<%= if @channel.layout == :default do %>
<section class="default | mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %>
<a
href={~p"/#{note.slug}"}
class="rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<span class="text-theme-primary text-lg font-semibold leading-8">
<%= note.name %>
</span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
</a>
<% end %>
</section>
<section class="default | mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %>
<a
href={~p"/#{note.slug}"}
class="rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<span class="text-theme-primary text-lg font-semibold leading-8">
<%= note.name %>
</span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
</a>
<% end %>
</section>
<% end %>
<%= if @channel.layout == :gallery do %>
<section class="gallery | mt-6">
<%= for note <- @channel.notes do %>
<article>
<section class="flex flex-wrap justify-start 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)}
loading="lazy"
/>
</a>
<% end %>
</section>
<a href={~p"/#{note.slug}"} class="text-theme-primary text-lg/10 font-semibold rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"><%= note.name %> <span class="text-theme-muted font-normal text-sm"><%= pretty_date(note.published_at) %></span></a>
</article>
<section class="gallery | mt-6">
<%= for note <- @channel.notes do %>
<article>
<section class="flex flex-wrap justify-start 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)}
loading="lazy"
/>
</a>
<% end %>
</section>
<a
href={~p"/#{note.slug}"}
class="text-theme-primary text-lg/10 font-semibold rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition"
>
<%= note.name %>
<span class="text-theme-muted font-normal text-sm">
<%= pretty_date(note.published_at) %>
</span>
</a>
</article>
<.line />
<% end %>
</section>
<.line />
<% end %>
</section>
<% end %>
<% end %>
</div>