indexSuccess.php 1.46 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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>