Blame view

frontend/views/site/index.php 12.1 KB
c7b6386e   Alex Savenko   conflict
1
  
6ba3c88a   Alex Savenko   all
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  <?php
      use artbox\catalog\models\Brand;
      use artbox\catalog\models\Category;
      use artbox\catalog\models\Product;
      use artbox\core\components\SeoComponent;
      use artbox\core\helpers\ImageHelper;
      use artbox\weblog\models\Article;
      use yii\bootstrap\Html;
      use yii\helpers\Url;
      use yii\web\View;
      
      /**
       * @var View         $this
       * @var Category[]   $categories
       * @var Product[]    $topItems
       * @var Product[]    $newItems
       * @var Product[]    $saleItems
       * @var int          $brandCount
       * @var int          $productCount
       * @var Brand[]      $brands
       * @var SeoComponent $seo
       * @var Article[]    $articles
       */
      $this->title = 'My Yii Application';
      $seo = Yii::$app->get('seo');
  ?>
  <section class="category-carousel-box">
    <!-- *** HOMEPAGE CAROUSEL ***
  _________________________________________________________ -->
    <div class="container">
      
      <div class="row">
38a9a9a6   Виталий   q
34
35
        <div class="hidden-xs hidden-sm col-md-3">
            <!-- если нет вложенности в меню то добавлять родительським li класс ".no-child-menu" -->
6ba3c88a   Alex Savenko   all
36
37
38
39
40
41
42
43
44
45
            <?php
                echo $this->render(
                    '@frontend/views/layouts/_category_menu',
                    [
                        'isHome' => true,
                    ]
                );
            ?>
        </div>
        
38a9a9a6   Виталий   q
46
        <div class="col-xs-12 col-sm-12 col-md-9">
6ba3c88a   Alex Savenko   all
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
          <div class="home-carousel" style="min-height:384px;">
            
            <div class="dark-mask"></div>
            
            <div class="homepage owl-carousel">
              <div class="item">
                <div class="row">
                  <div class="col-sm-5">
                  </div>
                  <div class="col-sm-7">
                  </div>
                </div>
              </div>
            </div>
            <!-- /.project owl-slider -->
          </div>
        </div>
      </div>
    </div>
    <!-- *** HOMEPAGE CAROUSEL END *** -->
  </section>
  
  
  <section>
    <div class="container">
38a9a9a6   Виталий   q
72
73
74
        <div class="hidden-xs hidden-sm col-md-3"></div>
        <div class="col-xs-12 col-sm-12 col-md-9">
            <?php
6ba3c88a   Alex Savenko   all
75
76
            if (!empty($newItems)) {
                ?>
38a9a9a6   Виталий   q
77
78
79
80
81
82
83
                <div class="heading text-center">
                    <h2><?php echo \Yii::t('app', 'Новинки'); ?></h2>
                </div>
  
                <div class="product-carousel">
                    <div class="homepage owl-carousel">
                        <?php
6ba3c88a   Alex Savenko   all
84
85
86
                        $newItemsArrays = array_chunk($newItems, 4);
                        foreach ($newItemsArrays as $newItemsArray) {
                            ?>
38a9a9a6   Виталий   q
87
88
89
90
91
92
93
94
95
96
97
98
                            <div class="products">
                                <?php
                                foreach ($newItemsArray as $product) {
                                    echo $this->render(
                                        '_slider_product',
                                        [
                                            'product' => $product,
                                        ]
                                    );
                                }
                                ?>
                            </div>
6ba3c88a   Alex Savenko   all
99
100
                            <?php
                        }
38a9a9a6   Виталий   q
101
102
                        ?>
                    </div>
6ba3c88a   Alex Savenko   all
103
                </div>
6ba3c88a   Alex Savenko   all
104
105
106
107
                <?php
            }
            if (!empty($saleItems)) {
                ?>
38a9a9a6   Виталий   q
108
109
110
111
112
113
                <div class="heading text-center">
                    <h2><?php echo \Yii::t('app', 'Акции'); ?></h2>
                </div>
                <div class="product-carousel">
                    <div class="homepage owl-carousel">
                        <?php
6ba3c88a   Alex Savenko   all
114
115
116
                        $newItemsArrays = array_chunk($saleItems, 4);
                        foreach ($newItemsArrays as $newItemsArray) {
                            ?>
38a9a9a6   Виталий   q
117
118
119
120
121
122
123
124
125
126
127
128
                            <div class="products">
                                <?php
                                foreach ($newItemsArray as $product) {
                                    echo $this->render(
                                        '_slider_product',
                                        [
                                            'product' => $product,
                                        ]
                                    );
                                }
                                ?>
                            </div>
6ba3c88a   Alex Savenko   all
129
130
                            <?php
                        }
38a9a9a6   Виталий   q
131
132
                        ?>
                    </div>
6ba3c88a   Alex Savenko   all
133
                </div>
6ba3c88a   Alex Savenko   all
134
135
136
137
                <?php
            }
            if (!empty($topItems)) {
                ?>
38a9a9a6   Виталий   q
138
139
140
141
142
143
                <div class="heading text-center">
                    <h2><?php echo \Yii::t('app', 'Топ'); ?></h2>
                </div>
                <div class="product-carousel">
                    <div class="homepage owl-carousel">
                        <?php
6ba3c88a   Alex Savenko   all
144
145
146
                        $newItemsArrays = array_chunk($topItems, 4);
                        foreach ($newItemsArrays as $newItemsArray) {
                            ?>
38a9a9a6   Виталий   q
147
148
149
150
151
152
153
154
155
156
157
158
                            <div class="products">
                                <?php
                                foreach ($newItemsArray as $product) {
                                    echo $this->render(
                                        '_slider_product',
                                        [
                                            'product' => $product,
                                        ]
                                    );
                                }
                                ?>
                            </div>
6ba3c88a   Alex Savenko   all
159
160
                            <?php
                        }
38a9a9a6   Виталий   q
161
162
                        ?>
                    </div>
6ba3c88a   Alex Savenko   all
163
                </div>
6ba3c88a   Alex Savenko   all
164
165
                <?php
            }
