<?php
/**
 * @var $this TuningController
 * @var $currentBrand TuningBrand
 * @var $currentModel TuningModel
 * @var $sets TuningSet[]
 * @var $contacts Contact[]
 */
?>
<?php $this->renderPartial('//snippets/headerGallery'); ?>

<div class="wrapper content-wrapper">
    <div class="col-wrapper">
        <div class="col2">
            <p class="section-title"><?php echo Yii::t('site', 'Наши услуги');?></p>
            <ul class="sidebar-nav">
                <?php foreach ($this->getServices() as $item): ?>
                <li><?php echo CHtml::link($item->i18n->name, array('tuning/service', 'link' => $item->link));?></li>
                <?php endforeach; ?>
            </ul>
            <p class="section-title"><?php echo Yii::t('site', 'Марки авто')?></p>
            <ul class="sidebar-nav">
                <?php foreach ($this->getBrands() as $brand): ?>
                <?php if ($brand->id == $currentBrand->id): ?>
                    <li class="active">
                        <?php echo CHtml::link($brand->i18n->name, array('tuning/brand', 'brand' => $brand->link));?>
                        <ul>
                            <?php foreach ($brand->tuningModels as $model) if (!$model->hidden): ?>
                            <li <?php if ($model->id == $currentModel->id) echo'class="active"' ?>>
                                <?php
                                echo CHtml::link($model->i18n->name, array(
                                        'tuning/model',
                                        'brand' => $model->tuningBrand->link,
                                        'model' => $model->link)
                                );
                                ?>
                            </li>
                            <?php endif; ?>
                        </ul>
                    </li>
                    <?php else: ?>
                    <li><?php echo CHtml::link($brand->i18n->name, array('tuning/brand', 'brand' => $brand->link));?></li>
                    <?php endif; ?>
                <?php endforeach; ?>
            </ul>
        </div>
        <div class="col8">
            <ul class="crumbs">
                <li><?php echo CHtml::link(Yii::t('site', 'Тюнинг автомобилей'), array('tuning/index'));?>→</li>
                <li><?php echo CHtml::link($currentBrand->i18n->name, array(
                    'tuning/brand',
                    'brand' => $currentBrand->link,
                ));?>→
                </li>
            </ul>
            <h1><?php echo $this->pageName?></h1>

            <div class="catalog-wrapper">
                <?php foreach ($sets as $set): ?>
                <a href="<?php echo
                CHtml::encode($this->createUrl('tuning/view', array(
                    'brand' => $set->tuningModel->tuningBrand->link,
                    'model' => $set->tuningModel->link,
                    'set' => $set->link,
                )));
                    ?>" class="catalog-item big">
                    <span class="catalog-item-image">
                        <?php echo CHtml::image($set->imageBehavior->getFileUrl('medium'))?>
                    </span>
                    <span class="catalog-item-name"><?php echo $set->i18n->name?></span>
                </a>
                <?php endforeach;?>
            </div>
            <div class="col8">
                <?php echo $currentModel->i18n->content?>
            </div>

            <h2><?php echo Yii::t('site', 'Мы с удовольствием ответим на все ваши вопросы по тюнингу автомобиля');?></h2>

            <?php echo $this->tuningRoot->i18n->contact_info?>
        </div>
        <div class="col2">
            <p class="section-title"><?php echo Yii::t('site', 'Есть вопросы?');?></p>

            <div class="text-content">
                <?php echo Yii::t('site', 'Обращайтесь к вашему персональному консультанту по тюнингу!');?>
            </div>
            <?php $this->renderPartial('//snippets/sidebarContacts');?>
        </div>
    </div>
</div>
