chiya/lib/chiya_web/controllers/page_html/bookmarks.html.heex
2023-09-05 21:59:37 +02:00

53 lines
1.7 KiB
Text

<%= if @channel do %>
<section class="mx-auto max-w-2xl">
<.header>
Bookmarks
<:subtitle><%= Enum.count(@notes) %> in total</:subtitle>
</.header>
</section>
<section class="mt-6 grid grid-cols-1 md:grid-cols-3 gap-3 max-w-4xl mx-auto">
<section class="col-span-1 md:col-span-2">
<%= if @channel.layout == :default do %>
<.note_list_default notes={@channel.notes}/>
<% end %>
<%= if @channel.layout == :gallery do %>
<.note_list_gallery notes={@channel.notes}/>
<% end %>
<%= if @channel.layout == :microblog do %>
<.note_list_microblog notes={@channel.notes}/>
<% end %>
</section>
<section>
<ul>
<%= for {letter, tag_group} <- @tags do %>
<li class="mb-2">
<span class="capitalize text-theme-primary border border-theme-background1 rounded font-sm px-2 py-1 inline-block mb-2">
<%= letter %>
</span>
<%= for tag <- tag_group do %>
<a
href={~p"/tagged-with/#{tag.slug}"}
class="border border-theme-background1 rounded font-sm px-2 py-1 inline-block mb-2 hover:bg-theme-background1 transition"
>
<%= tag.name %> <span class="text-theme-base text-xs font-mono bg-theme-primary/25 rounded-full py-0.5 px-1 align-middle"><%= Enum.count(tag.notes) %></span>
</a>
<% end %>
</li>
<% end %>
</ul>
</section>
</section>
<% else %>
<section class="mx-auto max-w-2xl">
<.header>
Bookmarks
</.header>
<section class="prose prose-gruvbox mt-6">
Bookmarks not set up.
</section>
</section>
<% end %>