metager3.blade.php 1.57 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">
Karl Hasselbring's avatar
Karl Hasselbring committed
25
26
27
		{{-- Show initial ads --}}
		@if($mobile)
			@include('layouts.ad', ['ad' => $metager->popAd()])
28
		@else
Karl Hasselbring's avatar
Karl Hasselbring committed
29
			@for($i = 0; $i <= 2; $i++)
30
				@include('layouts.ad', ['ad' => $metager->popAd()])
Karl Hasselbring's avatar
Karl Hasselbring committed
31
			@endfor
32
		@endif
33
34
		{{-- Show map --}}
		{{-- Create results and ongoing ads --}}
35
		@foreach($metager->getResults() as $result)
36
37
38
39
40
41
42
43
			@if($mobile)
				@if($result->number % 4 === 0)
					@include('layouts.ad', ['ad' => $metager->popAd()])
				@endif
			@else
				@if($result->number % 7 === 0)
					@include('layouts.ad', ['ad' => $metager->popAd()])
				@endif
44
45
46
			@endif
			@include('layouts.result', ['result' => $result])
		@endforeach
47
		{{-- Show pagination --}}
48
		<nav class="mg-pager" aria-label="...">
49
50
51
52
53
54
			<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>
55
		</nav>
56
	</main>
57
@endsection