{block name='productdetails-download'}
{$lazyLoadImages=$lazyLoadImages|default:true}
<div class="productdetails-download card-columns">
    {foreach $Artikel->oDownload_arr as $oDownload}
        {if isset($oDownload->oDownloadSprache)}
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title">{$oDownload->oDownloadSprache->getName()|default:''}</h4>
                    <div class="row">
                        {block name='productdetails-download-description'}
                            <div class="col col-12">
                                {$oDownload->oDownloadSprache->getBeschreibung()|default:''}
                            </div>
                        {/block}
                        {if $oDownload->hasPreview()}
                            {block name='productdetails-download-preview'}
                                <div class="col col-12">
                                    {if $oDownload->getPreviewType() === 'music'}
                                        {block name='productdetails-download-preview-music'}
                                            <audio controls controlslist="nodownload" preload="none">
                                                <source src="{$ShopURL}/{$smarty.const.PFAD_DOWNLOADS_PREVIEW_REL}{$oDownload->cPfadVorschau}" >
                                                Your browser does not support the audio element.
                                            </audio>
                                        {/block}
                                    {elseif $oDownload->getPreviewType() === 'video'}
                                        {block name='productdetails-download-preview-video'}
                                            <video width="320" height="240" controls controlslist="nodownload" preload="none">
                                                <source src="{$ShopURL}/{$smarty.const.PFAD_DOWNLOADS_PREVIEW_REL}{$oDownload->cPfadVorschau}" >
                                                Your browser does not support the video tag.
                                            </video>
                                        {/block}
                                    {elseif $oDownload->getPreviewType() === 'image'}
                                        {block name='productdetails-download-preview-image'}
                                            {image src="{$ShopURL}/{$smarty.const.PFAD_DOWNLOADS_PREVIEW_REL}{$oDownload->cPfadVorschau}" lazy=$lazyLoadImages
                                                fluid=true alt=$oDownload->oDownloadSprache->getBeschreibung()|default:''|strip_tags}
                                        {/block}
                                    {else}
                                        {block name='productdetails-download-preview-misc'}
                                            <a href="{$ShopURL}/{$smarty.const.PFAD_DOWNLOADS_PREVIEW_REL}{$oDownload->cPfadVorschau}"
                                            title="{$oDownload->oDownloadSprache->getName()|default:''}" target="_blank">
                                                {$oDownload->oDownloadSprache->getName()|default:''}
                                            </a>
                                        {/block}
                                    {/if}
                                </div>
                            {/block}
                        {/if}
                    </div>
                </div>
            </div>
        {/if}
    {/foreach}
</div>
{/block}
