<?php $is_first_widget = $this->addJS('templates/default/js/rating.js'); ?>
<div class=«rating_widget <?php echo $target_controller.'_'.$target_subject; ?>_rating» id=«rating-<?php echo $target_subject; ?>-<?php echo $target_id; ?>»
<?php if ($is_enabled || $options['is_show']){ ?>
data-target-controller="<?php echo $target_controller; ?>"
data-target-subject="<?php echo $target_subject; ?>"
data-target-id="<?php echo $target_id; ?>"
<?php if ($options['is_show']){ ?>
data-info-url="<?php echo $this->href_to('info'); ?>"
<?php } ?>
<?php } ?>
>
<?php if($label){ ?>
<div class=«rating_label»><?php echo $label; ?></div>
<?php } ?>
<div class=«arrow up <?php echo $is_voted? 'data-rating-voted': 'no-data-rating-voted'; ?>»>
<?php if ($is_enabled){ ?>
<a href="#vote-up" class=«vote-up» title="<?php echo LANG_RATING_VOTE_UP; ?>">
<svg viewBox=«0 0 90 90» class=«style-svg»><g class=«style-svg»><path d=«M88.476,15.769C84.2,6.189,75.122,0,65.35,0c-9.9,0-16.26,4.403-19.948,9.104C41.713,4.404,35.354,0,25.453,0 C15.681,0,6.603,6.189,2.327,15.769c-4.419,9.901-2.472,20.925,5.212,29.488C26.14,65.995,42.576,80.695,42.739,80.841 c0.76,0.676,1.712,1.014,2.662,1.014c0.951,0,1.903-0.338,2.662-1.014c0.163-0.146,16.601-14.846,35.2-35.584 C90.946,36.693,92.895,25.67,88.476,15.769z M77.309,39.915C63.394,55.428,50.73,67.49,45.401,72.432 c-5.329-4.942-17.991-17.004-31.906-32.517c-5.596-6.236-7.002-13.85-3.861-20.887C12.577,12.433,18.935,8,25.453,8 c12.892,0,15.782,9.582,16.063,10.643c0.438,1.79,2.043,3.049,3.886,3.049c1.844,0,3.447-1.259,3.887-3.049 C49.393,18.208,52.044,8,65.35,8c6.52,0,12.876,4.433,15.82,11.028C84.311,26.066,82.903,33.679,77.309,39.915z» class=«style-svg»></path></g></svg>
</a>
<?php } else { ?>
<span class=«disabled» title="<?php html($is_voted? LANG_RATING_VOTED: LANG_RATING_DISABLED); ?>">
<svg viewBox=«0 0 90 90» class=«style-svg»><g class=«style-svg»><path d=«M88.476,15.769C84.2,6.189,75.122,0,65.35,0c-9.9,0-16.26,4.403-19.948,9.104C41.713,4.404,35.354,0,25.453,0 C15.681,0,6.603,6.189,2.327,15.769c-4.419,9.901-2.472,20.925,5.212,29.488C26.14,65.995,42.576,80.695,42.739,80.841 c0.76,0.676,1.712,1.014,2.662,1.014c0.951,0,1.903-0.338,2.662-1.014c0.163-0.146,16.601-14.846,35.2-35.584 C90.946,36.693,92.895,25.67,88.476,15.769z M77.309,39.915C63.394,55.428,50.73,67.49,45.401,72.432 c-5.329-4.942-17.991-17.004-31.906-32.517c-5.596-6.236-7.002-13.85-3.861-20.887C12.577,12.433,18.935,8,25.453,8 c12.892,0,15.782,9.582,16.063,10.643c0.438,1.79,2.043,3.049,3.886,3.049c1.844,0,3.447-1.259,3.887-3.049 C49.393,18.208,52.044,8,65.35,8c6.52,0,12.876,4.433,15.82,11.028C84.311,26.066,82.903,33.679,77.309,39.915z» class=«style-svg»></path></g></svg>
</span>
<?php } ?>
</div>
<div class=«score» title="<?php echo LANG_RATING; ?>">
<?php if (!$show_rating){ ?>
<span>—</span>
<?php } else { ?>
<span class="<?php echo html_signed_class($current_rating); ?><?php if ($options['is_show']) { ?> clickable<?php } ?>">
<?php echo html_signed_num($current_rating); ?>
</span>
<?php } ?>
</div>
</div>
<?php if ($is_first_widget) { ?>
<script>
icms.rating.setOptions({
url: '<?php echo $this->href_to('vote'); ?>'
});
</script>
<?php }?>
<style>
.rating_widget .data-rating-voted .style-svg {fill:red;}
.rating_widget .no-data-rating-voted .style-svg {
// fill:#2196F3; зеленый
fill: #777;
}
</style>