diff --git a/SRC/app/Http/Controllers/HomeController.php b/SRC/app/Http/Controllers/HomeController.php index 6f5ba54..c160051 100755 --- a/SRC/app/Http/Controllers/HomeController.php +++ b/SRC/app/Http/Controllers/HomeController.php @@ -2,17 +2,6 @@ class HomeController extends Controller { - /* - |-------------------------------------------------------------------------- - | Home Controller - |-------------------------------------------------------------------------- - | - | This controller renders your application's "dashboard" for users that - | are authenticated. Of course, you are free to change or remove the - | controller as you wish. It is just here to get your app started! - | - */ - /** * Create a new controller instance. * @@ -20,7 +9,7 @@ class HomeController extends Controller { */ public function __construct() { - $this->middleware('auth'); + // } /** @@ -30,9 +19,34 @@ class HomeController extends Controller { */ public function index() { - return view('home'); + $res = User::referents()->get(); + return view('home',['referents' => $res]); } + /** + * Show referent games + * + * @param String $id + * @return Response + */ + public function showReferentGames($id) + { + return view('referent_games', ['referent' => $id]); + } + + + /** + * Show one referent game + * + * @param String $id + * @param String $idGame + * @return Response + */ + public function showOneReferentGame($id, $idGame) + { + return view('one_referent_game', ['referent' => $id, 'game' => $idGame]); + } + } ?> \ No newline at end of file diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index 1bd089f..0703da5 100755 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -12,7 +12,13 @@ */ -Route::get('/', 'GameController@index'); +Route::get('/', 'HomeController@index'); + + + + + + Route::get('referents/{id}/games', 'GameController@showReferentGames')->where('id', '^((?!login|referent|admin).)*$'); Route::get('referents/{id}/games/{idGame}', 'GameController@showOneReferentGame'); diff --git a/SRC/public/css/frontend.css b/SRC/public/css/frontend.css new file mode 100644 index 0000000..7e22d8c --- /dev/null +++ b/SRC/public/css/frontend.css @@ -0,0 +1,62 @@ +* { + pading: 0; + margin: 0; + box-sizing: border-box; +} + +html, body { + font-family: 'Oswald', sans-serif; + width: 100%; + height: 100%; + background: #ebebeb; +} + +nav { + margin: 25px 20%; + +} +nav input { + font-size: 25px; + height: 70px; + width: 100%; + border: 2px solid #c3c3c3; + background: white; + padding: 10px 20px; + border-radius: 5px; + outline: 0; + letter-spacing: 1px; + word-spacing: 8px; + text-align: center; + font-family: 'Oswald', sans-serif; + +} + + +.referent { + transition: opacity 0.2s; + opacity: 0.75; + display: inline-block; + cursor: pointer; + border-radius: 5px; + position: relative; + background: white; + border: 2px solid #c3c3c3; + margin: 25px; + width: 200px; + height: 200px; + background-size: cover; + overflow: hidden; +} + +.referent:hover { + opacity: 1; +} +.referent .infos { + padding: 10px; + position: absolute; + bottom: 0; + width: 100%; + background:rgba(0, 0, 0, 0.7); + color: white; + text-align: center; +} \ No newline at end of file diff --git a/SRC/resources/views/home.blade.php b/SRC/resources/views/home.blade.php index b48b3c3..5356818 100755 --- a/SRC/resources/views/home.blade.php +++ b/SRC/resources/views/home.blade.php @@ -1,72 +1,47 @@ @extends('app') @section('content') - - -
-
- +{{ HTML::style('css/frontend.css'); }} + +@if ($referents != []) -@if ($referent != []) - + + @else -@endif - - - -
+

Aucun référent trouvé

@endsection