38a9a9a6   Виталий   q
166
167
            ?>
        </div>
6ba3c88a   Alex Savenko   all
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
    </div>
  </section>
  
  <section class="bar color-white no-mb">
    <div class="container">
      <div class="row showcase">
        <div class="col-md-4 col-sm-6">
          <div class="item">
            <div class="icon"><i class="fa fa-cubes"></i>
            </div>
            <h4><span class="counter"><?php echo $productCount; ?></span><br>
              
              Позиций товаров</h4>
          </div>
        </div>
        <div class="col-md-4 col-sm-6">
          <div class="item">
            <div class="icon"><i class="fa fa-tags"></i>
            </div>
            <h4><span class="counter"><?php echo $brandCount; ?></span><br>
              
              Брендов</h4>
          </div>
        </div>
        <div class="col-md-4 col-sm-6">
          <div class="item">
            <div class="icon"><i class="fa fa-copy"></i>
            </div>
            <h4><span class="counter">12</span> ... <span class="counter">36</span><br>
              
              Месяцев Гарантия </h4>
          </div>
        </div>
      </div>
      <!-- /.row -->
    </div>
    <!-- /.container -->
  </section>
  <!-- /.bar -->
  <?php
      if (!empty($brands)) {
          ?>
        <section class="bar background-gray no-mb">
          <div class="container">
            <div class="row">
              <div class="col-md-12">
                <div class="heading text-center">
                  <h2><?php echo \Yii::t('app', 'Бренды'); ?></h2>
                </div>
    
                <ul class="owl-carousel customers brand-carousel">
                    <?php
                        foreach ($brands as $brand) {
                            echo Html::tag(
                                'div',
                                Html::img(
                                    ImageHelper::set($brand->image->getPath())
                                               ->setWidth(150)
                                               ->render(),
                                    [
                                        'class' => 'img-responsive',
                                    ]
                                ),
                                [
                                    'class' => 'item',
                                ]
                            );
                        }
                    ?>
                </ul>
                <!-- /.owl-carousel -->
              </div>
            
            </div>
          </div>
        </section>
          <?php
      }
  ?>
  <section class="bar background-white no-mb">
    <div class="container">
      
      <div class="col-md-12">
        <div class="heading text-center">
          <h2>Полезные статьи</h2>
        </div>
    
        <p class="lead">Идейные соображения высшего порядка, а также постоянное информационно-пропагандистское обеспечение нашей деятельности требуют от нас анализа позиций, занимаемых участниками в отношении поставленных задач. Не следует, однако забывать, что консультация с широким активом влечет за собой процесс внедрения и модернизации позиций, занимаемых участниками в отношении поставленных задач.
38a9a9a6   Виталий   q
256
          <a href="/blog/index">Почитайте наш блог!</a>
6ba3c88a   Alex Savenko   all
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
        </p>
        
        <!-- *** BLOG HOMEPAGE ***
  _________________________________________________________ -->
        
        <div class="row">
            
            <?php foreach ($articles as $article) { ?>
              <div class="col-md-3 col-sm-6">
                <div class="box-image-text blog">
                  <div class="top">
                    <div class="image">
                        <?= ImageHelper::set(
                            $article->image ? $article->image->getPath() : '@frontend/web/img/no-image.png'
                        )
                                       ->cropResize(255, 192)
                                       ->renderImage(
                                           [
                                               'class' => 'img-responsive',
                                               'alt'   => $article->lang->title,
                                           ]
                                       ) ?>
                    </div>
                    <div class="bg"></div>
                    <div class="text">
                      <p class="buttons">
                        <a href="<?= Url::to(
                            [
                                'blog/article',
                                'id' => $article->id,
                            ]
                        ) ?>" class="btn btn-template-transparent-primary"><i class="fa fa-link"></i> <?php echo \Yii::t(
                                'app',
                                'Read more'
                            ); ?></a>
                      </p>
                    </div>
                  </div>
                  <div class="content">
                    <h4><a href="<?= Url::to(
                            [
                                'blog/article',
                                'id' => $article->id,
                            ]
                        ) ?>"><?= $article->lang->title; ?></a></h4>
                      <?php if ( !empty($article->category) ) { ?>
                    <p class="author-category"><a href="<?= Url::to(
                            [
                                'blog/category',
                                'id' => $article->category->id,
                            ]
                        ) ?>"><?= $article->category->lang->title ?></a>
                        <?php } ?>
                    </p>
                    <p class="intro"><?= $article->lang->body_preview; ?></p>
                    <p class="read-more">
                      <a href="<?= Url::to(
                          [
                              'blog/article',
                              'id' => $article->id,
                          ]
                      ) ?>" class="btn btn-template-main"><?php echo \Yii::t('app', 'Continue reading'); ?></a>
                    </p>
                  </div>
                </div>
                <!-- /.box-image-text -->
              </div>
            <?php } ?>
        
        </div>
        <!-- /.row -->
        
        <!-- *** BLOG HOMEPAGE END *** -->
      
      </div>
    
    </div>
    <!-- /.container -->
  </section>
  <!-- /.bar -->
  
  
  <section class="bar background-white no-mb">
    <div class="container">
      <div class="col-md-12">
          <?php echo $seo->text; ?>
      </div>
    </div>
  </section>