{script}
{literal}
document.vote = function (id, vote)
{
$.ajax(
{
type: 'post',
url: {/literal}'{url_for for="LINKS_CTRL_List:vote:[]"}'{literal},
data: {itemId: id, vote: vote},
dataType: 'json',
success: function(json){
if(typeof(json.isAuthenticated) != 'undefined' && json.isAuthenticated == false)
{
OW.info(json.msg);
return;
}
{/literal}{if $mode == 'detailed'}{literal}
$('#lvru-'+id).empty().html(json.total.up);
$('#lvrd-'+id).empty().html(json.total.down);
{/literal} {else}{literal}
$('#lvrt-'+id).empty().html(json.total.sum? json.total.sum : 0);
{/literal}{/if}
{literal}
switch(json.voteType)
{
case "+1":
$('#vote-lbl-'+id).removeClass('ow_red');
$('#vote-lbl-'+id).addClass('ow_green');
$('#vote-lbl-'+id+'-container').show();
break;
case "-1":
$('#vote-lbl-'+id).removeClass('ow_green');
$('#vote-lbl-'+id).addClass('ow_red');
$('#vote-lbl-'+id+'-container').show();
break;
case 0:
$('#vote-lbl-'+id).removeClass('ow_green');
$('#vote-lbl-'+id).removeClass('ow_red');
$('#vote-lbl-'+id+'-container').hide();
return;
break;
}
$('#vote-lbl-'+id).html(json.voteType);
}
}
);
}
{/literal}
{/script}
{if $isBrowseByTagCase}
{if $tag}
{else}
{$tagCloud}
{/if}
{/if}
{foreach from=$list item='link'}
{assign var='dto' value=$link.dto}
{assign var='id' value=$dto->getId()}
{block_decorator name="box" type="empty" label=$dto->title|truncate:$titleLength:'...' capAddClass="ow_smallmargin" iconClass='ow_ic_link' href="`$dto->url`" extraString='target="_blank"' addClass="ow_stdmargin" toolbar=$tb[$id]}
{assign var='userId' value=$dto->userId}
{$dto->description}
{/block_decorator}
{foreachelse}
{text key='base+empty_list'}
{/foreach}
{if $paging}