improve tag card style

This commit is contained in:
shibao 2022-12-03 21:54:22 -05:00
parent 0894293620
commit 7a7754767f
15 changed files with 46 additions and 45 deletions

View File

@ -2,6 +2,7 @@
- Add search to catalog, ammo, container, tag and range index pages - Add search to catalog, ammo, container, tag and range index pages
- Tweak urls for catalog, ammo, containers, tags and shot records - Tweak urls for catalog, ammo, containers, tags and shot records
- Fix bug with shot group chart not drawing lines between days correctly - Fix bug with shot group chart not drawing lines between days correctly
- Improve cards across app (make them line up with each other)
# v0.7.2 # v0.7.2
- Code improvements - Code improvements

View File

@ -13,7 +13,7 @@ defmodule CanneryWeb.Components.TagCard do
~H""" ~H"""
<div <div
id={"tag-#{@tag.id}"} id={"tag-#{@tag.id}"}
class="mx-4 my-2 px-8 py-4 space-x-4 flex justify-center items-center class="mx-4 mb-2 px-8 py-4 space-x-4 flex justify-center items-center
border border-gray-400 rounded-lg shadow-lg hover:shadow-md border border-gray-400 rounded-lg shadow-lg hover:shadow-md
transition-all duration-300 ease-in-out" transition-all duration-300 ease-in-out"
> >

View File

@ -38,39 +38,39 @@
</.form> </.form>
</div> </div>
<div class="flex flex-row flex-wrap justify-center items-center"> <%= if @tags |> Enum.empty?() do %>
<%= if @tags |> Enum.empty?() do %> <h2 class="title text-xl text-primary-600">
<h2 class="title text-xl text-primary-600"> <%= gettext("No tags") %>
<%= gettext("No tags") %> <%= display_emoji("😔") %>
<%= display_emoji("😔") %> </h2>
</h2> <% else %>
<% end %> <div class="flex flex-row flex-wrap justify-center items-center">
<%= for tag <- @tags do %>
<.tag_card tag={tag}>
<.link
patch={Routes.tag_index_path(Endpoint, :edit, tag)}
class="text-primary-600 link"
data-qa={"edit-#{tag.id}"}
>
<i class="fa-fw fa-lg fas fa-edit"></i>
</.link>
<%= for tag <- @tags do %> <.link
<.tag_card tag={tag}> href="#"
<.link class="text-primary-600 link"
patch={Routes.tag_index_path(Endpoint, :edit, tag)} phx-click="delete"
class="text-primary-600 link" phx-value-id={tag.id}
data-qa={"edit-#{tag.id}"} data-confirm={
> dgettext("prompts", "Are you sure you want to delete %{name}?", name: tag.name)
<i class="fa-fw fa-lg fas fa-edit"></i> }
</.link> data-qa={"delete-#{tag.id}"}
>
<.link <i class="fa-fw fa-lg fas fa-trash"></i>
href="#" </.link>
class="text-primary-600 link" </.tag_card>
phx-click="delete" <% end %>
phx-value-id={tag.id} </div>
data-confirm={ <% end %>
dgettext("prompts", "Are you sure you want to delete %{name}?", name: tag.name)
}
data-qa={"delete-#{tag.id}"}
>
<i class="fa-fw fa-lg fas fa-trash"></i>
</.link>
</.tag_card>
<% end %>
</div>
</div> </div>
<%= if @live_action in [:new, :edit] do %> <%= if @live_action in [:new, :edit] do %>

View File

@ -306,7 +306,7 @@ msgstr "Keine Einladung"
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31
#: lib/cannery_web/live/tag_live/index.html.heex:10 #: lib/cannery_web/live/tag_live/index.html.heex:10
#: lib/cannery_web/live/tag_live/index.html.heex:44 #: lib/cannery_web/live/tag_live/index.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No tags" msgid "No tags"
msgstr "Keine Tags" msgstr "Keine Tags"

View File

@ -85,7 +85,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:93
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:138
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:65 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?" msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?"

View File

@ -291,7 +291,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31
#: lib/cannery_web/live/tag_live/index.html.heex:10 #: lib/cannery_web/live/tag_live/index.html.heex:10
#: lib/cannery_web/live/tag_live/index.html.heex:44 #: lib/cannery_web/live/tag_live/index.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No tags" msgid "No tags"
msgstr "" msgstr ""

View File

@ -292,7 +292,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31
#: lib/cannery_web/live/tag_live/index.html.heex:10 #: lib/cannery_web/live/tag_live/index.html.heex:10
#: lib/cannery_web/live/tag_live/index.html.heex:44 #: lib/cannery_web/live/tag_live/index.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No tags" msgid "No tags"
msgstr "" msgstr ""

View File

@ -71,7 +71,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:93
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:138
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:65 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "" msgstr ""

View File

@ -306,7 +306,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31
#: lib/cannery_web/live/tag_live/index.html.heex:10 #: lib/cannery_web/live/tag_live/index.html.heex:10
#: lib/cannery_web/live/tag_live/index.html.heex:44 #: lib/cannery_web/live/tag_live/index.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No tags" msgid "No tags"
msgstr "" msgstr ""

View File

@ -85,7 +85,7 @@ msgstr "Está seguro que desea eliminar %{email}? Esta acción es permanente!"
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:93
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:138
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:65 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "Está seguro que desea eliminar %{name}?" msgstr "Está seguro que desea eliminar %{name}?"

View File

@ -306,7 +306,7 @@ msgstr "Aucune invitation"
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31
#: lib/cannery_web/live/tag_live/index.html.heex:10 #: lib/cannery_web/live/tag_live/index.html.heex:10
#: lib/cannery_web/live/tag_live/index.html.heex:44 #: lib/cannery_web/live/tag_live/index.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No tags" msgid "No tags"
msgstr "Aucun tag" msgstr "Aucun tag"

View File

@ -86,7 +86,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:93
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:138
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:65 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "Êtes-vous certain·e de supprimer %{name}?" msgstr "Êtes-vous certain·e de supprimer %{name}?"

View File

@ -302,7 +302,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31 #: lib/cannery_web/live/container_live/edit_tags_component.html.heex:31
#: lib/cannery_web/live/tag_live/index.html.heex:10 #: lib/cannery_web/live/tag_live/index.html.heex:10
#: lib/cannery_web/live/tag_live/index.html.heex:44 #: lib/cannery_web/live/tag_live/index.html.heex:43
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "No tags" msgid "No tags"
msgstr "" msgstr ""

View File

@ -81,7 +81,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:93
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:138
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:65 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "" msgstr ""

View File

@ -70,7 +70,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:93
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:138
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:65 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "" msgstr ""