📋 Basic Information
<%= form.label :name, class: "block text-sm font-medium text-gray-700" %>
<%= form.text_field :name,
class: "block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm",
placeholder: "e.g., Block Brazil" %>
<%= form.label :description, "Description", class: "block text-sm font-medium text-gray-700" %>
<%= form.text_area :description, rows: 3,
class: "block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm",
placeholder: "Explain why this policy is needed..." %>
<%= form.label :policy_type, "Policy Type", class: "block text-sm font-medium text-gray-700" %>
<%= form.select :policy_type,
options_for_select(@policy_types.map { |type| [type.humanize, type] }, @waf_policy.policy_type),
{ prompt: "Select policy type" },
{ class: "block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm",
data: { "waf-policy-form-target": "policyTypeSelect", "action": "change->waf-policy-form#updateTargetsVisibility" } } %>
<%= form.label :policy_action, "Policy Action", class: "block text-sm font-medium text-gray-700" %>
<%= form.select :policy_action,
options_for_select(@actions.map { |action| [action.humanize, action] }, @waf_policy.policy_action),
{ prompt: "Select action" },
{ class: "block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm",
data: { "waf-policy-form-target": "policyActionSelect", "action": "change->waf-policy-form#updateActionConfig" } } %>