<commit_before><?php

/* @var $this yii\web\View */
/* @var $menu array */
/* @var $restaurant \app\models\Restaurant */
/* @var $dishes \app\models\Dish[] */
/* @var $cart array */
use kartik\rating\StarRating;
use yii\bootstrap\Modal;
use yii\widgets\Menu;
use yii\helpers\Html;
use app\models\Delivery;
use nirvana\showloading\ShowLoadingAsset;

//Подключение стилей и скритов для прелоадера
ShowLoadingAsset::register($this);

//Скрипт для добавления\редактирвоания корзины
$this->registerJsFile('/js/cart.js', ['depends' => 'yii\web\JqueryAsset']);

/** @var \yii\web\Controller $controller */
$controller = $this->context;
$this->title = $restaurant->name;
?>
<div class="site-index">

    <div class="body-content">

        <div class="row">
            <div class="col-md-3 sidebar">
                <div class="row">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div>
                                <?= $restaurant->name ?>
                                <div class="pull-right">
                                    <?php
                                    for($i = 0; $i < $restaurant->rating; $i++) echo '<span class="glyphicon glyphicon-star"></span>';
                                    for($i = $restaurant->rating; $i < 5; $i++) echo '<span class="glyphicon glyphicon-star-empty"></span>';
                                    ?>
                                </div>
                            </div>
                            <?php
                            $img =  is_object($restaurant->image) ?
                                Html::img(DIRECTORY_SEPARATOR . $restaurant->image->filepath, ['style' => ['width' => '200px', 'height' => '250px']]) : '';
                            ?>
                            <div class="text-center"><?= $img ?></div>
                            <div>Акций не придумано</div>
                            <div><?= $restaurant->work_time ?></div>
                            <div>Доставка - <?= $restaurant->delivery_price ?> руб.</div>
                            <div>Бесплатная доставка - <?= $restaurant->delivery_free ?> руб.</div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <h3>Выбор заведения</h3>

                    <?php
                    $items = array(
                        array(
                            'label' => 'Все блюда',
                            'url' => ['index', 'name' => $restaurant->system_name],
                        )
                    );
                    /** @var \app\models\FoodType $_item */
                    foreach($menu as $_item) {
                        $img =  is_object($_item->image) ?
                            Html::img(DIRECTORY_SEPARATOR . $_item->image->filepath, ['style' => ['width' => '32px', 'height' => '32px']]) : '';
                        $items[] = [
                            'label' => $img . $_item->name,
                            'url' => ['index', 'name' => $restaurant->system_name, 'food' => $_item->system_name],
                            'active' => ($_item->system_name === $controller->actionParams['food'])
                        ];
                    }
                    echo Menu::widget([
                        'options' => ['class' => 'nav nav-pills nav-stacked'],
                        'items' => $items,
                        'encodeLabels' => false,
                    ]);
                    ?>
                </div>
            </div>
            <div class="col-md-9">
                <?php if($dishes): ?>
                    <?php foreach($dishes as $_dish): ?>
                        <div class="panel panel-default pull-left" id="dish-<?= $_dish->id ?>">
                            <div class="panel-body">
                                <div><?= $_dish->name ?></div>
                                <?php
                                $img =  is_object($_dish->image) ?
                                    Html::img(DIRECTORY_SEPARATOR . $_dish->image->filepath, ['style' => ['width' => '200px', 'height' => '250px']]) : '';
                                ?>
                                <div class="text-center"><?= $img ?></div>
                                <div>
                                    <table class="table">
                                        <tr>
                                            <td>Вес:<br/><?= $_dish->weight ?> г.</td>
                                            <td>
                                                <?php if($_dish->discount): ?>
                                                    <s><?= $_dish->price ?></s> руб.<br>
                                                <?php endif; ?><commit_msg>вывод скидки на товаре<commit_after><?php

/* @var $this yii\web\View */
/* @var $menu array */
/* @var $restaurant \app\models\Restaurant */
/* @var $dishes \app\models\Dish[] */
/* @var $cart array */
use kartik\rating\StarRating;
use yii\bootstrap\Modal;
use yii\widgets\Menu;
use yii\helpers\Html;
use app\models\Delivery;
use nirvana\showloading\ShowLoadingAsset;

