Commit 499aac37692333dc46830b57d1e55b57290eaffa
1 parent
30ec1408
Filter folding
Showing
1 changed file
with
250 additions
and
39 deletions
Show diff stats
frontend/views/category/view.php
@@ -135,6 +135,20 @@ _________________________________________________________ --> | @@ -135,6 +135,20 @@ _________________________________________________________ --> | ||
135 | <div class="panel-body"> | 135 | <div class="panel-body"> |
136 | <div class="form-group"> | 136 | <div class="form-group"> |
137 | <?php | 137 | <?php |
138 | + $firstsix = 0; | ||
139 | + $buthiddenmore = Html::tag( | ||
140 | + 'div', | ||
141 | + Html::a( | ||
142 | + 'Ещё', | ||
143 | + '#', | ||
144 | + [ | ||
145 | + 'class' => 'btn btn-primary btn-xs', | ||
146 | + ] | ||
147 | + ), | ||
148 | + [ | ||
149 | + 'class' => 'hiddens-button', | ||
150 | + ] | ||
151 | + ); | ||
138 | foreach ($brands as $brand) { | 152 | foreach ($brands as $brand) { |
139 | /** | 153 | /** |
140 | * @var Product $product | 154 | * @var Product $product |
@@ -156,8 +170,44 @@ _________________________________________________________ --> | @@ -156,8 +170,44 @@ _________________________________________________________ --> | ||
156 | ) ? 'radio-but checked' : 'radio-but', | 170 | ) ? 'radio-but checked' : 'radio-but', |
157 | ] | 171 | ] |
158 | ); | 172 | ); |
173 | + $firstsix++; | ||
174 | + if ($firstsix == 6) { | ||
175 | + break; | ||
176 | + } | ||
159 | } | 177 | } |
160 | ?> | 178 | ?> |
179 | + <div class="hiddens"> | ||
180 | + <?php | ||
181 | + $nextsix = 0; | ||
182 | + foreach ($brands as $brand) { | ||
183 | + $nextsix++; | ||
184 | + if ($nextsix > 6) { | ||
185 | + echo Html::tag( | ||
186 | + 'div', | ||
187 | + Html::a( | ||
188 | + $brand->lang->title, | ||
189 | + [ | ||
190 | + '/category/view', | ||
191 | + 'category' => $brand->lang->alias->value, | ||
192 | + 'filter' => $filterHelper->buildLink($brand), | ||
193 | + ] | ||
194 | + ), | ||
195 | + [ | ||
196 | + 'class' => $filterHelper->has( | ||
197 | + $brand->lang->alias->value | ||
198 | + ) ? 'radio-but checked' : 'radio-but', | ||
199 | + ] | ||
200 | + ); | ||
201 | + } | ||
202 | + } | ||
203 | + if ($nextsix > 6) { | ||
204 | + $morebutton = $buthiddenmore; | ||
205 | + } else { | ||
206 | + $morebutton = ''; | ||
207 | + } | ||
208 | + ?> | ||
209 | + </div> | ||
210 | + <?php echo $morebutton; ?> | ||
161 | </div> | 211 | </div> |
162 | </div> | 212 | </div> |
163 | <?php | 213 | <?php |
@@ -175,6 +225,20 @@ _________________________________________________________ --> | @@ -175,6 +225,20 @@ _________________________________________________________ --> | ||
175 | <div class="panel-body"> | 225 | <div class="panel-body"> |
176 | <div class="form-group"> | 226 | <div class="form-group"> |
177 | <?php | 227 | <?php |
228 | + $firstsix = 0; | ||
229 | + $buthiddenmore = Html::tag( | ||
230 | + 'div', | ||
231 | + Html::a( | ||
232 | + 'Ещё', | ||
233 | + '#', | ||
234 | + [ | ||
235 | + 'class' => 'btn btn-primary btn-xs', | ||
236 | + ] | ||
237 | + ), | ||
238 | + [ | ||
239 | + 'class' => 'hiddens-button', | ||
240 | + ] | ||
241 | + ); | ||
178 | foreach ($group->options as $option) { | 242 | foreach ($group->options as $option) { |
179 | /** | 243 | /** |
180 | * @var Product $product | 244 | * @var Product $product |
@@ -195,8 +259,47 @@ _________________________________________________________ --> | @@ -195,8 +259,47 @@ _________________________________________________________ --> | ||
195 | ) ? 'radio-but checked' : 'radio-but', | 259 | ) ? 'radio-but checked' : 'radio-but', |
196 | ] | 260 | ] |
197 | ); | 261 | ); |
262 | + $firstsix++; | ||
263 | + if ($firstsix == 6) { | ||
264 | + break; | ||
265 | + } | ||
198 | } | 266 | } |
199 | ?> | 267 | ?> |
268 | + <div class="hiddens"> | ||
269 | + <?php | ||
270 | + $nextsix = 0; | ||
271 | + foreach ($group->options as $option) { | ||
272 | + /** | ||
273 | + * @var Product $product | ||
274 | + */ | ||
275 | + $nextsix++; | ||
276 | + if ($nextsix > 6) { | ||
277 | + echo Html::tag( | ||
278 | + 'div', | ||
279 | + Html::a( | ||
280 | + $option->lang->value, | ||
281 | + [ | ||
282 | + '/category/view', | ||
283 | + 'category' => $model->lang->alias->value, | ||
284 | + 'filter' => $filterHelper->buildLink($option), | ||
285 | + ] | ||
286 | + ), | ||
287 | + [ | ||
288 | + 'class' => $filterHelper->has( | ||
289 | + $option->lang->alias->value | ||
290 | + ) ? 'radio-but checked' : 'radio-but', | ||
291 | + ] | ||
292 | + ); | ||
293 | + } | ||
294 | + } | ||
295 | + if ($nextsix > 6) { | ||
296 | + $morebutton = $buthiddenmore; | ||
297 | + } else { | ||
298 | + $morebutton = ''; | ||
299 | + } | ||
300 | + ?> | ||
301 | + </div> | ||
302 | + <?php echo $morebutton; ?> | ||
200 | </div> | 303 | </div> |
201 | </div> | 304 | </div> |
202 | </div> | 305 | </div> |
@@ -212,7 +315,8 @@ _________________________________________________________ --> | @@ -212,7 +315,8 @@ _________________________________________________________ --> | ||
212 | <div class="form-group"> | 315 | <div class="form-group"> |
213 | <?php | 316 | <?php |
214 | $firstsix = 0; | 317 | $firstsix = 0; |
215 | - $buthiddenmore = Html::tag('div', | 318 | + $buthiddenmore = Html::tag( |
319 | + 'div', | ||
216 | Html::a( | 320 | Html::a( |
217 | 'Ещё', | 321 | 'Ещё', |
218 | '#', | 322 | '#', |
@@ -245,45 +349,46 @@ _________________________________________________________ --> | @@ -245,45 +349,46 @@ _________________________________________________________ --> | ||
245 | ] | 349 | ] |
246 | ); | 350 | ); |
247 | $firstsix++; | 351 | $firstsix++; |
248 | - if($firstsix == 6) break; | ||
249 | - } | ||
250 | - ?> | ||
251 | - <div class="hiddens"> | ||
252 | - <?php | ||
253 | - $nextsix = 0; | ||
254 | - foreach ($group->options as $option) { | ||
255 | - /** | ||
256 | - * @var Product $product | ||
257 | - */ | ||
258 | - $nextsix++; | ||
259 | - if($nextsix>6){ | ||
260 | - echo Html::tag( | ||
261 | - 'div', | ||
262 | - Html::a( | ||
263 | - $option->lang->value, | ||
264 | - [ | ||
265 | - '/category/view', | ||
266 | - 'category' => $model->lang->alias->value, | ||
267 | - 'filter' => $filterHelper->buildLink($option), | ||
268 | - ] | ||
269 | - ), | ||
270 | - [ | ||
271 | - 'class' => $filterHelper->has( | ||
272 | - $option->lang->alias->value | ||
273 | - ) ? 'radio-but checked' : 'radio-but', | ||
274 | - ] | ||
275 | - ); | 352 | + if ($firstsix == 6) { |
353 | + break; | ||
276 | } | 354 | } |
277 | } | 355 | } |
278 | - if($nextsix>6){ | ||
279 | - $morebutton = $buthiddenmore; | ||
280 | - } | ||
281 | - else{ | ||
282 | - $morebutton = ''; | ||
283 | - } | ||
284 | - ?> | ||
285 | - </div> | ||
286 | - <?php echo $morebutton;?> | 356 | + ?> |
357 | + <div class="hiddens"> | ||
358 | + <?php | ||
359 | + $nextsix = 0; | ||
360 | + foreach ($group->options as $option) { | ||
361 | + /** | ||
362 | + * @var Product $product | ||
363 | + */ | ||
364 | + $nextsix++; | ||
365 | + if ($nextsix > 6) { | ||
366 | + echo Html::tag( | ||
367 | + 'div', | ||
368 | + Html::a( | ||
369 | + $option->lang->value, | ||
370 | + [ | ||
371 | + '/category/view', | ||
372 | + 'category' => $model->lang->alias->value, | ||
373 | + 'filter' => $filterHelper->buildLink($option), | ||
374 | + ] | ||
375 | + ), | ||
376 | + [ | ||
377 | + 'class' => $filterHelper->has( | ||
378 | + $option->lang->alias->value | ||
379 | + ) ? 'radio-but checked' : 'radio-but', | ||
380 | + ] | ||
381 | + ); | ||
382 | + } | ||
383 | + } | ||
384 | + if ($nextsix > 6) { | ||
385 | + $morebutton = $buthiddenmore; | ||
386 | + } else { | ||
387 | + $morebutton = ''; | ||
388 | + } | ||
389 | + ?> | ||
390 | + </div> | ||
391 | + <?php echo $morebutton; ?> | ||
287 | </div> | 392 | </div> |
288 | </div> | 393 | </div> |
289 | </div> | 394 | </div> |
@@ -298,6 +403,20 @@ _________________________________________________________ --> | @@ -298,6 +403,20 @@ _________________________________________________________ --> | ||
298 | <div class="panel-body"> | 403 | <div class="panel-body"> |
299 | <div class="form-group"> | 404 | <div class="form-group"> |
300 | <?php | 405 | <?php |
406 | + $firstsix = 0; | ||
407 | + $buthiddenmore = Html::tag( | ||
408 | + 'div', | ||
409 | + Html::a( | ||
410 | + 'Ещё', | ||
411 | + '#', | ||
412 | + [ | ||
413 | + 'class' => 'btn btn-primary btn-xs', | ||
414 | + ] | ||
415 | + ), | ||
416 | + [ | ||
417 | + 'class' => 'hiddens-button', | ||
418 | + ] | ||
419 | + ); | ||
301 | foreach ($group->options as $option) { | 420 | foreach ($group->options as $option) { |
302 | /** | 421 | /** |
303 | * @var Product $product | 422 | * @var Product $product |
@@ -318,8 +437,47 @@ _________________________________________________________ --> | @@ -318,8 +437,47 @@ _________________________________________________________ --> | ||
318 | ) ? 'radio-but checked' : 'radio-but', | 437 | ) ? 'radio-but checked' : 'radio-but', |
319 | ] | 438 | ] |
320 | ); | 439 | ); |
440 | + $firstsix++; | ||
441 | + if ($firstsix == 6) { | ||
442 | + break; | ||
443 | + } | ||
321 | } | 444 | } |
322 | ?> | 445 | ?> |
446 | + <div class="hiddens"> | ||
447 | + <?php | ||
448 | + $nextsix = 0; | ||
449 | + foreach ($group->options as $option) { | ||
450 | + /** | ||
451 | + * @var Product $product | ||
452 | + */ | ||
453 | + $nextsix++; | ||
454 | + if ($nextsix > 6) { | ||
455 | + echo Html::tag( | ||
456 | + 'div', | ||
457 | + Html::a( | ||
458 | + $option->lang->value, | ||
459 | + [ | ||
460 | + '/category/view', | ||
461 | + 'category' => $model->lang->alias->value, | ||
462 | + 'filter' => $filterHelper->buildLink($option), | ||
463 | + ] | ||
464 | + ), | ||
465 | + [ | ||
466 | + 'class' => $filterHelper->has( | ||
467 | + $option->lang->alias->value | ||
468 | + ) ? 'radio-but checked' : 'radio-but', | ||
469 | + ] | ||
470 | + ); | ||
471 | + } | ||
472 | + } | ||
473 | + if ($nextsix > 6) { | ||
474 | + $morebutton = $buthiddenmore; | ||
475 | + } else { | ||
476 | + $morebutton = ''; | ||
477 | + } | ||
478 | + ?> | ||
479 | + </div> | ||
480 | + <?php echo $morebutton; ?> | ||
323 | </div> | 481 | </div> |
324 | </div> | 482 | </div> |
325 | </div> | 483 | </div> |
@@ -334,6 +492,20 @@ _________________________________________________________ --> | @@ -334,6 +492,20 @@ _________________________________________________________ --> | ||
334 | <div class="panel-body"> | 492 | <div class="panel-body"> |
335 | <div class="form-group"> | 493 | <div class="form-group"> |
336 | <?php | 494 | <?php |
495 | + $firstsix = 0; | ||
496 | + $buthiddenmore = Html::tag( | ||
497 | + 'div', | ||
498 | + Html::a( | ||
499 | + 'Ещё', | ||
500 | + '#', | ||
501 | + [ | ||
502 | + 'class' => 'btn btn-primary btn-xs', | ||
503 | + ] | ||
504 | + ), | ||
505 | + [ | ||
506 | + 'class' => 'hiddens-button', | ||
507 | + ] | ||
508 | + ); | ||
337 | foreach ($group->options as $option) { | 509 | foreach ($group->options as $option) { |
338 | /** | 510 | /** |
339 | * @var Product $product | 511 | * @var Product $product |
@@ -354,8 +526,47 @@ _________________________________________________________ --> | @@ -354,8 +526,47 @@ _________________________________________________________ --> | ||
354 | ) ? 'radio-but checked' : 'radio-but', | 526 | ) ? 'radio-but checked' : 'radio-but', |
355 | ] | 527 | ] |
356 | ); | 528 | ); |
529 | + $firstsix++; | ||
530 | + if ($firstsix == 6) { | ||
531 | + break; | ||
532 | + } | ||
357 | } | 533 | } |
358 | ?> | 534 | ?> |
535 | + <div class="hiddens"> | ||
536 | + <?php | ||
537 | + $nextsix = 0; | ||
538 | + foreach ($group->options as $option) { | ||
539 | + /** | ||
540 | + * @var Product $product | ||
541 | + */ | ||
542 | + $nextsix++; | ||
543 | + if ($nextsix > 6) { | ||
544 | + echo Html::tag( | ||
545 | + 'div', | ||
546 | + Html::a( | ||
547 | + $option->lang->value, | ||
548 | + [ | ||
549 | + '/category/view', | ||
550 | + 'category' => $model->lang->alias->value, | ||
551 | + 'filter' => $filterHelper->buildLink($option), | ||
552 | + ] | ||
553 | + ), | ||
554 | + [ | ||
555 | + 'class' => $filterHelper->has( | ||
556 | + $option->lang->alias->value | ||
557 | + ) ? 'radio-but checked' : 'radio-but', | ||
558 | + ] | ||
559 | + ); | ||
560 | + } | ||
561 | + } | ||
562 | + if ($nextsix > 6) { | ||
563 | + $morebutton = $buthiddenmore; | ||
564 | + } else { | ||
565 | + $morebutton = ''; | ||
566 | + } | ||
567 | + ?> | ||
568 | + </div> | ||
569 | + <?php echo $morebutton; ?> | ||
359 | </div> | 570 | </div> |
360 | </div> | 571 | </div> |
361 | </div> | 572 | </div> |
@@ -411,7 +622,7 @@ _________________________________________________________ --> | @@ -411,7 +622,7 @@ _________________________________________________________ --> | ||
411 | <div class="col-md-12 row"> | 622 | <div class="col-md-12 row"> |
412 | <button class="price-apply btn btn-primary">применить</button> | 623 | <button class="price-apply btn btn-primary">применить</button> |
413 | </div> | 624 | </div> |
414 | - | 625 | + |
415 | </div> | 626 | </div> |
416 | </div> | 627 | </div> |
417 | </div> | 628 | </div> |