EvoBal/app/views/conditions/_condition.html.erb

45 lines
2.3 KiB
Plaintext

<div id="<%= dom_id condition %>" class="flex flex-cols">
<div class="flex-auto text-left">
<% if condition.enabled? %>
<!-- Enabled: "bg-indigo-600", Not Enabled: "bg-gray-200" -->
<%= link_to disable_filter_condition_path(condition.filter, condition), data: { method: :patch, confirm: 'Are you sure you want to disable this condition?' }, 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_condition_path(condition.filter, condition), data: { method: :patch, confirm: 'Are you sure you want to disable this condition?' }, 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 text-left">
<strong>Property type:</strong>
<%= condition.property_type %>
</div>
<div class="flex-auto text-left">
<strong>Property value:</strong>
<%= condition.property_value %>
</div>
<div class="flex-auto text-left">
<strong>Test method:</strong>
<%= condition.test_method %>
</div>
<div class="flex-auto text-left">
<strong>Test value:</strong>
<%= condition.test_value %>
</div>
<div class="flex-auto text-left">
<strong>Inverted:</strong>
<%= condition.inverted %>
</div>
</div>