<?php
$this->pageTitle = $info->name;
?>
<div class="build-view_block">
    <div class="build-view_img">
        <img src="/images/buildings/1.png" height="100px">
    </div>
    <div class="build-view_info">
        <?php echo $info->info; ?>
    </div>
</div>
<div class="row">
    <div class="col-xs-6 text-center">
        Уровень: <span class="percent"><?php echo $building->level; ?></span>
    </div>
    <div class="col-xs-6 text-center">
        Бонус: <span class="percent">+<?php echo (isset($user->guild_buff) && $user->guild_buff_time > time() ? $user->guild_buff : 0); ?>%</span> <span class="grey">(<?php echo FuncHelper::timeToCount(( isset($user->guild_buff_time) && $user->guild_buff_time > time() ? $user->guild_buff_time-time() : 0)); ?>)</span>
    </div>
</div>
<?php if ($building->level > 0):?>
    <?php echo CHtml::link('Пожертвовать <img src="/images/icons/iron.png" alt="*">'.($building->level*100).' железа <span class="pull-right grey">[бонус +'.($building->level*0.5).'%]</span>', array('/guild/buildingInfo/', 'id' => $model->id_guild, 'build'=>$building->id_building, 'do' => 'active'), array('class'=>'block')); ?>
<?php endif;?>
<?php if ($building->level < $model->level):?>
    <div class="title text-center">Прогресс постройки:</div>
    <div class="text-center">
        <img src="/images/icons/iron.png" alt="*"> Железо: <span class="percent"><?php echo isset($building->iron) ? $building->iron : 0; ?> из <?php echo $progress['need'];?></span><br />
        <div class="progress">
            <div class="progress-bar progress-bar-default progress-bar-striped active" role="progressbar" aria-valuenow="<?php echo $progress['percent'];?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $progress['percent'];?>%">
                <span class="sr-only"><?php echo $progress['percent'];?>% выполенено</span>
            </div>
        </div>
    </div>
    <div class="info">В Тайнике <img src="/images/icons/iron.png" alt="*"><span class="percent"><?php echo $model->iron; ?></span> железа.</div>
    <?php foreach ($types as $type):?>
        <?php echo CHtml::link('Добавить <img src="/images/icons/iron.png" alt="*">'.$type.' железа', array('/guild/buildingInfo/', 'id' => $model->id_guild, 'build'=>$building->id_building, 'type' => $type), array('class'=>'block')); ?>
    <?php endforeach;?>
    <span class="grey">Строить и повышать уровень алтаря могут только капитаны легиона и выше!</span>
<?php else:?>
    <div class="info text-center">Уровень постройки достиг уровня легиона, дальнейшая постройка невозможна.</div>
<?php endif;?>