<?php
/* @var $this UserController */
/* @var $model Users */
$this->pageTitle = ($model->id_user == Yii::app()->user->id ? 'Мои навыки' : 'Навыки '.$model->login);
?>
<?php if (!$abilities): ?>
    <div class="info">У вас нет ещё навыков. Перейдите в магазин чтобы купить!</div>
<?php else: ?>
    <?php foreach($abilities as $ability):?>
		<div class="item-view">
			<div class="item-view_img">
				<img src="/images/abilities/<?php echo $ability->id_ability; ?>/<?php echo $ability->idType->type; ?>.jpg">
			</div>
			<div class="item-view_info">
				<img src="/images/icons/quality/<?php echo $ability->idType->type; ?>.png" alt="*"/> <?php echo $ability->idAbility->name_ability; ?>, <?php echo FuncHelper::getQuality($ability->idType->type); ?><br />
				<img src="/images/icons/quality/<?php echo $ability->idType->type; ?>.png" alt="*"/> <?php echo $ability->idAbility->info; ?>: <span class="percent"><?php echo FuncHelper::abilityShopInfo($ability->idType); ?></span><br /> 
				<?php echo CHtml::link('инфо', ['/shop/viewAbility', 'id' => $ability->id_ability], ['class' => 'btn btn-default btn-sm']); ?>
				<?php echo ($ability->chosen < 3 ? CHtml::link('Первый', ['/user/abilities', 'id' => $model->id_user, 'ability' => $ability->id], ['class' => 'btn btn-default btn-sm']) : ''); ?>
			</div>
		</div>
		<hr>
    <?php endforeach;?>
<?php endif; ?>
<?php echo CHtml::link('<img src="/images/icons/ability.png" alt="*"> Магазин навыков', ['/shop/abilities'], ['class' => 'block']); ?>