summaryrefslogtreecommitdiff
path: root/site
diff options
context:
space:
mode:
authorMax2018-02-10 01:59:26 +0100
committerMax2018-02-10 01:59:26 +0100
commit09ab27a6d19883317f2fc185b57b971b8c780069 (patch)
tree86ae7b2e8da2bc53c3e86574ea28e869d0efb4dc /site
parent374defdff5502123d84e2e48fdd4faa4636447da (diff)
downloadalkobote-09ab27a6d19883317f2fc185b57b971b8c780069.tar.gz
Major improvements. (website)
Diffstat (limited to 'site')
-rw-r--r--site/app/Http/Controllers/IndexController.php30
-rw-r--r--site/app/Http/Controllers/OfferController.php (renamed from site/app/Http/Controllers/WhiskyController.php)14
-rw-r--r--site/app/Libraries/TemplateFunction.php26
-rw-r--r--site/config/app.php2
-rw-r--r--site/public/css/blog.css2
-rw-r--r--site/public/css/custom.css38
-rw-r--r--site/public/css/sticky-footer-navbar.css13
-rw-r--r--site/resources/views/index.blade.php422
-rw-r--r--site/resources/views/layouts/base.blade.php9
-rw-r--r--site/resources/views/offer.blade.php117
-rw-r--r--site/resources/views/snippets/footer.blade.php24
-rw-r--r--site/resources/views/snippets/navbar.blade.php29
-rw-r--r--site/routes/web.php6
13 files changed, 344 insertions, 388 deletions
diff --git a/site/app/Http/Controllers/IndexController.php b/site/app/Http/Controllers/IndexController.php
index 745a023..c0056d9 100644
--- a/site/app/Http/Controllers/IndexController.php
+++ b/site/app/Http/Controllers/IndexController.php
@@ -14,8 +14,34 @@ class IndexController extends Controller {
*/
public function showPage(Request $request) {
- //$data = DB::table('angebote')->orderBy('quotient', 'DESC')->limit(100)->get();
- $data = DB::table('angebote')->orderBy('quotient', 'DESC')->limit(100)->simplePaginate(20);
+
+ $views = array("whisky", "wodka", "gin", "rum", "misc");
+ $query = "";
+
+ foreach($views as $view) {
+ if ($query != "") {
+ $query .= " UNION ";
+ }
+ $query .= "(SELECT name, image_url, spirit_type, spirit_type AS url, spirit_type AS angebotsname, original_price, discounted_price, procent, '' AS linktext FROM ". $view ."_view WHERE original_price > 19.98 ORDER BY procent DESC LIMIT 1)";
+ }
+
+ // removes the last union
+ #$query .= substr($query, -1, strlen(" UNION "));
+ #echo "<pre>";
+ #var_dump($query); exit;
+
+ /*
+ $dbh = DB::connection('mysql')->getPdo();
+ $stmt = $dbh->prepare($query);
+ $stmt->execute();
+
+ $data = $stmt->fetchAll(\PDO::FETCH_ASSOC);
+ */
+
+
+ #var_dump($query); exit;
+ $data = DB::select($query);
+ #$data = DB::table('whisky_view')->orderBy('procent', 'DESC')->limit(100)->simplePaginate(20);
return view('index', ['data' => $data]);
}
diff --git a/site/app/Http/Controllers/WhiskyController.php b/site/app/Http/Controllers/OfferController.php
index 620bfc7..99108cd 100644
--- a/site/app/Http/Controllers/WhiskyController.php
+++ b/site/app/Http/Controllers/OfferController.php
@@ -3,7 +3,10 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Helpers\CryptoHelper;
-class WhiskyController extends Controller {
+use Illuminate\Support\Facades\DB;
+use App\Http\Controllers\Controller;
+
+class OfferController extends Controller {
/**
* Shows the index page.
*
@@ -11,8 +14,13 @@ class WhiskyController extends Controller {
*/
public function showPage(Request $request) {
- $shops = DB:select('SELECT * FROM shop');
+ $view_name = \Request::route()->getName();
+ $data = DB::table($view_name . '_view')->orderBy('procent', 'DESC')->limit(100)->simplePaginate(20);
+
+ if ( "misc" == $view_name ) {
+ $view_name = "Andere Angebote";
+ }
- return view('whisky', $shops);
+ return view('offer', ['data' => $data, 'spirit_type' => $view_name]);
}
}
diff --git a/site/app/Libraries/TemplateFunction.php b/site/app/Libraries/TemplateFunction.php
new file mode 100644
index 0000000..582995f
--- /dev/null
+++ b/site/app/Libraries/TemplateFunction.php
@@ -0,0 +1,26 @@
+<?php
+namespace App\Libraries;
+use App\Libraries\TemplateFunction;
+
+class TemplateFunction {
+ private static function formatFloat($float, $size = 2) {
+ return number_format($float, $size);
+ }
+
+ private static function stripDot($float) {
+ return str_replace(".", ",", $float);
+ }
+
+ public static function fF($float, $format = "") {
+ $f = TemplateFunction::formatFloat($float);
+ if ($f == intval($f)) {
+ $f = intval($f);
+ }
+
+ return TemplateFunction::stripDot($f);
+ }
+
+ public static function T($timestamp) {
+ return gmdate("d.m.Y.", $timestamp);
+ }
+}
diff --git a/site/config/app.php b/site/config/app.php
index 71d1455..138a41a 100644
--- a/site/config/app.php
+++ b/site/config/app.php
@@ -209,6 +209,8 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
+ 'TF' => App\Libraries\TemplateFunction::class,
+
],
];
diff --git a/site/public/css/blog.css b/site/public/css/blog.css
index 8f6d6a2..9d105dc 100644
--- a/site/public/css/blog.css
+++ b/site/public/css/blog.css
@@ -120,6 +120,7 @@ h1, h2, h3, h4, h5, h6 {
/*
* Footer
*/
+/*
.blog-footer {
padding: 2.5rem 0;
color: #999;
@@ -130,3 +131,4 @@ h1, h2, h3, h4, h5, h6 {
.blog-footer p:last-child {
margin-bottom: 0;
}
+*/
diff --git a/site/public/css/custom.css b/site/public/css/custom.css
index f3c99e1..417d4dd 100644
--- a/site/public/css/custom.css
+++ b/site/public/css/custom.css
@@ -1,4 +1,42 @@
+.custom-flex-child {
+ min-width: 0;
+}
+.h3-truncate {
+ min-width: 0;
+}
+.custom-flex-child > .h3-truncate > .hide-overflow{
+ overflow: hidden;
+ text-overflow: ellipsis !important;
+}
+.custom-flex-child > .hide-overflow{
+ overflow: hidden;
+ text-overflow: ellipsis !important;
+}
.hide-overflow{
overflow: hidden;
text-overflow: ellipsis !important;
}
+.footer-col {
+ padding-right: 20px;
+ padding-left: 20px;
+}
+.bg-dark-opacity {
+}
+.w-55 {
+ width: 55% !important;
+}
+.h-40 {
+ height: 40% !important;
+}
+.h-45 {
+ height: 45% !important;
+}
+.text-small {
+ font-size: 80%;
+}
+.mt-10 {
+ margin-top: 10px;
+}
+.mt-20 {
+ margin-top: 20px;
+}
diff --git a/site/public/css/sticky-footer-navbar.css b/site/public/css/sticky-footer-navbar.css
index 07fd56a..bca2eae 100644
--- a/site/public/css/sticky-footer-navbar.css
+++ b/site/public/css/sticky-footer-navbar.css
@@ -6,14 +6,14 @@ html {
}
body {
/* Margin bottom by footer height */
- margin-bottom: 60px;
+ margin-bottom: 200px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
- height: 60px;
+ height: 200px;
line-height: 60px; /* Vertically center the text there */
background-color: #f5f5f5;
}
@@ -23,15 +23,14 @@ body {
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
+/*
+*/
body > .container {
- padding: 60px 15px 0;
+ padding: 30px 15px 0;
}
.footer > .container {
+ margin-top: 10px;
padding-right: 15px;
padding-left: 15px;
}
-
-code {
- font-size: 80%;
-}
diff --git a/site/resources/views/index.blade.php b/site/resources/views/index.blade.php
index 57c2c42..448c069 100644
--- a/site/resources/views/index.blade.php
+++ b/site/resources/views/index.blade.php
@@ -10,10 +10,23 @@
</div>
</div>
+
<?php
$count = 0;
-foreach( $data as $whisky) {
+
+foreach( $data as $offer) {
+
+
+ if ( "Anderes" == $offer->spirit_type ) {
+ $offer->url = "misc";
+ $offer->angebotsname = "anderen Angeboten";
+ $offer->linktext = "Weitere günstige Angebote entdecken.";
+ } else {
+ $offer->url = lcfirst($offer->url) ;
+ $offer->angebotsname = $offer->angebotsname . "angeboten";
+ $offer->linktext = "Den günstigsten ". $offer->spirit_type ." finden.";
+ }
if ( $count % 2 == 0) {
?>
@@ -21,26 +34,39 @@ foreach( $data as $whisky) {
<?php
}
- if (strlen($whisky->name) > 60 ) {
- # $whisky->name = substr($whisky->name, 0, 60) . "...";
- }
-
?>
- <div class="col-md-6 col-sm-12" id="<?php echo htmlentities($whisky->name); ?>">
+
+
+ <!--div class="col-md-6">
<div class="card flex-md-row mb-4 box-shadow h-md-250">
- <img class="card-img-top flex-auto d-sm-block img-thumbnail d-md-none" src="<?php echo htmlentities($whisky->image_url);?>" alt="<?php echo htmlentities($whisky->name); ?>">
<div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0 hide-overflow">
- <a class="text-dark" href="#<?php echo htmlentities($whisky->name); ?>"><?php echo htmlentities($whisky->name); ?></a>
+ <strong class="d-inline-block mb-2 text-primary">{{ ucfirst($offer->spirit_type) }}</strong>
+ <h3 class="mb-0">
</h3>
- <a class="mb-1 text-muted" href="<?php echo htmlentities($whisky->shop_url); ?>"><?php echo htmlentities($whisky->shop); ?></a>
- <p class="card-text mb-auto text-success"><del class="text-danger"><?php echo htmlentities($whisky->original_price/100) . "€"; ?></del> <?php echo htmlentities($whisky->discounted_price/100). "€"; ?></p>
- <a href="<?php echo htmlentities($whisky->url); ?>">Jetzt bestellen</a>
+ <a href="/{{ $offer->spirit_type }}">Alle {{ ucfirst($offer->spirit_type) }}</a>
</div>
- <img class="card-img-right flex-auto d-none d-md-block" src="<?php echo htmlentities($whisky->image_url);?>" alt="<?php echo htmlentities($whisky->name); ?>">
+ <img class="card-img-right flex-auto d-none d-md-block" src="{{ $offer->image_url }}" alt="Card image cap">
</div>
- </div>
+ </div-->
+
+<div class="col-md-6 col-sm-12" id="{{ $offer->name }}">
+ <div class="card flex-md-row mb-4 box-shadow h-md-250 h-sm-500">
+ <img class="card-img-top flex-auto d-xs-block d-sm-block img-thumbnail d-md-none" src="{{ $offer->image_url }}" alt="{{ $offer->name }}" title="{{ $offer->name }}">
+ <div class="card-body d-flex flex-column align-items-start">
+ <div class="d-inline align-items-start text-left w-100 mb-2">
+ <strong class="text-dark">{{ $offer->spirit_type }}</strong>
+ </div>
+ <h3 class="mb-0 d-inline-block hide-overflow">
+ <a class="text-dark" href="/{{ $offer->url }}">
+ Hier geht es zu den {{ $offer->angebotsname }}
+ </a>
+ </h3>
+ <a class="w-100" href="/{{ $offer->url }}" style="word-wrap: none;">{{ $offer->linktext }}</a>
+ <!--p class="card-text mb-auto text-success w-100"><del class="text-danger">{{ TF::fF($offer->original_price) . "€" }}</del> <strong class="float-right">{{ TF::fF($offer->discounted_price) . "€" }}</strong></p-->
+ </div>
+ <img data-href="/{{ $offer->url }}" class="card-img-right img-thumbnail d-none d-xs-none d-md-block float-right js-link-replacement" src="{{ $offer->image_url }}" alt="{{ $offer->name }}" title="{{ $offer->name }}">
+ </div>
+</div>
<?php
@@ -54,355 +80,31 @@ foreach( $data as $whisky) {
$count++;
}
-?>
-
-{{ $data->links() }}
-
-
-<!--
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">1776 Bourbon Whiskey 7 Jahre 46% 0,7l 2 x 1776 Ale Bier 10,4% 0,65l</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.rumundco.de">Rum &amp; Co</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">64.7€</del> 42.9€</p>
- <a href="https://www.rumundco.de/1776-Bourbon-Whiskey-7-Jahre-07l">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.rumundco.de/media/image/product/6259/md/x1776-bourbon-whiskey-7-jahre-07l.jpg.pagespeed.ic.a9w8ynkDTv.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Chivas Regal Whisky 18 Jahre 0,7l</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.bottleword.de">Bottleworld</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">68.99€</del> 45.89€</p>
- <a href="https://www.bottleworld.de/whiskey/chivas-regal-18-yrs-07-liter.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.bottleworld.de/media/catalog/product/cache/1/small_image/295x295/9df78eab33525d08d6e5fb8d27136e95/8/5/853_chivas_regal_scotch_whisky_18_jahre_0_7_l_1_.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Longrow 18 Years Old 2017 Release</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">159.99€</del> 109.99€</p>
- <a href="https://www.whiskysite.nl/en/longrow-18-years-old-2017-release.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/121919561/260x300x2/longrow-18-years-old-2017-release.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Johnnie Walker XR 21 Jahre Whisky 40% 0,7l</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.rumundco.de">Rum &amp; Co</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">178.9€</del> 124.9€</p>
- <a href="https://www.rumundco.de/Johnnie-Walker-XR-21-Jahre-Whisky-40-07l">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.rumundco.de/bilder/produkte/normal/xJohnnie-Walker-XR-21-Jahre-Whisky-40-07l.jpg.pagespeed.ic.Ns1GEQFDgH.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Tomatin Cask Strength</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">49.99€</del> 34.99€</p>
- <a href="https://www.whiskysite.nl/en/tomatin-cask-strength.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/136889495/260x300x2/tomatin-cask-strength.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Crown Royal XO Whisky 40% 0,7l</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.rumundco.de">Rum &amp; Co</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">69.9€</del> 49.9€</p>
- <a href="https://www.rumundco.de/Crown-Royal-XO-Whisky-07l">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.rumundco.de/media/image/product/7771/md/xcrown-royal-xo-whisky-07l.jpg.pagespeed.ic.sFT4IX9542.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Glendronach Cask Strength Batch 6</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">69.99€</del> 49.99€</p>
- <a href="https://www.whiskysite.nl/en/glendronach-cask-strength-batch-6.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/094251068/260x300x2/glendronach-cask-strength-batch-6.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Glenmorangie Astar 2017 Release</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">89.99€</del> 64.99€</p>
- <a href="https://www.whiskysite.nl/en/glenmorangie-astar-2017-release.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/164120240/260x300x2/glenmorangie-astar-2017-release.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Glenrothes Vintage 2004</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">54.99€</del> 39.99€</p>
- <a href="https://www.whiskysite.nl/en/glenrothes-vintage-2004.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/174025859/260x300x2/glenrothes-vintage-2004.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Tomatin Cu Bocan</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">40.99€</del> 29.99€</p>
- <a href="https://www.whiskysite.nl/en/tomatin-cu-bocan.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/012700298/260x300x2/tomatin-cu-bocan.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Kilkerran 12 Years Old</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">49.99€</del> 36.99€</p>
- <a href="https://www.whiskysite.nl/en/kilkerran-12-years-old.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/081989315/260x300x2/kilkerran-12-years-old.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Cocktailkunst - Die Zukunft der Bar</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.rumundco.de">Rum &amp; Co</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">39.99€</del> 29.9€</p>
- <a href="https://www.rumundco.de/Cocktailkunst-Die-Zukunft-der-Bar">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.rumundco.de/bilder/produkte/normal/xCocktailkunst-Die-Zukunft-der-Bar.jpg.pagespeed.ic.a8_fAVT-Vc.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Arran 18 Years Old</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">79.99€</del> 59.99€</p>
- <a href="https://www.whiskysite.nl/en/arran-18-years-old-25710478.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/058623392/260x300x2/arran-18-years-old.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Chivas Regal Whisky 25 Jahre 0,7l</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.bottleword.de">Bottleworld</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">253.99€</del> 193.99€</p>
- <a href="https://www.bottleworld.de/whiskey/chivas/chivas-regal-25-yrs-07-l.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.bottleworld.de/media/catalog/product/cache/1/small_image/295x295/9df78eab33525d08d6e5fb8d27136e95/2/2/2236_chivas_regal_scotch_whisky_25_jahre__2_1_.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Bunnahabhain Eirigh Na Greine Liter</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">64.99€</del> 49.99€</p>
- <a href="https://www.whiskysite.nl/en/bunnahabhain-eirigh-na-greine-liter.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/035770278/260x300x2/bunnahabhain-eirigh-na-greine-liter.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Bowmore 10 Jahre Dark &amp; Intense 40% 1,0l</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.rumundco.de">Rum &amp; Co</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">44.9€</del> 34.9€</p>
- <a href="https://www.rumundco.de/Bowmore-10-Jahre-Dark-Intense-10l">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.rumundco.de/media/image/product/7976/md/xbowmore-10-jahre-dark-intense-10l.jpg.pagespeed.ic.lFDE1iwXoQ.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Wolfburn Morven</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">44.99€</del> 34.99€</p>
- <a href="https://www.whiskysite.nl/en/wolfburn-morven.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/152872949/260x300x2/wolfburn-morven.jpg" alt="Card image cap">
- </div>
- </div>
-
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">The Glenlivet Founder's Reserve Liter</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskysite.nl">Whiskysite.nl</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">44.99€</del> 34.99€</p>
- <a href="https://www.whiskysite.nl/en/the-glenlivet-founders-reserve-liter.html">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://static.webshopapp.com/shops/039103/files/080198288/260x300x2/the-glenlivet-founders-reserve-liter.jpg" alt="Card image cap">
- </div>
- </div>
-
- </div>
- <div class="row mb-2">
-
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Auchentoshan American Oak</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.whiskyworld.de">Whisky World</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">27.99€</del> 21.99€</p>
- <a href="https://www.whiskyworld.de/p/auchentoshan-american-oak-a105_0057">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://cdn.whiskyworld.de/img/230/A105-0057.JPG" alt="Card image cap">
- </div>
- </div>
+// schließt den row div wieder bei ungerade anzahl
+if ( $count % 2 == 1) {
+?>
+ </div>
+<?php
+}
+?>
- <div class="col-md-6">
- <div class="card flex-md-row mb-4 box-shadow h-md-250">
- <div class="card-body d-flex flex-column align-items-start">
- <strong class="d-inline-block mb-2 text-primary">Whisky</strong>
- <h3 class="mb-0">
- <a class="text-dark" href="#">Highland Park ICE Edition 17 Jahre Whisky 53,9% 0,7l</a>
- </h3>
- <a class="mb-1 text-muted" href="https://www.rumundco.de">Rum &amp; Co</a>
- <p class="card-text mb-auto text-success"><del class="text-danger">399.9€</del> 319.9€</p>
- <a href="https://www.rumundco.de/Highland-Park-ICE-Edition-17-Jahre-Whisky-07l">Jetzt bestellen</a>
- </div>
- <img class="card-img-right flex-auto d-none d-md-block" src="https://www.rumundco.de/bilder/produkte/normal/xHighland-Park-ICE-Edition-17-Jahre-Whisky-07l.jpg.pagespeed.ic.fkk20XywSw.jpg" alt="Card image cap">
- </div>
- </div>
+ </div>
- </div>
--->
+@endsection
-
- </div>
+@section('scripts')
+<script>
+$(".js-link-replacement").hover(function(){
+ $(this).css( 'cursor', 'pointer' );
+},
+function(){
+ $(this).css( 'cursor', 'inherit');
+});
+$(".js-link-replacement").click(function(){
+ window.location.href = $(this).data("href");
+});
+</script>
@endsection
-
diff --git a/site/resources/views/layouts/base.blade.php b/site/resources/views/layouts/base.blade.php
index 81f11f2..c487461 100644
--- a/site/resources/views/layouts/base.blade.php
+++ b/site/resources/views/layouts/base.blade.php
@@ -22,13 +22,12 @@
@yield('content')
<div class="container"><div class="row"></div></div>
- <footer class="footer">
- <div class="container">
- <span class="text-muted">Place sticky footer content here.</span>
- </div>
- </footer>
+
+ @include('snippets.footer')
+
<script src="/js/jquery-3.2.1.slim.min.js"></script>
<script src="/js/popper.1.12.9.min.js"></script>
<script src="/js/bootstrap.bundle.min.js"></script>
+ @yield('scripts')
</body>
</html>
diff --git a/site/resources/views/offer.blade.php b/site/resources/views/offer.blade.php
new file mode 100644
index 0000000..f17c39e
--- /dev/null
+++ b/site/resources/views/offer.blade.php
@@ -0,0 +1,117 @@
+@extends('layouts.base')
+
+@section('content')
+ <div class="container">
+ <div class="jumbotron p-3 p-md-5 text-white rounded bg-dark">
+ <div class="col-md-6 px-0">
+ <h1 class="display-4 font-italic">{{ ucfirst($spirit_type) }}</h1>
+ <!--p class="lead my-3">Finde immer die günstigsten Angebote im Bereich Spirituosen. Täglich neue Schnäppchen.</p-->
+ <p class="lead mb-0"><a href="/" class="text-white font-weight-bold">Zurück zur Übersicht...</a></p>
+ </div>
+ </div>
+
+<?php
+
+$count = 0;
+foreach( $data as $offer) {
+
+ if ( $count % 2 == 0) {
+?>
+<!-- .row -->
+ <div class="row mb-2">
+<?php
+ }
+
+?>
+ <div class="col-md-6 col-sm-12" id="{{ $offer->name }}">
+ <div class="card flex-md-row mb-4 box-shadow h-md-250 h-sm-500">
+
+ <!-- >= md -->
+ <div class="card-body d-none d-md-flex flex-row align-items-start">
+ <div class="card-img-overlay">
+ <p class="card-text bg-danger float-right rounded" style="color: white; font-size: 150%; padding-right: 10px; padding-left:10px; opacity: 0.9;">{{ $offer->procent}}%</p>
+ </div>
+ <div class="card-img-overlay w-55">
+ <div class="d-inline align-items-start text-left w-100 mb-2">
+ <strong class="text-primary">{{ $offer->spirit_type }}</strong>
+ <a class="text-muted float-right" href="{{ $offer->shop_url }}">{{ $offer->shop }}</a>
+ </div>
+
+ <h4 class="mb-0 hide-overflow h-45">
+ <a class="text-dark ttext-truncate hide-overflow" href="#{{ $offer->name }}" title="{{$offer->name}}" >{{ $offer->name }}</a>
+ </h4>
+
+ <p class="card-text mb-auto text-success w-100"><del class="text-danger">{{ TF::fF($offer->original_price) . "€" }}</del> <strong class="ffloat-right">{{ TF::fF($offer->discounted_price) . "€" }}</strong>
+ <span class="float-right text-muted">{{ TF::fF($offer->base_price ) }}€/L</span>
+ </p>
+ <div class="mb-1 text-muted w-100">
+ <span class="float-right">{{ TF::fF($offer->volume) . " Liter" }}</span><span>{{ TF::fF($offer->abv) . "%" }} Alk.</span>
+ </div>
+ <a href="{{ $offer->url }}">Jetzt bestellen</a>
+ <p class="text-muted text-small w-100 nmt-10">
+ Versand: {{ TF::fF($offer->shipping_costs) }}€ <span class=" float-right">Gratis ab {{ $offer->free_shipping }}</span>
+ </p>
+ </div>
+ </div>
+ <img class="card-img-right flex-auto d-none d-md-block img-thumbnail" src="{{ $offer->image_url }}" alt="{{ $offer->name }}" title="{{$offer->name}} :: {{ $offer->shop }}">
+
+ <!-- <= sm -->
+ <img class="card-img-top flex-auto d-sm-block img-thumbnail d-md-none" src="{{ $offer->image_url }}" alt="{{ $offer->name }}" title="{{$offer->name}} :: {{ $offer->shop }}" style="opacity: 0.7; filter: grayscale(100%);">
+ <div class="card-body .d-md-none d-lg-none d-xl-none d-xs-flex flex-column align-items-start">
+ <div class="h-100 card-img-overlay">
+ <p class="card-text bg-danger float-right rounded" style="color: white; font-size: 150%; padding-right: 10px; padding-left:10px; opacity: 0.9;">{{ $offer->procent}}%</p>
+ </div>
+ <div class="flex-column card-img-overlay bg-dark-opacity" sstyle="top: 350px">
+ <div class="d-inline align-items-start text-left w-100 mb-2">
+ <strong class="text-primary">{{ $offer->spirit_type }}</strong>
+ <a class="text-dark" href="{{ $offer->shop_url }}">{{ $offer->shop }}</a>
+ </div>
+ <h3 class="mb-0 d-inline-block hide-overflow">
+ <a class="text-dark ttext-truncate" href="#{{ $offer->name }}" title="{{$offer->name}}" >{{ $offer->name }}</a>
+ </h3>
+
+ <div class="mb-1 text-muted w-100">
+ <span class="float-right">{{ TF::fF($offer->volume) . " Liter" }}</span><span>{{ TF::fF($offer->abv) . "%" }} Alk.</span>
+ </div>
+
+ <p class="card-text mb-auto text-success w-100"><del class="text-danger">{{ TF::fF($offer->original_price) . "€" }}</del> <strong class="ffloat-right">{{ TF::fF($offer->discounted_price) . "€" }}</strong>
+ <span class="float-right text-muted">{{ TF::fF($offer->base_price ) }}€/L</span>
+ </p>
+ <a href="{{ $offer->url }}">Jetzt bestellen</a>
+ </div>
+ </div>
+ </div>
+ </div>
+
+<?php
+
+
+ if ( $count % 2 == 1) {
+?>
+<!-- ./row -->
+ </div>
+<?php
+ }
+
+ $count++;
+
+}
+
+// schließt den div bei ungerade einträgen
+if ( $count % 2 == 1) {
+?>
+<!-- ./row -->
+ </div>
+<?php
+}
+
+?>
+
+{{ $data->links() }}
+
+
+<!-- ./container -->
+ </div>
+
+@endsection
+
diff --git a/site/resources/views/snippets/footer.blade.php b/site/resources/views/snippets/footer.blade.php
new file mode 100644
index 0000000..80ea21e
--- /dev/null
+++ b/site/resources/views/snippets/footer.blade.php
@@ -0,0 +1,24 @@
+<footer class="footer">
+ <div class="container">
+ <div class="row">
+ <div class="col">
+ <div class="card-body">
+
+ <h4>Links</h4>
+ <a href="#/impressum">Impressum</a>
+ </div>
+ </div>
+ <div class="col ffooter-col">
+ <div class="card-body">
+ <h4>Über</h4>
+ <p class="ttext-muted">
+ Hi, bla bla bla
+ </p>
+ <!--img src="https://www.maximilianmoehring.com/wp-content/uploads/sites/12/2017/12/180x180xPortrait_klein4.png.pagespeed.ic.qidt2UvDcW.png"-->
+ </div>
+ </div>
+ <!--span class="text-muted">Place sticky footer content here.</span-->
+ </div>
+ </div>
+</footer>
+
diff --git a/site/resources/views/snippets/navbar.blade.php b/site/resources/views/snippets/navbar.blade.php
index e61a348..379dfeb 100644
--- a/site/resources/views/snippets/navbar.blade.php
+++ b/site/resources/views/snippets/navbar.blade.php
@@ -1,25 +1,34 @@
<header>
<!-- Fixed navbar -->
- <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
- <a class="navbar-brand" href="#">Fixed navbar</a>
+ <nav class="navbar navbar-expand-md navbar-dark ffixed-top bg-dark">
+ <a class="navbar-brand" href="/">Alkobote.de</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
- <li class="nav-item active">
- <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
+ <li class="nav-item {{ Request::is('/') ? 'active' : '' }}">
+ <a class="nav-link" href="/">Übersicht{!! Request::is('/') ? ' <span class="sr-only">(current)</span>' : ''!!}</a>
</li>
- <li class="nav-item">
- <a class="nav-link" href="#">Link</a>
+ <li class="nav-item {{ Request::is('whisky') ? 'active' : '' }}">
+ <a class="nav-link" href="/whisky">Whisky{!! Request::is('whisky') ? ' <span class="sr-only">(current)</span>' : ''!!}</a>
</li>
- <li class="nav-item">
- <a class="nav-link disabled" href="#">Disabled</a>
+ <li class="nav-item {{ Request::is('wodka') ? 'active' : '' }}">
+ <a class="nav-link" href="/wodka">Wodka{!! Request::is('wodka') ? ' <span class="sr-only">(current)</span>' : ''!!}</a>
+ </li>
+ <li class="nav-item {{ Request::is('gin') ? 'active' : '' }}">
+ <a class="nav-link" href="/gin">Gin{!! Request::is('gin') ? ' <span class="sr-only">(current)</span>' : ''!!}</a>
+ </li>
+ <li class="nav-item {{ Request::is('rum') ? 'active' : '' }}">
+ <a class="nav-link" href="/rum">Rum{!! Request::is('rum') ? ' <span class="sr-only">(current)</span>' : ''!!}</a>
+ </li>
+ <li class="nav-item {{ Request::is('misc') ? 'active' : '' }}">
+ <a class="nav-link" href="/misc">Anderes{!! Request::is('misc') ? ' <span class="sr-only">(current)</span>' : ''!!}</a>
</li>
</ul>
<form class="form-inline mt-2 mt-md-0">
- <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
- <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
+ <input class="form-control mr-sm-2" type="text" placeholder="Suchen" aria-label="Search">
+ <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Suchen</button>
</form>
</div>
</nav>
diff --git a/site/routes/web.php b/site/routes/web.php
index b3d92f4..65a1237 100644
--- a/site/routes/web.php
+++ b/site/routes/web.php
@@ -13,7 +13,11 @@
Route::get('/', 'IndexController@showPage')->name('index');
-Route::get('/whisky', 'WhiskyController@showPage')->name('index');
+Route::get('/whisky', 'OfferController@showPage')->name('whisky');
+Route::get('/wodka', 'OfferController@showPage')->name('wodka');
+Route::get('/gin', 'OfferController@showPage')->name('gin');
+Route::get('/rum', 'OfferController@showPage')->name('rum');
+Route::get('/misc', 'OfferController@showPage')->name('misc');
Route::get('/welcome', function () {
return view('welcome');