Current section
Files
Jump to
Current section
Files
lib/kaffy_web/templates/resource/_list_table.html.eex
<thead class="thead-dark">
<tr>
<%= for field <- @fields do %>
<th><%= Kaffy.ResourceSchema.kaffy_field_name(@my_resource[:schema], field) %></th>
<% end %>
</tr>
<%= if Kaffy.ResourceSchema.has_field_filters?(@my_resource) do %>
<tr>
<%= for {field, index} <- Enum.with_index(@fields) do %>
<% {field, filters} = Kaffy.ResourceSchema.kaffy_field_filters(@my_resource[:schema], field) %>
<%= if filters do %>
<th class="bg-light">
<select class="kaffy-filter custom-select" id="kaffy-field-<%= index %>" data-field-name="<%= Kaffy.ResourceSchema.kaffy_field_name(@my_resource[:schema], field) %>">
<option value="">All</option>
<%= for {human, machine} <- filters do %>
<option value="<%= machine %>"><%= human %></option>
<% end %>
</select>
</th>
<% else %>
<th class="bg-light"></th>
<% end %>
<% end %>
</tr>
<% end %>
</thead>
<tbody>
</tbody>