{#- Jinja2 Macro for Rendering a Windows Task Trigger Group This file defines a macro that *can* be used to render the HTML structure for configuring a single trigger within the Windows Task Scheduler form. IMPORTANT NOTE: The current implementation in `windows_task.js` dynamically generates this HTML structure using JavaScript functions (`addTrigger`, `showTriggerFields`). Therefore, this Jinja2 macro is likely **NOT USED** in the current workflow and is kept here for reference or potential alternative implementations. If used, it would require significant coordination with the JavaScript logic. -#} {# --- Macro Definition --- #} {% macro render_trigger_fields(trigger_num, existing_trigger_data=None) %} {# Renders the HTML for one trigger configuration block. Args: trigger_num (int): A unique number for this trigger group (used for IDs/names). existing_trigger_data (dict, optional): Data for an existing trigger to pre-populate fields. Should match the structure returned by the details API. Defaults to None for a new, blank trigger. Structure: - Contains a header with the trigger number and a remove button. - Includes a dropdown ( {# Add other supported trigger types (Logon, Boot, etc.) here if needed #} {# Placeholder for validation errors related to trigger type selection #}
{# --- Dynamic Trigger Fields Placeholder --- #} {# This div is intentionally empty in the template. #} {# The JavaScript function `showTriggerFields(trigger_num, existing_trigger_data)` #} {# is responsible for populating this div with the appropriate input fields #} {# based on the selected value in the dropdown above. #}
{# --- End .trigger-group --- #} {% endmacro %} {# --- End Macro Definition --- #}