add a row number column to all tables
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-07-19 01:04:53 +00:00
parent 14615ac107
commit 3fac142454
9 changed files with 38 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# v0.9.16
- Fix bug with ammo type selector
- Add a row number column to all tables
# v0.9.15
- Update deps

View File

@ -2,6 +2,7 @@
<table class="min-w-full table-auto text-center bg-white">
<thead class="border-b border-primary-600">
<tr>
<th class="p-2 w-12">{gettext("Row")}</th>
<%= for %{key: key, label: label} = column <- @columns do %>
<%= if column |> Map.get(:sortable, true) do %>
<th class={["p-2", column[:class]]}>
@ -38,6 +39,7 @@
:for={{values, i} <- @rows |> Enum.with_index()}
class={if i |> Integer.is_even(), do: @row_class, else: @alternate_row_class}
>
<td class="p-2">{i + 1}</td>
<td :for={%{key: key} = value <- @columns} class={["p-2", value[:class]]}>
<%= case values |> Map.get(key) do %>
<% {_custom_sort_value, value} -> %>

View File

@ -1457,3 +1457,8 @@ msgstr "Datum"
#, elixir-autogen, elixir-format, fuzzy
msgid "No containers staged"
msgstr "Kein Behälter"
#: lib/cannery_web/components/table_component.html.heex:5
#, elixir-autogen, elixir-format
msgid "Row"
msgstr ""

View File

@ -1440,3 +1440,8 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "No containers staged"
msgstr ""
#: lib/cannery_web/components/table_component.html.heex:5
#, elixir-autogen, elixir-format
msgid "Row"
msgstr ""

View File

@ -1440,3 +1440,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "No containers staged"
msgstr ""
#: lib/cannery_web/components/table_component.html.heex:5
#, elixir-autogen, elixir-format
msgid "Row"
msgstr ""

View File

@ -1459,3 +1459,8 @@ msgstr "Fecha"
#, elixir-autogen, elixir-format, fuzzy
msgid "No containers staged"
msgstr "Sin contenedores"
#: lib/cannery_web/components/table_component.html.heex:5
#, elixir-autogen, elixir-format
msgid "Row"
msgstr ""

View File

@ -1460,3 +1460,8 @@ msgstr "Date"
#, elixir-autogen, elixir-format, fuzzy
msgid "No containers staged"
msgstr "Aucun conteneur"
#: lib/cannery_web/components/table_component.html.heex:5
#, elixir-autogen, elixir-format
msgid "Row"
msgstr ""

View File

@ -1451,3 +1451,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "No containers staged"
msgstr ""
#: lib/cannery_web/components/table_component.html.heex:5
#, elixir-autogen, elixir-format
msgid "Row"
msgstr ""

View File

@ -1451,3 +1451,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "No containers staged"
msgstr ""
#: lib/cannery_web/components/table_component.html.heex:5
#, elixir-autogen, elixir-format
msgid "Row"
msgstr ""