Merge branch 'master' of https://github.com/matthieupenchenat81/ModuleWeb
This commit is contained in:
commit
5c05abf8b7
@ -1,18 +1,8 @@
|
|||||||
<?php namespace App\Http\Controllers;
|
<?php namespace App\Http\Controllers;
|
||||||
|
use User;
|
||||||
|
|
||||||
class HomeController extends Controller {
|
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.
|
* Create a new controller instance.
|
||||||
*
|
*
|
||||||
@ -20,7 +10,7 @@ class HomeController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('auth');
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,9 +20,34 @@ class HomeController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function index()
|
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]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -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', 'GameController@showReferentGames')->where('id', '^((?!login|referent|admin).)*$');
|
||||||
Route::get('referents/{id}/games/{idGame}', 'GameController@showOneReferentGame');
|
Route::get('referents/{id}/games/{idGame}', 'GameController@showOneReferentGame');
|
||||||
Route::get('searchRef/{reg}', 'GameController@findReferents');
|
Route::get('searchRef/{reg}', 'GameController@findReferents');
|
||||||
|
62
SRC/public/css/frontend.css
Normal file
62
SRC/public/css/frontend.css
Normal file
@ -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;
|
||||||
|
}
|
@ -1,72 +1,47 @@
|
|||||||
@extends('app')
|
@extends('app')
|
||||||
@section('content')
|
@section('content')
|
||||||
<link href="css/home.css" rel="stylesheet" type="text/css"/>
|
{{ HTML::style('css/frontend.css'); }}
|
||||||
<link href="css/coverflow.css" rel="stylesheet" type="text/css"/>
|
|
||||||
<br>
|
|
||||||
<center>
|
|
||||||
<img style="height:auto; width:auto; max-width:100px;" alt="" src="./pictures/homePic/home.png">
|
|
||||||
<nav>
|
<nav>
|
||||||
<form class="form-inline navbar" onsubmit="rechercherReferent()">
|
<form onsubmit="rechercherReferent()">
|
||||||
<div class="row divRecherche">
|
<div class="row divRecherche">
|
||||||
<div class="col-xs-12">
|
<input name="ref" id="ref" placeholder="Rechercher un référent" type="text">
|
||||||
<input id="searchfield" class="form-control inpSear" placeholder="Rechercher un Référant" name="search" type="text"/>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
@if ($referents != [])
|
||||||
|
|
||||||
@if ($referent != [])
|
<nav>
|
||||||
<div style="margin-left: 200px, margin-right: 200px" id="carousel-example-generic" class="carousel slide" data-ride="carousel">
|
<form>
|
||||||
|
<input name="searchterm" id="searchterm" placeholder="Rechercher un référent" type="text">
|
||||||
<!-- indicateur, à incrementé en fonction du nombre d'images -->
|
</form>
|
||||||
<ol class="carousel-indicators">
|
</nav>
|
||||||
@foreach ($referent as $ref)
|
<div id="referents" class="referents">
|
||||||
@if ($ref -> id == $referent[0] -> id)
|
|
||||||
<li data-target="#carousel-example-generic" data-slide-to="{{ $ref -> id }}" class='active' ></li>
|
|
||||||
@else
|
|
||||||
<li data-target="#carousel-example-generic" data-slide-to="{{ $ref -> id }} "></li>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
|
@foreach ($referents as $referent)
|
||||||
|
|
||||||
|
|
||||||
<!-- Parametres des images -->
|
<div class="referent" style="background-image:url('{{ $ref -> image }}')">
|
||||||
<div id="caroussel" class="carousel-inner" role="listbox">
|
<div class="infos">{{ $referent -> firstname }} {{ $referent -> lastname }}</div>
|
||||||
@foreach ($referent as $ref)
|
</div>
|
||||||
@if ($ref -> id == $referent[0] -> id)
|
|
||||||
<div class="item active">
|
|
||||||
@else
|
|
||||||
<div class="item">
|
|
||||||
@endif
|
|
||||||
<br>
|
|
||||||
<a href="/referents/{{$ref->id}}/games"><img class="imgRef" src="{{$ref -> image}}" alt="{{ $ref -> firstname }}-{{ $ref -> lastname }}"></a>
|
|
||||||
<a href="/referents/{{$ref->id}}/games"><div class="well well-lg nomRef">{{$ref -> firstname}}, {{$ref -> lastname}}</div></a>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Controles -->
|
|
||||||
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
|
@endforeach
|
||||||
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
</div>
|
||||||
<span class="sr-only">Précédant</span>
|
|
||||||
</a>
|
<script type="text/javascript">
|
||||||
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
|
$("#searchterm").keyup(function(e){
|
||||||
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
var q = $("#searchterm").val();
|
||||||
<span class="sr-only">Suivant</span>
|
$.getJSON("searchRef/" + q, function(data) {
|
||||||
</a>
|
$("#referents").empty();
|
||||||
</div>
|
$.each(data.query.search, function(i,item){
|
||||||
</div>
|
$("#referents").append('<div class="referent" style="background-image:url('4.jpg')"><div class="infos">'+ item.firstname +'</div></div>');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
@else
|
@else
|
||||||
@endif
|
<h1>Aucun référent trouvé</h1>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
document.oncontextmenu = new Function("return true");
|
|
||||||
|
|
||||||
function hideIcon(self) {
|
|
||||||
self.style.backgroundImage = 'none';
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="/js/rechercheRef.js"> </script>
|
|
||||||
</center>
|
|
||||||
@endsection
|
@endsection
|
||||||
|
Reference in New Issue
Block a user