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

41 lines
2.2 KiB
Plaintext

<div id="<%= dom_id filter %>" class="<%= filter.enabled? ? 'filter--enabled' : 'filter--disabled' %> flex space-x-2">
<div class="flex-auto">
<% if filter.enabled? %>
<!-- Enabled: "bg-indigo-600", Not Enabled: "bg-gray-200" -->
<%= link_to disable_filter_path(filter), data: { method: :patch, confirm: 'Are you sure you want to disable this filter?' }, class: "bg-green-400 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500", "aria-pressed":"false" do %>
<span class="sr-only">Disable</span>
<!-- Enabled: "translate-x-5", Not Enabled: "translate-x-0" -->
<span aria-hidden="true" class="translate-x-5 pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
<% end %>
<% else %>
<%= link_to enable_filter_path(filter), data: { method: :patch, confirm: 'Are you sure you want to disable this filter?' }, class: "bg-gray-200 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500", "aria-pressed":"false" do %>
<span class="sr-only">Enable</span>
<!-- Enabled: "translate-x-5", Not Enabled: "translate-x-0" -->
<span aria-hidden="true" class="translate-x-0 pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"></span>
<% end %>
<% end %>
</div>
<div class="flex-auto">
<strong class="pr-1">Description:</strong>
<%= filter.description || "<i>No description</i>".html_safe %>
</div>
<div class="flex-auto">
<strong class="pr-1">Operator:</strong>
<%= filter.operator %>
</div>
<div class="flex-auto">
<strong class="pr-1">Inverted:</strong>
<%= filter.inverted? ? 'Yes' : 'No' %>
</div>
<div class="flex-none text-center">
<div class="">
<%= link_to 'Edit', edit_filter_path(@filter) %>
</div>
</div>
</div>