Show all player leagues in 1 view, reduce nav Dropdown meny item count

This commit is contained in:
Torsten 2017-11-09 11:53:20 +01:00
parent 02329d5c21
commit c337916a3b
9 changed files with 93 additions and 47 deletions

View file

@ -66,6 +66,12 @@ class LeaguesController extends Controller
}
public function createLeagues($start_round_id, $round_count) {
$users=User::getActives();
if (sizeof($users)==0){
return view("leagues.no_users");
}
League::createLeagues($start_round_id, $round_count);
Log::info("LeaguesController::createLeagues completed.");
@ -103,18 +109,15 @@ class LeaguesController extends Controller
return view ('leagues.matches', compact('season', 'matchesTotal','leagues','leagueNames','roundNames'));
}
public static function showLeagueRanking($rank, $maxRoundId=-1) {
public static function showLeagueRanking() {
$season = Season::getCurrent();
$leagues = array_reverse(League::getRanking($rank));
//$leagues = array_reverse(League::getRanking($rank));
$leagueNames = League::getNames();
$userNames = User::getNames();
$leagueScores = League::getRanking($rank);
$totalRanking = League::getTotalRankingOverall(); // Nur für Auf/Abstiegsinfo benötigt.
$rankInfo=array();
foreach($totalRanking as $index => $entry) {
$userId=$entry[0];
$rankInfo[$userId]=$totalRanking[$index][4];
@ -126,9 +129,12 @@ class LeaguesController extends Controller
$cols[3]="lightgrey";
$cols[4]="";
$leagueScores=array();
foreach([1,2,3,4] as $rank) {
$leagueScores[$rank] = League::getRanking($rank);
}
return view ('leagues.chart',compact('season','leagues', 'leagueNames', 'userNames','leagueScores','rankInfo','rank','cols'));
return view ('leagues.chart',compact('season', 'leagueNames', 'userNames','leagueScores','rankInfo','rank','cols'));
}
public static function showSingleUserMatches($userId) {