summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--site/app/Http/Controllers/IndexController.php8
-rw-r--r--site/config/app.php2
-rw-r--r--site/public/css/custom.css4
-rw-r--r--site/resources/lang/de/pagination.php20
-rw-r--r--site/resources/views/index.blade.php50
-rw-r--r--site/resources/views/layouts/base.blade.php2
6 files changed, 84 insertions, 2 deletions
diff --git a/site/app/Http/Controllers/IndexController.php b/site/app/Http/Controllers/IndexController.php
index fb853e2..745a023 100644
--- a/site/app/Http/Controllers/IndexController.php
+++ b/site/app/Http/Controllers/IndexController.php
@@ -3,6 +3,9 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Helpers\CryptoHelper;
+use Illuminate\Support\Facades\DB;
+use App\Http\Controllers\Controller;
+
class IndexController extends Controller {
/**
* Shows the index page.
@@ -11,6 +14,9 @@ class IndexController extends Controller {
*/
public function showPage(Request $request) {
- return view('index', ['large' => true]);
+ //$data = DB::table('angebote')->orderBy('quotient', 'DESC')->limit(100)->get();
+ $data = DB::table('angebote')->orderBy('quotient', 'DESC')->limit(100)->simplePaginate(20);
+
+ return view('index', ['data' => $data]);
}
}
diff --git a/site/config/app.php b/site/config/app.php
index b16e7f7..71d1455 100644
--- a/site/config/app.php
+++ b/site/config/app.php
@@ -78,7 +78,7 @@ return [
|
*/
- 'locale' => 'en',
+ 'locale' => 'de',
/*
|--------------------------------------------------------------------------
diff --git a/site/public/css/custom.css b/site/public/css/custom.css
new file mode 100644
index 0000000..f3c99e1
--- /dev/null
+++ b/site/public/css/custom.css
@@ -0,0 +1,4 @@
+.hide-overflow{
+ overflow: hidden;
+ text-overflow: ellipsis !important;
+}
diff --git a/site/resources/lang/de/pagination.php b/site/resources/lang/de/pagination.php
new file mode 100644
index 0000000..ad55d91
--- /dev/null
+++ b/site/resources/lang/de/pagination.php
@@ -0,0 +1,20 @@
+<?php
+
+return [
+
+ /*
+ |--------------------------------------------------------------------------
+ | Pagination Language Lines
+ |--------------------------------------------------------------------------
+ |
+ | The following language lines are used by the paginator library to build
+ | the simple pagination links. You are free to change them to anything
+ | you want to customize your views to better match your application.
+ |
+ */
+
+ 'previous' => '&laquo; Vorherige',
+ 'next' => 'Nächste &raquo;',
+ 'start' => 'Anfang',
+
+];
diff --git a/site/resources/views/index.blade.php b/site/resources/views/index.blade.php
index 6365aad..57c2c42 100644
--- a/site/resources/views/index.blade.php
+++ b/site/resources/views/index.blade.php
@@ -10,8 +10,56 @@
</div>
</div>
+<?php
+
+$count = 0;
+foreach( $data as $whisky) {
+
+ if ( $count % 2 == 0) {
+?>
<div class="row mb-2">
+<?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="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>
+ </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>
+ </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); ?>">
+ </div>
+ </div>
+
+<?php
+
+
+ if ( $count % 2 == 1) {
+?>
+ </div>
+<?php
+ }
+
+ $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">
@@ -350,9 +398,11 @@
</div>
</div>
+-->
</div>
+
@endsection
diff --git a/site/resources/views/layouts/base.blade.php b/site/resources/views/layouts/base.blade.php
index 24ec0f1..81f11f2 100644
--- a/site/resources/views/layouts/base.blade.php
+++ b/site/resources/views/layouts/base.blade.php
@@ -11,6 +11,7 @@
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/sticky-footer-navbar.css" rel="stylesheet">
<link href="/css/blog.css" rel="stylesheet">
+ <link href="/css/custom.css" rel="stylesheet">
@yield('css')
</head>
@@ -20,6 +21,7 @@
@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>