diff --git a/pfosten/app/Http/Controllers/RoundsController.php b/pfosten/app/Http/Controllers/RoundsController.php index 1bcd73b3..5c7a5167 100644 --- a/pfosten/app/Http/Controllers/RoundsController.php +++ b/pfosten/app/Http/Controllers/RoundsController.php @@ -114,8 +114,7 @@ class RoundsController extends Controller // Validate form $this->validate(request(), [ - 'round_id' => 'required', - 'report' => 'required' + 'round_id' => 'required' ]); $seasonId = Season::getCurrent()->id; @@ -124,8 +123,10 @@ class RoundsController extends Controller //Log::info("Report = ".request("report")); - - $round->report = request("report"); + $round->report=""; + if (request("report")){ + $round->report = request("report"); + } $round->save(); diff --git a/pfosten/app/Http/Controllers/UsersController.php b/pfosten/app/Http/Controllers/UsersController.php index 13ac2833..fa07017c 100755 --- a/pfosten/app/Http/Controllers/UsersController.php +++ b/pfosten/app/Http/Controllers/UsersController.php @@ -16,8 +16,22 @@ use Log; class UsersController extends Controller { public function main() { + $roundname=""; + $report=""; - return view('main'); + $currentSeason=Season::getCurrent(); + + if ($currentSeason) { + $round_id = Round::getLastLockedRoundId(); + if ($round_id > -1) { + $round = Round::where("id", "=", $round_id)->first(); + $report = $round->report; + Log::info("Loaded report:".$report." round-id=".$round_id); + $roundname = $round->name; + } else { Log::info("No round identified. Last Locked=".$round_id); } + } else {Log::info("No current season");} + + return view('main',compact('roundname','report')); } public function index() { @@ -87,6 +101,8 @@ class UsersController extends Controller return redirect('/users'); } + + public function ranking($round_id) { Log::info("Start ranking"); @@ -166,9 +182,6 @@ class UsersController extends Controller if (!array_key_exists($key,$tendencies)) { $tendencies[$key]=0; } $tendencies[$key]+=1; - if ($user->id==1) { - Log::info("Triggered tendency bonus for userid ".$user->id." gameid ".$game->id." roundid ".$round->id." tippid ".$tipp->id." tendency=". $tendencies[$key]); - } } $user->totalScore += $score; @@ -185,7 +198,7 @@ class UsersController extends Controller // Increase score here if (array_key_exists($key,$tendencies)) { if ($tendencies[$key] == 4) { - Log::info("Increasing score ! userid=" . $user->id . ", gameid " . $game->id . ", roundid " . $round->id . ", tippid " . $tipp->id . ", tendency=" . $tendencies[$key]); + //Log::info("Increasing score ! userid=" . $user->id . ", gameid " . $game->id . ", roundid " . $round->id . ", tippid " . $tipp->id . ", tendency=" . $tendencies[$key]); $user->totalScore += 2; $user->dayScore+=2; } diff --git a/pfosten/resources/views/layouts/footer.blade.php b/pfosten/resources/views/layouts/footer.blade.php index d1752f10..ae2e3235 100644 --- a/pfosten/resources/views/layouts/footer.blade.php +++ b/pfosten/resources/views/layouts/footer.blade.php @@ -7,8 +7,8 @@ @endif
-

Anfragen aller Art bitte an Volker Geissler.

-

Tel. 0172xxxxxxx, vg@aol.com

+

Anfragen aller Art bitte an Volker Geißler.

+
diff --git a/pfosten/resources/views/layouts/layout.blade.php b/pfosten/resources/views/layouts/layout.blade.php index 9d66a360..11f358f7 100644 --- a/pfosten/resources/views/layouts/layout.blade.php +++ b/pfosten/resources/views/layouts/layout.blade.php @@ -6,7 +6,7 @@ - Hoschis Vollpfosten + Hoschis Tippspiel diff --git a/pfosten/resources/views/layouts/nav.blade.php b/pfosten/resources/views/layouts/nav.blade.php index 16502ae4..e781d835 100644 --- a/pfosten/resources/views/layouts/nav.blade.php +++ b/pfosten/resources/views/layouts/nav.blade.php @@ -1,6 +1,9 @@
- @endif - @if (Auth::check()) - -
- -

 

