forked from shibao/cannery
use list for classes
This commit is contained in:
parent
bafc824a32
commit
2c2b9fefc9
@ -4,7 +4,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<%= for %{key: key, label: label} = column <- @columns do %>
|
<%= for %{key: key, label: label} = column <- @columns do %>
|
||||||
<%= if column |> Map.get(:sortable, true) do %>
|
<%= if column |> Map.get(:sortable, true) do %>
|
||||||
<th class={"p-2 #{column[:class]}"}>
|
<th class={["p-2", column[:class]]}>
|
||||||
<span
|
<span
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
phx-click="sort_by"
|
phx-click="sort_by"
|
||||||
@ -25,7 +25,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</th>
|
</th>
|
||||||
<% else %>
|
<% else %>
|
||||||
<th class={"p-2 #{column[:class]}"}>
|
<th class={["p-2", column[:class]]}>
|
||||||
<%= label %>
|
<%= label %>
|
||||||
</th>
|
</th>
|
||||||
<% end %>
|
<% end %>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<%= for values <- @rows do %>
|
<%= for values <- @rows do %>
|
||||||
<tr>
|
<tr>
|
||||||
<%= for %{key: key} = value <- @columns do %>
|
<%= for %{key: key} = value <- @columns do %>
|
||||||
<td class={"p-2 #{value[:class]}"}>
|
<td class={["p-2", value[:class]]}>
|
||||||
<%= case values |> Map.get(key) do %>
|
<%= case values |> Map.get(key) do %>
|
||||||
<% {_custom_sort_value, value} -> %>
|
<% {_custom_sort_value, value} -> %>
|
||||||
<%= value %>
|
<%= value %>
|
||||||
|
@ -18,7 +18,7 @@ defmodule LokalWeb.ErrorHelpers do
|
|||||||
|
|
||||||
~H"""
|
~H"""
|
||||||
<%= for error <- Keyword.get_values(@form.errors, @field) do %>
|
<%= for error <- Keyword.get_values(@form.errors, @field) do %>
|
||||||
<span class={"invalid-feedback #{@extra_class}"} phx-feedback-for={input_name(@form, @field)}>
|
<span class={["invalid-feedback", @extra_class]} phx-feedback-for={input_name(@form, @field)}>
|
||||||
<%= translate_error(error) %>
|
<%= translate_error(error) %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
Loading…
Reference in New Issue
Block a user