<?php
/**
 * underscore.js template for the shared shortcodes GUI.
 * 
 * Component: select2 attributes
 *
 * @since 3.1
 */
?>
<script type="text/html" id="tmpl-toolset-shortcode-attribute-select2">
    <select id="{{{data.shortcode}}}-{{{data.attribute}}}" class="js-shortcode-gui-field js-toolset-shortcode-gui-field-select2<# if ( data.required ) { #> js-toolset-shortcode-gui-required<# } #>">
        <#
        if ( _.has( data, 'options' ) ) {
            _.each( data.options, function( optionLabel, optionKey ) {
            #>
            <option value="{{{optionKey}}}"<# if ( optionKey == data.defaultForceValue ) { #> selected="selected"<# } #>>
                {{{optionLabel}}}
            </option>
            <#
            });
        }
        #>
    </select>
</script>