2021-03-04 22:54:10 +01:00
|
|
|
<div id="<%= dom_id filter %>" class="<%= filter.enabled? ? 'filter--enabled' : 'filter--disabled' %> flex space-x-2">
|
2021-02-01 14:02:54 +01:00
|
|
|
|
2021-03-05 00:18:43 +01:00
|
|
|
<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>
|
|
|
|
|
2021-03-04 22:54:10 +01:00
|
|
|
<div class="flex-auto">
|
2021-02-28 10:55:53 +01:00
|
|
|
<strong class="pr-1">Description:</strong>
|
2021-03-05 00:18:43 +01:00
|
|
|
<%= filter.description || "<i>No description</i>".html_safe %>
|
2021-02-07 16:47:06 +01:00
|
|
|
</div>
|
2021-02-01 14:02:54 +01:00
|
|
|
|
2021-03-04 22:54:10 +01:00
|
|
|
<div class="flex-auto">
|
2021-02-28 10:55:53 +01:00
|
|
|
<strong class="pr-1">Operator:</strong>
|
2021-02-01 14:02:54 +01:00
|
|
|
<%= filter.operator %>
|
2021-02-07 16:47:06 +01:00
|
|
|
</div>
|
2021-02-01 14:02:54 +01:00
|
|
|
|
2021-03-04 22:54:10 +01:00
|
|
|
<div class="flex-auto">
|
2021-02-28 10:55:53 +01:00
|
|
|
<strong class="pr-1">Inverted:</strong>
|
2021-02-07 16:47:06 +01:00
|
|
|
<%= filter.inverted? ? 'Yes' : 'No' %>
|
|
|
|
</div>
|
|
|
|
|
2021-03-04 22:54:10 +01:00
|
|
|
<div class="flex-none text-center">
|
2021-03-03 13:58:51 +01:00
|
|
|
<div class="">
|
|
|
|
<%= link_to 'Edit', edit_filter_path(@filter) %>
|
|
|
|
</div>
|
2021-02-07 16:47:06 +01:00
|
|
|
</div>
|
2021-02-01 14:02:54 +01:00
|
|
|
</div>
|