Пример #1
0
<?php

use yii\helpers\Html;
use frontend\modules\tag\models\Category;
use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */
if (!empty($q)) {
    $this->title = ucfirst($q) . ' Torrents Search Results';
} elseif (!empty($iht)) {
    $this->title = mb_convert_case($iht, MB_CASE_TITLE, 'utf-8') . ' Torrents';
} else {
    $this->title = "Search";
}
?>

<div class="p bg-white mb">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo GridView::widget(['dataProvider' => $torrents, 'tableOptions' => ['class' => 'table-torrents table table-striped table-bordered'], 'summary' => false, 'emptyText' => "Blimey! Nothing was found. Try to search again with a different query.", 'columns' => [['class' => frontend\widgets\grid\TorrentTitleColumn::className(), 'attribute' => 'name', 'label' => 'Torrents'], ['class' => frontend\widgets\grid\TorrentAgeColumn::className(), 'attribute' => 'created_at', 'label' => 'Age'], ['class' => frontend\widgets\grid\TorrentSizeColumn::className(), 'attribute' => 'size', 'label' => 'Size'], ['attribute' => 'seeders', 'label' => 'S'], ['attribute' => 'leechers', 'label' => 'L']], 'pager' => ['options' => ['class' => 'pagination'], 'firstPageLabel' => '««', 'lastPageLabel' => '»»', 'nextPageLabel' => '»', 'prevPageLabel' => '«']]);
?>

</div>
Пример #2
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('torrent', 'Torrents');
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="p bg-white mb">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table-torrents table table-striped table-bordered'], 'summary' => false, 'columns' => [['class' => frontend\widgets\grid\TorrentTitleColumn::className()], ['class' => frontend\widgets\grid\TorrentAgeColumn::className()], ['class' => frontend\widgets\grid\TorrentSizeColumn::className()], ['attribute' => 'seeders', 'header' => 'S'], ['attribute' => 'leechers', 'header' => 'L']], 'pager' => ['options' => ['class' => 'pagination'], 'firstPageLabel' => '««', 'lastPageLabel' => '»»', 'nextPageLabel' => '»', 'prevPageLabel' => '«']]);
?>

</div>
Пример #3
0
<?php

use yii\grid\DataColumn;
use yii\grid\GridView;
/* @var $this yii\web\View */
$this->title = "Latest Torrents";
$this->params['isRecent'] = true;
$tmpPage = \Yii::$app->request->get('page');
$page = intval($tmpPage) > 0 ? intval($tmpPage) : 1;
$pageSize = $torrents->pagination->pageSize;
$from = $page == 1 ? 1 : ($page - 1) * $pageSize + 1;
$to = $page * $pageSize > 10000 ? 10000 : $page * $pageSize;
?>

<?php 
echo GridView::widget(['dataProvider' => $torrents, 'tableOptions' => ['class' => 'result'], 'layout' => '<div class="title">
                <h2 class="left"><span class="bold">Latest Torrents</span></h2>
                <span class="right font-12">Displaying hits from ' . $from . ' to ' . $to . '</span>
                <div class="clear"></div>
            </div>{summary}<div class="panel panel-default"><div class="table-responsive">{items}</div><div class="table-footer"><div class="navigation">{pager}</div></div></div>', 'summary' => false, 'emptyText' => "Blimey! Nothing was found. Try to search again with a different query.", 'columns' => [['class' => frontend\widgets\grid\TorrentTitleColumn::className(), 'options' => ['style' => 'width:64%'], 'label' => 'Name'], ['class' => frontend\widgets\grid\TorrentAgeColumn::className(), 'options' => ['style' => 'width:8%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'label' => 'Age'], ['class' => frontend\widgets\grid\TorrentSizeColumn::className(), 'options' => ['style' => 'width:8%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'label' => 'Size'], ['class' => \yii\grid\DataColumn::className(), 'options' => ['style' => 'width:5%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'attribute' => 'seeders', 'label' => 'SE'], ['class' => DataColumn::className(), 'options' => ['style' => 'width:5%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'attribute' => 'leechers', 'label' => 'LE']], 'pager' => ['options' => ['class' => 'center'], 'activePageCssClass' => 'disabled', 'firstPageCssClass' => 'border-none', 'lastPageCssClass' => 'border-none', 'nextPageCssClass' => 'border-none', 'prevPageCssClass' => 'border-none', 'firstPageLabel' => '<i class="icon-12 two-left-arrow v-sub"></i>', 'lastPageLabel' => '<i class="icon-12 two-right-arrow v-sub"></i>', 'nextPageLabel' => '<i class="icon-12 one-right-arrow v-sub"></i>', 'prevPageLabel' => '<i class="icon-12 one-left-arrow v-sub"></i>']]);
Пример #4
0
    $tagId = array_search($tag, Category::$categoriesTags);
    ?>
    <div class="torrents">
        <div class="title">
            <h2><a href="<?php 
    echo Url::toRoute(['/search', 'iht' => $tagId, 'age' => 0]);
    ?>
"
                   class="bold border-none"><?php 
    echo Html::encode($tag);
    ?>
</a></h2>
        </div>
        <!--<a href="<?php 
    echo Url::toRoute(['/search', 'iht' => $tagId, 'ihs' => 1, 'age' => 1]);
    ?>
">For last day only</a>-->
        <?php 
    if (isset($torrents[$tagLower])) {
        ?>

            <?php 
        echo GridView::widget(['dataProvider' => $torrents[$tagLower], 'tableOptions' => ['class' => 'result'], 'summary' => false, 'columns' => [['class' => frontend\widgets\grid\TorrentTitleColumn::className(), 'options' => ['style' => 'width:74%'], 'label' => 'Name'], ['class' => frontend\widgets\grid\TorrentAgeColumn::className(), 'options' => ['style' => 'width:8%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'label' => 'Age'], ['class' => frontend\widgets\grid\TorrentSizeColumn::className(), 'options' => ['style' => 'width:8%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'label' => 'Size'], ['class' => \yii\grid\DataColumn::className(), 'options' => ['style' => 'width:5%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'attribute' => 'seeders', 'label' => 'SE'], ['class' => DataColumn::className(), 'options' => ['style' => 'width:5%'], 'contentOptions' => ['class' => 'v-middle font-12'], 'attribute' => 'leechers', 'label' => 'LE']], 'pager' => false]);
        ?>
        <?php 
    }
    ?>

    </div>
<?php 
}