cannery/lib/cannery_web/live/tag_live/index.html.heex

40 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-01-28 21:05:54 -05:00
<div class="flex flex-col space-y-8 justify-center items-center">
<h1 class="title text-2xl title-primary-500">
2022-02-09 00:58:53 -05:00
<%= gettext("Listing Tags") %>
2022-01-28 21:05:54 -05:00
</h1>
<p class="title text-md text-primary-500">
2022-02-09 00:58:53 -05:00
<%= gettext("Tags can be added to your containers to help you organize") %>
2022-01-28 21:05:54 -05:00
</p>
<%= if @tags |> Enum.empty?() do %>
2022-02-01 00:11:37 -05:00
<h2 class="title text-xl text-primary-500">
2022-02-09 00:58:53 -05:00
<%= gettext("No tags") %> 😔
2022-02-01 00:11:37 -05:00
</h2>
2022-02-09 00:58:53 -05:00
<%= live_patch(dgettext("actions", "Make your first tag!"),
2022-02-01 00:11:37 -05:00
to: Routes.tag_index_path(@socket, :new),
2022-02-01 01:08:18 -05:00
class: "btn btn-primary"
) %>
2022-01-28 21:05:54 -05:00
<% else %>
2022-02-09 00:58:53 -05:00
<%= live_patch(dgettext("actions", "New Tag"),
2022-01-28 21:05:54 -05:00
to: Routes.tag_index_path(@socket, :new),
class: "btn btn-primary"
) %>
<% end %>
<div class="flex flex-row flex-wrap">
<%= for tag <- @tags do %>
2022-02-05 01:59:40 -05:00
<.tag_card tag={tag} />
2022-01-28 21:05:54 -05:00
<% end %>
</div>
</div>
2022-02-05 01:59:40 -05:00
2022-01-28 21:05:54 -05:00
<%= if @live_action in [:new, :edit] do %>
<%= live_modal(CanneryWeb.TagLive.FormComponent,
id: @tag.id || :new,
title: @page_title,
action: @live_action,
tag: @tag,
return_to: Routes.tag_index_path(@socket, :index),
current_user: @current_user
) %>
<% end %>