//Подключение стилей и скритов для прелоадера
ShowLoadingAsset::register($this);

//Скрипт для добавления\редактирвоания корзины
$this->registerJsFile('/js/cart.js', ['depends' => 'yii\web\JqueryAsset']);

/** @var \yii\web\Controller $controller */
$controller = $this->context;
$this->title = $restaurant->name;
?>
<div class="site-index">

    <div class="body-content">

        <div class="row">
            <div class="col-md-3 sidebar">
                <div class="row">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div>
                                <?= $restaurant->name ?>
                                <div class="pull-right">
                                    <?php
                                    for($i = 0; $i < $restaurant->rating; $i++) echo '<span class="glyphicon glyphicon-star"></span>';
                                    for($i = $restaurant->rating; $i < 5; $i++) echo '<span class="glyphicon glyphicon-star-empty"></span>';
                                    ?>
                                </div>
                            </div>
                            <?php
                            $img =  is_object($restaurant->image) ?
                                Html::img(DIRECTORY_SEPARATOR . $restaurant->image->filepath, ['style' => ['width' => '200px', 'height' => '250px']]) : '';
                            ?>
                            <div class="text-center"><?= $img ?></div>
                            <div>Акций не придумано</div>
                            <div><?= $restaurant->work_time ?></div>
                            <div>Доставка - <?= $restaurant->delivery_price ?> руб.</div>
                            <div>Бесплатная доставка - <?= $restaurant->delivery_free ?> руб.</div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <h3>Выбор заведения</h3>

                    <?php
                    $items = array(
                        array(
                            'label' => 'Все блюда',
                            'url' => ['index', 'name' => $restaurant->system_name],
                        )
                    );
                    /** @var \app\models\FoodType $_item */
                    foreach($menu as $_item) {
                        $img =  is_object($_item->image) ?
                            Html::img(DIRECTORY_SEPARATOR . $_item->image->filepath, ['style' => ['width' => '32px', 'height' => '32px']]) : '';
                        $items[] = [
                            'label' => $img . $_item->name,
                            'url' => ['index', 'name' => $restaurant->system_name, 'food' => $_item->system_name],
                            'active' => ($_item->system_name === $controller->actionParams['food'])
                        ];
                    }
                    echo Menu::widget([
                        'options' => ['class' => 'nav nav-pills nav-stacked'],
                        'items' => $items,
                        'encodeLabels' => false,
                    ]);
                    ?>
                </div>
            </div>
            <div class="col-md-9">
                <?php if($dishes): ?>
                    <?php foreach($dishes as $_dish): ?>
                        <div class="panel panel-default pull-left" id="dish-<?= $_dish->id ?>" style="max-height: 378px">
                            <div class="panel-body">
                                <div><?= $_dish->name ?></div>
                                <?php
                                $img =  is_object($_dish->image) ?
                                    Html::img(DIRECTORY_SEPARATOR . $_dish->image->filepath, ['style' => ['width' => '200px', 'height' => '250px']]) : '';
                                ?>
                                <div class="text-center"><?= $img ?></div>
                                <?php if($_dish->discount): ?>
                                    <div class="bg-danger" style="position:relative;top:-20px;">Скидка <?= $_dish->discount ?>%</div>
                                <?php endif; ?>
                                <div>
                                    <table class="table">
                                        <tr>
                                            <td>Вес:<br/><?= $_dish->weight ?> г.</td>
                                            <td>
                                                <?php if($_dish->discount): ?>
                                                    <s><?= $_dish->price ?></s> руб.<br>
                                                <?php endif; ?>
{'fraction_non_alphanumeric': 0.15596699537130207, 'fraction_numerical': 0.004930569531092775, 'mean_word_length': 1.0258866693844273, 'pattern_counts': {'":': 0, '<': 150, '<?xml version=': 0, '>': 252, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5752850', 'n_tokens_mistral': 2675, 'n_tokens_neox': 2554, 'n_words': 464}