<% content_for :main_header do %>

Filter #<%= @filter.id %>: <%= @filter.description %>

<% end %>

Filter

<%= render(FlashNoticeComponent.new) { notice } if notice.present? %> <%= turbo_frame_tag "filter" do %> <%= render @filter %> <% end %>
<%= link_to 'Edit', edit_filter_path(@filter), class: "rounded-md relative inline-flex items-center px-4 py-2 border border-gray-100 bg-white text-sm font-medium text-gray-700 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500" %> <% if @filter.enabled? %> <%= link_to "Disable", disable_filter_path(@filter), data: { method: :patch, confirm: 'Are you sure you want to disable this filter?' }, class: "rounded-md relative inline-flex items-center px-4 py-2 border border-transparent bg-yellow-200 text-sm font-medium text-yellow-700 hover:bg-yellow-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500" %> <% else %> <%= link_to "Enable", enable_filter_path(@filter), data: { method: :patch, confirm: 'Are you sure you want to disable this filter?' }, class: "rounded-md relative inline-flex items-center px-4 py-2 border border-transparent bg-green-50 text-sm font-medium text-green-700 hover:bg-green-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500" %> <% end %> <%= link_to 'Delete', @filter, method: :delete, data: { confirm: 'Are you sure you want to delete this filter? There is no undo!' }, class: "rounded-md relative inline-flex items-center px-4 py-2 border border-transparent bg-white text-sm font-medium text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %>

Conditions

<%= render(@filter.conditions) || "No conditions yet".html_safe %> <%= turbo_frame_tag "new_condition" do %>
<%= link_to "Add a new condition", new_filter_condition_path(@filter) %>
<% end %>

Operations

<%= render(@filter.operations) || "No operations yet".html_safe %> <%= turbo_frame_tag "new_operation" do %>
<%= link_to "Add a new operation", new_filter_operation_path(@filter) %>
<% end %>