metager3.blade.php 1.56 KB
Newer Older
1
2
3
@extends('layouts.resultPage')

@section('results')
4
	{{-- Show all errors --}}
5
	@if(sizeof($errors) > 0)
6
7
8
		<div class="alert alert-danger">
			<ul>
				@foreach($errors as $error)
9
					<li>{!! $error !!}</li>
10
11
12
13
				@endforeach
			</ul>
		</div>
	@endif
14
	{{-- Show all warnings --}}
15
	@if(sizeof($warnings) > 0)
16
17
18
19
20
21
22
23
		<div class="alert alert-warning">
			<ul>
				@foreach($warnings as $warning)
					<li>{!! $warning !!}</li>
				@endforeach
			</ul>
		</div>
	@endif
24
	<main id="results">
25
		{{-- Show initial products or ads --}}
26
		@if($metager->hasProducts())
27
28
29
			@if( $metager->getFokus() !== "produktsuche" && !$apiAuthorized)
				@include('layouts.products', ['products' => $metager->getProducts()])
			@endif
30
		@else
Dominik Hebeler's avatar
Dominik Hebeler committed
31
			@for($i = 0; $i <= 2; $i++)
32
33
34
				@include('layouts.ad', ['ad' => $metager->popAd()])
			@endfor
		@endif
35
36
		{{-- Show map --}}
		{{-- Create results and ongoing ads --}}
37
38
39
40
41
42
		@foreach($metager->getResults() as $result)
			@if($result->number % 7 === 0)
				@include('layouts.ad', ['ad' => $metager->popAd()])
			@endif
			@include('layouts.result', ['result' => $result])
		@endforeach
43
		{{-- Show pagination --}}
44
		<nav class="mg-pager" aria-label="...">
45
46
47
48
49
50
			<div @if($metager->getPage() === 1) class="disabled" @endif>
				<a @if($metager->getPage() !== 1) href="javascript:history.back()" @endif>{{ trans('results.zurueck') }}</a>
			</div>
			<div @if($metager->nextSearchLink() === "#") class="disabled" @endif>
				<a @if($metager->nextSearchLink() !== "#") href="{{ $metager->nextSearchLink() }}" @endif>{{ trans('results.weiter') }}</a>
			</div>
51
		</nav>
52
	</main>
53
@endsection