<!-- HTML form for RadioButtonSearch -->
<%!
## TODO - will this import multiple times?   the <%! tag  is supposed to be special for module-level imports so hopefully not.
import random
%>
<%page args="module"/>

<%def name="makeRadio(valueDict)">
    <input type="radio" 
        name="${module['id']}" 
        value="${valueDict['value'] | h}"
        id="${module['id']}_${valueDict['text'] | h}"
        % if "selected" in valueDict : 
            checked="checked"
        % endif
    /> 
    <label for="${module['id']}_${valueDict['text'] | h}">
        ${valueDict["text"] | h}
    </label>
</%def>


<form action="/splunk/search">
    <fieldset>
        <label>${module["label"] | h}</label>:
        % for valueDict in module["options"] : 
            <%call expr="makeRadio(valueDict)"></%call>
        % endfor
        
    </fieldset>
</form>
