Ejemplo n.º 1
0
 /**
  * Lists all rounds.
  */
 public static function list_all()
 {
     $rounds = Round::all();
     View::make('round/list.html', array('rounds' => $rounds));
 }
Ejemplo n.º 2
0
        // Fail: send login errors
    }
});
// GET Logout - Logout and redirect to login form
Route::get('logout', function () {
    Auth::logout();
    return Redirect::to('login');
});
// ALL Auth necessary stuff here
Route::group(array('before' => 'auth'), function () {
    // GET List of stations
    Route::get('/', function () {
        return View::make('stationlist', array('stations' => Station::all()));
    });
    Route::get('all', function () {
        $data = array('teams' => Team::all(), 'stations' => Station::all(), 'rounds' => Round::all());
        foreach ($data['teams'] as $t) {
            $t->sum = 0;
        }
        return View::make('all', $data);
    });
    // GET Form for adding new team to a station
    Route::get('(:any)/nyttlag', function ($slug) {
        $station = Station::where('slug', '=', $slug)->first();
        $teams = Team::all();
        $stationRounds = Round::where('station_id', '=', $station->id)->get();
        $teamsAdded = array();
        $teamslist = array();
        foreach ($stationRounds as $sr) {
            $teamsAdded[] = $sr->team->id;
        }