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} -> {:error, changelog} ->
Logger.warn("Reference was not added.") Logger.warn("Reference was not added.")
Logger.error(inspect(changelog)) Logger.error(inspect(changelog))
end end
end end

View file

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

View file

@ -31,9 +31,14 @@ defmodule ChiyaWeb.PublicComponents do
<div> <div>
<h1 class="text-lg font-semibold leading-8 text-gray-800 dark:text-gray-200"> <h1 class="text-lg font-semibold leading-8 text-gray-800 dark:text-gray-200">
<%= render_slot(@inner_block) %> <%= 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> </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) %> <%= render_slot(@subtitle) %>
</p> </p>
</div> </div>

View file

@ -24,46 +24,54 @@
</div> </div>
<%= if @channel do %> <%= if @channel do %>
<%= if @channel.layout == :default do %> <%= if @channel.layout == :default do %>
<section class="default | mt-6 sm:w-auto flex flex-col gap-1.5"> <section class="default | mt-6 sm:w-auto flex flex-col gap-1.5">
<%= for note <- @channel.notes do %> <%= for note <- @channel.notes do %>
<a <a
href={~p"/#{note.slug}"} href={~p"/#{note.slug}"}
class="rounded-lg -mx-2 -my-0.5 px-2 py-0.5 hover:bg-theme-primary/10 transition" 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"> <span class="text-theme-primary text-lg font-semibold leading-8">
<%= note.name %> <%= note.name %>
</span> </span>
<span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span> <span class="text-theme-base text-sm"><%= pretty_date(note.published_at) %></span>
</a> </a>
<% end %> <% end %>
</section> </section>
<% end %> <% end %>
<%= if @channel.layout == :gallery do %> <%= if @channel.layout == :gallery do %>
<section class="gallery | mt-6"> <section class="gallery | mt-6">
<%= for note <- @channel.notes do %> <%= for note <- @channel.notes do %>
<article> <article>
<section class="flex flex-wrap justify-start gap-3"> <section class="flex flex-wrap justify-start gap-3">
<%= for image <- note.images do %> <%= for image <- note.images do %>
<a <a
href={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)} href={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :full_dithered)}
class="lightbox | w-28" class="lightbox | w-28"
data-gallery="note" data-gallery="note"
data-description={ChiyaWeb.Markdown.render(image.content)} data-description={ChiyaWeb.Markdown.render(image.content)}
> >
<img <img
src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)} src={ChiyaWeb.Uploaders.NoteImage.url({image.path, image}, :thumb_dithered)}
loading="lazy" loading="lazy"
/> />
</a> </a>
<% end %> <% end %>
</section> </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> <a
</article> 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 /> <.line />
<% end %> <% end %>
</section> </section>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>