-

 

- - - - -

 

-

 

@endif + +@if (Auth::check()) +
+ + +

 {{ $roundname }}

+

 {!! $report !!}

+
+
+@endif @endsection \ No newline at end of file diff --git a/pfosten/resources/views/rounds/index.blade.php b/pfosten/resources/views/rounds/index.blade.php index f7a547b9..614c9868 100755 --- a/pfosten/resources/views/rounds/index.blade.php +++ b/pfosten/resources/views/rounds/index.blade.php @@ -37,7 +37,7 @@
-

! 

+

 

Berichterstattung

diff --git a/pfosten/resources/views/tipps/edit.blade.php b/pfosten/resources/views/tipps/edit.blade.php index 59ce51ea..2e8b6e94 100644 --- a/pfosten/resources/views/tipps/edit.blade.php +++ b/pfosten/resources/views/tipps/edit.blade.php @@ -1,14 +1,15 @@ @extends('layouts.layout') @section('content') -
+

Spieltipp:

+

 

+
{{ $game->team1 }} : {{ $game->team2 }}
-
{{ $game->team1 }} : {{ $game->team2 }}
-
+
{{ csrf_field() }}
@@ -17,24 +18,25 @@

  :  

- - -
+ + @if (App\Round::hasLockedGame($game->round_id)) {{ Form::checkbox('joker', 'yes', $tipp->joker, array('disabled') ) }} @else {{ Form::checkbox('joker', 'yes', $tipp->joker) }} @endif -
+ + +
- +

 

diff --git a/pfosten/resources/views/tipps/index.blade.php b/pfosten/resources/views/tipps/index.blade.php index 22069693..ecad1dc7 100755 --- a/pfosten/resources/views/tipps/index.blade.php +++ b/pfosten/resources/views/tipps/index.blade.php @@ -2,64 +2,73 @@ @section('content')
-
+
@if ($activeSeason) @endif -

Tipps

- +

Tipps

+

 

+
+ @if ($activeSeason)
@foreach($rounds->reverse() as $round)
- - - - - - - - - + - @foreach($round->games as $game) - - - + - + +
SpielAnstossErgebnisTipp Joker Punkte
 {{ $game->hasResult() ? $game->score1 . ' : ' . $game->score2 : ' Tippen ' }}
+ + + + - + + + - - - - - @endforeach -
SpielAnstossErgebnis - @if(App\Round::hasLockedGame($round->id)==true) - {{ App\Tipp::resultString(App\Tipp::getTipp( $user->id,$game->id)->id) }} - @else - {{ App\Tipp::getTipp($user->id,$game->id)->score1== -1 ? 'Tippen': App\Tipp::resultString(App\Tipp::getTipp($user->id,$game->id)->id) }} - @endif + Tipp Joker Punkte
{{App\Tipp::getScore(App\Tipp::getTipp($user->id,$game->id)->id)}}
+ @foreach($round->games as $game) + +   + + + {{ $game->hasResult() ? $game->score1 . ' : ' . $game->score2 : ' Tippen ' }} + + + @if(App\Round::hasLockedGame($round->id)==true) + {{ App\Tipp::resultString(App\Tipp::getTipp( $user->id,$game->id)->id) }} + @else + {{ App\Tipp::getTipp($user->id,$game->id)->score1== -1 ? 'Tippen': App\Tipp::resultString(App\Tipp::getTipp($user->id,$game->id)->id) }} + @endif + + + + {{App\Tipp::getScore(App\Tipp::getTipp($user->id,$game->id)->id)}} + + @endforeach + + + +

 

@endforeach - -
@endif -
+
@endsection \ No newline at end of file