summaryrefslogtreecommitdiff
path: root/resources/views/search.blade.php
blob: 2f381d7552c0147a8984564da88cfbcf01f207d1 (plain)
1
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
34
35
36
37
38
39
40
41
42
43
44
45
46
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
@extends('layouts.base')

@section('header')
Finde den besten Deal
@endsection

@section('feed')
	{!! Feed::link(secure_url($rss_feed), 'atom', 'Feed von ' . $search_phrase , 'de') !!}
@endsection

@section('content')
<div class="container">
		<nav class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/" aria-label="breadcrumb">
		    <ol class="breadcrumb">
			<!-- Breadcrumb NavXT 6.2.1 -->
<li class="home breadcrumb-item"><span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Gehe zur Startseite: Fuselkönig.de" href="https://www.fuselkoenig.de" class="home"><span property="name">Startseite</span></a><meta property="position" content="1"></span></li>
<li class="post post-angebote-archive breadcrumb-item"><span property="itemListElement" typeof="ListItem"><a property="item" typeof="WebPage" title="Schau dir Angebote an." href="/angebote/" class="post post-angebote-archive"><span property="name">Angebote</span></a><meta property="position" content="2"></span></li>
<li class="archive taxonomy type current-item breadcrumb-item active" aria-current="page"><span property="itemListElement" typeof="ListItem"><span property="name">Suche nach <strong>"{{ ucwords($search_phrase) }}"</strong></span><meta property="position" content="3"></span></li>
		    </ol>
		</nav>
	</div>

    <div class="container">

<header class="page-header">
<?php
if ( $data->count() ) {
?>
	<div class="card taxonomy-card">
		<div class="card-body">
			<h1 class="card-title page-title">Suche</h1>
			<p>
			Sie haben nach <strong>{{ ucwords($search_phrase) }}</strong> gesucht ({{$count->count()}} Treffer)
			</p>
			@include('snippets.sortbuttons')
<?php
} else {
?>
<div class="alert alert-error" data-track-content data-content-name="Suche" data-content-piece="Keine Angebote" data-content-target="">
	<h1 class="alert-heading">Keinen Treffer</h1>
	<p style="font-size: 17px;">
	Leider hat Ihre Suche nach <strong>{{ ucwords($search_phrase) }}</strong> keine Ergebnisse ergeben. Bitte versuchen sie es erneut mit einem anderen Begriff.
	</p>

	<form action="/angebote/search">
	  <div class="form-group">
	    <label for=""></label>
	    <input type="text" class="form-control" name="q" id="front_search_form" aria-describedby="suchform-help" placeholder="Hier nach der gewünschten Spirituose suchen...">
	    <p id="front_search_help" class="form-text">Suche zum Beispiel nach Glenfiddich oder Champagner.</p>
	  </div>
	  <button type="submit" class="btn btn-secondary">Suchen</button>
	</form>
</div>
<?php
}
?>

	</div>
</header><!-- .page-header -->

	{{ $data->appends(Input::except('page'))->links('paginate') }}

<?php

<?php 
if ( !$data->count() ) {
	/* Keine Angebote */
?>
<?php 
	/* Ende Keine Angebote */
} else {
	/* Liste Angebote */

//@include('snippets.sortbuttons')
$css_border_left = "";

foreach( $data as $offer) {
?>





	<div class="card <?php echo $css_border_left; ?>">
      <div class="row ">
        <div class="col-md-4">
	    <div class="card-header-dp-none">
		<p><strong>
		<span style="visibility: hidden;">
		{{ ucwords($offer->spirit_type) }} <span class="float-right">{{ $offer->shop }}</span>
		</span>
		</strong></p>
	    </div>
	    <div class="card-img-overlay card-img-overlay-badge" >
	    <p class="card-text float-right rounded off-badge"  >{{ $offer->procent}} %</p>
            </div>
	    <img src="{{ $offer->image_url }}" class="card-img img-fluid mx-auto d-block" >
          </div>
          <div class="col-md-8 px-10">
	    <div class="card-header">
		<p><strong>
		{{ ucwords($offer->spirit_type) }} <span class="float-right">{{ $offer->shop }}</span>
		</strong></p>
	    </div>
            <div class="card-block card-body px-3">

	    <h3 class="card-title">{{ $offer->name }}</h3>

		<div class="row">
		      <p class="card-text col-md-6">
		              <strong class="new-price">Neuer Preis: {{ TF::fF($offer->discounted_price) }} €</strong>
			      <br>
			      statt <strong><del>{{ TF::fF($offer->original_price) }} €</del></strong>
			      <br>
			      {{ TF::fF($offer->base_price ) }} € / Liter
		      </p>
		      <p class="card-text col-md-6">
		      	      Alkohol: {{ TF::fF($offer->abv) }} %
			      <br>
			      Volumen: {{ TF::fF($offer->volume) }} Liter
			      <br>
			      Versand: {{ TF::fF($offer->shipping_costs) }} €
			      <br>
			      <br>
		      </p>
                </div>
            </div>
            <div class="card-footer row">
		<div class="col-md-6 col-sm-6">
		    <a href="{{ $offer->url }}" class="btn btn-primary">Zum Shop</a>
		</div>
		<div class="col-md-6 col-sm-6">
		<p>
				Preis vom {{ strftime("%d. %B", $offer->created_at) }}
		</p>
		</div>
            </div>
          </div>

        </div>
      </div>

<?php
	}
?>

	{{ $data->appends(Input::except('page'))->links('paginate') }}

<?php
	/* Ende Liste Angebote */
}
?>

<!-- ./container -->
    </div>

@endsection

@section('scripts')
<script>
$(window).on("load", function(){
	$("img.card-img-top").each( function(k, v){
		
		// sets style like with Drankdozijn
		if ( (this.naturalWidth / this.naturalHeight) < 0.3 ) {
			console.log("debug: changing css for " + this.title);
			$(this).css("width", this.naturalWidth);
			$(this).css("onject-fit", "cover");
			$(this).css("margin-left", "auto");
			$(this).css("margin-right", "25px");
		}
	});
});
</script>
@endsection