diff options
-rw-r--r-- | app/assets/stylesheets/application/scaffolds.css.scss | 12 | ||||
-rw-r--r-- | app/controllers/matches_controller.rb | 5 | ||||
-rw-r--r-- | db/seeds.rb | 47 |
3 files changed, 52 insertions, 12 deletions
diff --git a/app/assets/stylesheets/application/scaffolds.css.scss b/app/assets/stylesheets/application/scaffolds.css.scss index 703e3d6..4f0c781 100644 --- a/app/assets/stylesheets/application/scaffolds.css.scss +++ b/app/assets/stylesheets/application/scaffolds.css.scss @@ -39,9 +39,6 @@ html { form.search { @extend .navbar-form; float: right; - input[type="submit"] { - @extend .btn-warning; - } input[type="text"], input[type="search"] { background-color: #303030; border: 2px solid #ED9C28; @@ -51,6 +48,9 @@ html { height: 30px; padding: 0px 5px; } + input[type="submit"] { + @extend .btn-warning; + } } } @@ -77,7 +77,7 @@ html { clear: both; border-top: solid 1px $orange; text-align: center; - margin: 0 auto; + margin: 1em auto 0; width: 90%; } } @@ -148,7 +148,7 @@ input, textarea{ border: 3px inset #A5A5A5; padding: 8px; - color: $orange !important; + color: $orange; background: rgba(0,0,0,0.5); margin: 0 0 5px 0; } @@ -157,7 +157,7 @@ select { background-color: #333; padding: 5px; border: none; - color: $orange !important; + color: $orange; } pre { diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 5745ac9..81ffcd8 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -44,7 +44,7 @@ class MatchesController < ApplicationController end when 2 # Started, waiting to finish - @match.handle_sampling(params) + @match.handle_sampling(@current_user, params) # The @match.status will be updated by Statistic's after_save hook respond_to do |format| format.html { redirect_to tournament_match_path(@tournament, @match), notice: 'Match has finished.' } @@ -69,8 +69,9 @@ class MatchesController < ApplicationController end return end + else + redirect_to tournament_match_path(@tournament, @match) end - redirect_to tournament_match_path(@tournament, @match) end private diff --git a/db/seeds.rb b/db/seeds.rb index f9d32ac..31ae463 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -54,19 +54,30 @@ if Rails.env.development? players_for_league.push(User.create(name: "Kaceytron" , password: "password", email: "Kaceytron@gmail.com" , user_name: "Kaceytron" , password_confirmation: "password")) # Semi-real users - davis = User.create(name: "Davis Webb" , password: "password", email: "davislwebb@gmail.com" , user_name: "TeslasMind" , password_confirmation: "password") - foy = User.create(name: "Nathaniel Foy" , password: "password", email: "nfoy@notreal.com" , user_name: "Nalfeinx" , password_confirmation: "password") guntas = User.create(name: "Guntas Grewal" , password: "password", email: "guntasgrewal@gmail.com" , user_name: "guntasgrewal", password_confirmation: "password") luke = User.create(name: "Luke Shumaker" , password: "password", email: "lukeshu@emacs4lyfe.com" , user_name: "lukeshu" , password_confirmation: "password") tomer = User.create(name: "Tomer Kimia" , password: "password", email: "tomer@2majors4lyfe.com" , user_name: "tkimia" , password_confirmation: "password") - andrew = User.create(name: "Andrew Murrell" , password: "password", email: "murrel@murrel.gov" , user_name: "ImFromNasa" , password_confirmation: "password") - joey = User.create(name: "Joseph Adams" , password: "password", email: "alpha142@fluttershyop.com" , user_name: "alpha142" , password_confirmation: "password") josh = User.create(name: "Josh Huser" , password: "password", email: "jhuser@iownabusiness.net" , user_name: "WinterWorks" , password_confirmation: "password") dunsmore = User.create(name: "Professor Dunsmore", password: "password", email: "bxd@purdue.edu" , user_name: "Dumbledore" , password_confirmation: "password") marco = User.create(name: "Marco Polo" , password: "password", email: "marco@ta4lyfe.com" , user_name: "iCoordinate" , password_confirmation: "password") jordan = User.create(name: "Geoffrey Webb" , password: "password", email: "imnotjoffreybarathian@gameofthrones.com", user_name: "GTBPhoenix" , password_confirmation: "password") obama = User.create(name: "Obama" , password: "password", email: "obama@whitehouse.gov" , user_name: "Obama" , password_confirmation: "password") + g = Array.new + + davis = User.create(name: "Davis Webb" , password: "password", email: "davislwebb@gmail.com" , user_name: "TeslasMind" , password_confirmation: "password") + foy = User.create(name: "Nathaniel Foy" , password: "password", email: "nfoy@purdue.edu" , user_name: "NalfeinX" , password_confirmation: "password") + andrew = User.create(name: "Andrew Murrell" , password: "password", email: "murrel@murrel.gov" , user_name: "ImFromNasa" , password_confirmation: "password") + joey = User.create(name: "Joseph Adams" , password: "password", email: "alpha142@fluttershyop.com" , user_name: "alpha142" , password_confirmation: "password") + panda = User.create(name: "Panda" , password: "password", email: "panda@gmail.com" , user_name: "InspectorPanderp" , password_confirmation: "password") + mesa = User.create(name: "Mesataki" , password: "password", email: "mesataki@gmail.com" , user_name: "Mesataki" , password_confirmation: "password") + guntas_league = User.create(name: "TolkiensButt" , password: "password", email: "TolkiensButt@gmail.com" , user_name: "TolkiensButt" , password_confirmation: "password") + lyra = User.create(name: "Lyra Heartstings" , password: "password", email: "LyraHeartstings@gmail.com" , user_name: "Lyra Heartstings" , password_confirmation: "password") + josh_league = User.create(name: "Josh_league" , password: "password", email: "josh_league@gmail.com" , user_name: "Joshoowah" , password_confirmation: "password") + jeff = User.create(name: "Jeff Linguinee" , password: "password", email: "jefflingueeneeeee@gmail.com" , user_name: "SenorJeffafa" , password_confirmation: "password") + sarah = User.create(name: "Sarah Lawson" , password: "password", email: "sarah@gmail.com" , user_name: "LittlexSurah" , password_confirmation: "password") + + # League of Legends tournament league_tourn = Tournament.create(game: league, name: "League of Legends Seed", min_players_per_team: 5, max_players_per_team: 5, @@ -128,4 +139,32 @@ if Rails.env.development? tourn6.join(jordan) tourn6.join(obama) tourn6.join(joey) + + davis.remote_usernames.create(game: league, value: {"name" => "TeslasMind", "id" => 30533514} ) + foy.remote_usernames.create(game: league, value: {"name" => "NalfeinX", "id" => 29538130} ) + andrew.remote_usernames.create(game: league, value: {"name" => "ImFromNasa", "id" => 29782091} ) + joey.remote_usernames.create(game: league, value: {"name" => "Alpha142", "id" => 29732514} ) + sarah.remote_usernames.create(game: league, value: {"name" => "LittlexSurah", "id" => 30613787} ) + mesa.remote_usernames.create(game: league, value: {"name" => "Mesataki", "id" => 37259275} ) + panda.remote_usernames.create(game: league, value: {"name" => "NalfeinX", "id" => 47953989} ) + jordan.remote_usernames.create(game: league, value: {"name" => "GTBPhoenix", "id" => 29812020} ) + josh_league.remote_usernames.create(game: league, value: {"name" => "Joshoowah", "id" => 26083333} ) + jeff.remote_usernames.create(game: league, value: {"name" => "SenorJeffafa", "id" => 32612067} ) + lyra.remote_usernames.create(game: league, value: {"name" => "Lyra Heartstings", "id" => 32240762} ) + + + g.push(davis, foy, andrew, joey, panda, mesa, jordan, jeff, sarah, josh_league) + #g.push(davis, foy, andrew, joey, panda, mesa, jordan, jeff, sarah, guntas_league) + + custom = Tournament.create(game: league, name: "Real League Game", + min_players_per_team: 5, max_players_per_team: 5, + min_teams_per_match: 2, max_teams_per_match: 2, + scoring_method: "winner_takes_all") + + custom.hosts.push(User.find(1)) + g.each do |player| + custom.join(player) + end + + end |