<?php
slot('title', __('Смотреть'));
include_partial('main/breadcrumbs');
echo '<h1 class="content_title">' . __('Смотреть') . '</h1>';
?>
<div class="video_item_gutter" style="width: 100%; text-align: center">
    <?php
    if (count($reviews) >= sfConfig::get('app_view_count_tag')) {
        echo '<a data-tag-id="all" class="videos_show_tag green_link ' . (!$tag_id || $tag_id == 'all' ? 'active' : '') . '">Все</a>';
        foreach ($videos_tags as $tag) {
            echo '<a class="videos_show_tag green_link ' . ($tag_id == $tag['id'] ? 'active' : '') . '" data-tag-id="' . $tag['id'] . '">' . $tag['Translation'][$culture]['title'] . '</a>';
        }
    }
    ?>
</div>
<div class="videos_wrap">
    <?php include_partial("video/video", array('videos' => $videos, 'culture' => $culture)); ?>
</div>
<script>

    var culture = '<?php echo $culture ?>';
    $('body').on('click', '.videos_show_tag', function () {
        //alert('123');
        _this = this;
        $.ajax({
            url: '/' + culture + '/video/',
            type: 'get',
            data: {tag_id : $(this).attr('data-tag-id'), ajax : 1},
            success: function (html) {
                $('.videos_show_tag').removeClass('active');
                $(_this).addClass('active');
                $('.videos_wrap').html(html);
                setUrlHash('?tag_id='+$(_this).attr('data-tag-id'));
            }

        });

        //alert($(this).attr('data-tag-id'));
    });
</script>