{block title}Slovnik{/block}
{block head}
<script>
$( document ).ready(function() {
 $("img.ajax").on("click", function (event) {
    event.preventDefault();
    id = $(this).attr("data-sound-id");
    var audioElement = document.createElement('audio');
    var link = {link Home:play 123456 };
    audioElement.setAttribute('src', link.replace('123456',id));
    console.log("Play sound:" + id);
    audioElement.play();
});
});
</script>
{/block}


{block content}
{ifset $result}
		<table class="trans">	
		<tr>
			<th>Preklad</th>
		</tr>
{var $last = ''}
{foreach $result as $term}
{if ($last != $term->string1 && $last != '') }
				</div>
			</td>
		</tr>
{/if}
{if $last != $term->string1}
		<tr>
			<td>
				<span class="term">{$term->string1}</span>&nbsp;
				{foreach $term->pronunciations as $pron}
					<span class="ipa-{$pron->type->id}">[{$pron->ipa}]</span>
					<img n:if="$pron->filename" class="sound-ipa ajax" src="/assets/images/sound.png" alt="Prehraj" style="vertical-align: middle;" data-sound-id="{$pron->id}" ></image>
				{/foreach}
				<br/>
				<div style="margin-left: 20px;" class="translations">
{/if}
{$last == $term->string1 && trim($last2) != '' && trim($term->string2) != ''  ? ', ' : ''}{$term->string2}{**
	Nutne kvoli newline
**}
{var $last = $term->string1}
{var $last2 = $term->string2}
{/foreach}
		</table>
	{/ifset}
	{control paginator}
	</div>
{/block}

