EvoBal/app/views/filters/_filter.html.erb

28 lines
948 B
Plaintext

<div id="<%= dom_id filter %>" class="filter-<%= filter.enabled? ? 'enabled' : 'disabled' %> flex bg-orange-500 px-4">
<div class="col-span-2 bg-yellow-500 px-4">
<strong>Description:</strong>
<%= filter.description || "<i>No description</i>" %>
</div>
<div class="bg-yellow-500 px-4">
<strong>Operator:</strong>
<%= filter.operator %>
</div>
<div class="bg-yellow-500 px-4">
<strong>Inverted:</strong>
<%= filter.inverted? ? 'Yes' : 'No' %>
</div>
<div class="grid grid-cols-1 divide-y flex-none bg-gray-500">
<%= link_to 'Edit', edit_filter_path(@filter) %>
<%= button_to 'Delete', @filter, method: :delete, data: { confirm: 'Are you sure?' } %>
<% if filter.enabled? %>
<%= button_to 'Disable', filter_disable_path(@filter), data: { method: :patch } %>
<% else %>
<%= button_to 'Enable', filter_enable_path(@filter), data: { method: :patch } %>
<% end %>
</div>
</div>