#set( $labelValue = $i18n.getText($parameters.label) )
#if( !$labelValue )
    #set( $labelValue = $parameters.label )
#end
        
#if ($parameters.description)
    #if ($i18n.getText($parameters.description))
        #set ($description = $i18n.getText($parameters.description))
    #else
        #set ($description = $parameters.description)
    #end
#end

<fieldset class="group radios">
    <legend>
        <span>$labelValue</span>
    </legend>
    #if ($editMode == false)
       <div class="field-value">
         $i18n.getText($parameters.nameValue)
       </div>
    #else
        #set( $items = $parameters.list )
        #if( $items )
            #foreach( $item in $items )
                $stack.push($item)

                #if( $parameters.listKey )
                    #set( $itemKey = $stack.findValue($parameters.listKey) )
                #else
                    #set( $itemKey = $item )
                #end

                #if( $parameters.listValue )
                    #set( $itemValue = $stack.findValue($parameters.listValue) )
                #else
                    #set( $itemValue = $item )
                #end

                <div>
                    <input type="radio" class="radio" name="${parameters.name}" value="$!{itemValue}" id="${parameters.name}.$!{itemValue}" #if( $parameters.nameValue && $itemValue && $parameters.nameValue == $itemValue )checked="checked"#end/>
                    <label for="${parameters.name}.$!{itemValue}">$!{itemKey}</label>
                </div>


                #set ($trash = $stack.pop())
            #end
            #if ($description)
                <span class="description">$description</span>
            #end
        #else
            &nbsp;
        #end
    #end

</fieldset>

