From 51a40b63736d3ce8f0878276823ed6b9ba93ec28 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 8 Feb 2018 01:06:12 +0100 Subject: Adds working view and pagination. --- site/app/Http/Controllers/IndexController.php | 8 ++++- site/config/app.php | 2 +- site/public/css/custom.css | 4 +++ site/resources/lang/de/pagination.php | 20 +++++++++++ site/resources/views/index.blade.php | 50 +++++++++++++++++++++++++++ site/resources/views/layouts/base.blade.php | 2 ++ 6 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 site/public/css/custom.css create mode 100644 site/resources/lang/de/pagination.php 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 @@ + '« Vorherige', + 'next' => 'Nächste »', + '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 @@ +
original_price/100) . "€"; ?> discounted_price/100). "€"; ?>