portfolio.php 2.25 KB
<?php

    use common\models\Specialization;
    use common\models\User;
    use yii\data\ActiveDataProvider;
    use \yii\helpers\Html;
    use yii\helpers\Url;
    use yii\widgets\ListView;
    use yii\widgets\Pjax;

    /**
     * @var yii\web\View       $this
     * @var User               $company
     * @var ActiveDataProvider $portfolio
     * @var array              $filters
     * @var int                $filter_id
     */
    $this->params[ 'company' ] = $company;
    $this->title = 'Proektant.net';
?>
<div class="performer-vacancy-vacant-title-reclam-wr style">

    <?php
        Pjax::begin();
    ?>
    <div class="portfolio-project-wr style">
        <div class="workplace-title style">
            <p><?= Yii::t('app', 'Projects') ?>: <?= $portfolio->totalCount ?></p></div>
        <div class="portfolio-project-tags style">
            <?= Html::a("Все (".count($company->portfolios).")", [
                'company/portfolio',
                'company_id' => $company->id,
                'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
            ], [ 'class' => !isset( $filter_id ) || empty( $filter_id ) ? "active-tag" : "" ]); ?>
            <a href="#" class="active-tag"></a>
            <?php foreach($filters as $filter) {
                echo Html::a("{$filter['specialization_name']} ({$filter['count']})", Url::toRoute([
                    'company/portfolio-filter',
                    'company_id' => $company->id,
                    'filter'     => $filter['specialization_id'],
                    'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                ]), [ 'class' => isset( $filter_id ) && $filter['specialization_id'] == $filter_id ? "active-tag" : "" ]);
            } ?>

        </div>
    </div>

    <div class="style">
        <div class="portfolio-project-blocks-wrapper">
            <?= ListView::widget([
                'dataProvider' => $portfolio,
                'itemView'     => '_portfolio_list_view',
                'layout'       => "{items}\n<div class='navi-buttons-wr style'>{pager}</div>",
                'viewParams'   => [ 'parent_view' => $this ],
            ]); ?>

        </div>
    </div>
    <?php
        Pjax::end();
    ?>

</div>