EvoBal/app/views/filters/index.html.erb
2021-03-04 22:28:47 +01:00

56 lines
2.2 KiB
Plaintext

<% content_for :main_header do %>
<h1>Filters</h1>
<% end %>
<%= render(FlashNoticeComponent.new) { notice } if notice.present? %>
<div class="shadow overflow-hidden border-b border-gray-200 rounded-lg">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Enabled</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Operator</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Inverted</th>
<th scope="col" class="relative px-6 py-3"><span class="sr-only">Show, Edit, Destroy</span></th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<% @filters.each do |filter| %>
<tr class="<%= cycle('bg-white', 'bg-gray-50', :name => 'zebra') %>">
<td class="px-6 py-4 whitespace-nowrap">
<%= filter.description %>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<% if filter.enabled? %>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
<%= filter.enabled %>
</span>
<% else %>
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">
<%= filter.enabled %>
</span>
<% end %>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<%= filter.operator %>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<%= filter.inverted %>
</td>
<td>
<%= link_to 'Show', filter %>
<%= link_to 'Edit', edit_filter_path(filter) %>
<%= link_to 'Destroy', filter, method: :delete, data: { confirm: 'Are you sure?' } %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<br>
<%= link_to 'New Filter', new_filter_path %>