diff options
author | Tomer Kimia <tkimia@purdue.edu> | 2014-04-01 18:52:51 -0400 |
---|---|---|
committer | Tomer Kimia <tkimia@purdue.edu> | 2014-04-01 18:52:51 -0400 |
commit | f3125c3087ac7d47d1698b328c76620f6a5464e8 (patch) | |
tree | 0317eb2937326d889e1b23f31dba9c756e3f4703 /app | |
parent | aa6e8f12a24e33d88a5751cee5e93bf4a038e2ef (diff) | |
parent | e6b160bd81e51e0bd88e5c2563a06ea5f0d64620 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/matches_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/tournaments_controller.rb | 2 | ||||
-rw-r--r-- | app/models/remote_username.rb | 4 | ||||
-rw-r--r-- | app/models/server_setting.rb | 2 | ||||
-rw-r--r-- | app/models/server_settings.rb | 2 | ||||
-rw-r--r-- | app/models/tournament_option.rb | 3 | ||||
-rw-r--r-- | app/models/tournament_preference.rb | 3 | ||||
-rw-r--r-- | app/views/matches/_form.html.erb | 8 | ||||
-rw-r--r-- | app/views/matches/index.html.erb | 6 | ||||
-rw-r--r-- | app/views/matches/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/matches/show.html.erb | 1 | ||||
-rw-r--r-- | app/views/matches/show.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/_form.html.erb | 20 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 1 | ||||
-rw-r--r-- | app/views/tournaments/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.json.jbuilder | 2 |
16 files changed, 24 insertions, 38 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index b312e9e..53028a4 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -72,6 +72,6 @@ class MatchesController < ApplicationController end # Never trust parameters from the scary internet, only allow the white list through. def match_params - params.require(:match).permit(:status, :tournament_id, :name, :winner_id) + params.require(:match).permit(:status, :tournament_id, :name, :winner_id, :remote_id) end end diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 4455ad2..799a13f 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -143,8 +143,6 @@ class TournamentsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def tournament_params - params.require(:tournament).permit(:game, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams) - end end diff --git a/app/models/remote_username.rb b/app/models/remote_username.rb new file mode 100644 index 0000000..94e5063 --- /dev/null +++ b/app/models/remote_username.rb @@ -0,0 +1,4 @@ +class RemoteUsername < ActiveRecord::Base + belongs_to :game + belongs_to :user +end diff --git a/app/models/server_setting.rb b/app/models/server_setting.rb new file mode 100644 index 0000000..28ae943 --- /dev/null +++ b/app/models/server_setting.rb @@ -0,0 +1,2 @@ +class ServerSetting < ActiveRecord::Base +end diff --git a/app/models/server_settings.rb b/app/models/server_settings.rb deleted file mode 100644 index 7f49863..0000000 --- a/app/models/server_settings.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ServerSettings < ActiveRecord::Base -end diff --git a/app/models/tournament_option.rb b/app/models/tournament_option.rb deleted file mode 100644 index 242a6f6..0000000 --- a/app/models/tournament_option.rb +++ /dev/null @@ -1,3 +0,0 @@ -class TournamentOption < ActiveRecord::Base - belongs_to :tournament -end diff --git a/app/models/tournament_preference.rb b/app/models/tournament_preference.rb new file mode 100644 index 0000000..1f335e3 --- /dev/null +++ b/app/models/tournament_preference.rb @@ -0,0 +1,3 @@ +class TournamentPreference < ActiveRecord::Base + belongs_to :tournament +end diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 3efb566..e2ec73b 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -12,6 +12,14 @@ <%= f.label :name %><br> <%= f.text_field :name %> </div> + <div class="field"> + <%= f.label :winner_id %><br> + <%= f.text_field :winner_id %> + </div> + <div class="field"> + <%= f.label :remote_id %><br> + <%= f.text_field :remote_id %> + </div> <div class="actions"> <%= f.submit %> </div> diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index e8d304a..0f86da6 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -8,6 +8,7 @@ <th>Tournament</th> <th>Name</th> <th>Winner</th> + <th>Remote</th> <th></th> <th></th> <th></th> @@ -22,9 +23,6 @@ <td><%= match.tournament %></td> <td><%= match.name %></td> <td><%= match.winner %></td> - <td><%= link_to 'Show', tournament_match_path(@tournament, match) %></td> - <td><%= link_to 'Edit', edit_tournament_match_path(@tournament, match) %></td> - <td><%= link_to 'Destroy', tournament_match_path(@tournament, match), method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </tbody> @@ -44,4 +42,4 @@ </g> <% end %> -</SVG>
\ No newline at end of file +</SVG> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 1a63f5f..18f172d 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :status, :tournament_id, :name, :winner_id + json.extract! match, :id, :status, :tournament_id, :name, :winner_id, :remote_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 6b962ad..53c3b38 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -32,4 +32,3 @@ </p> <% end %> -<%= link_to 'Back', tournament_matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index a3ef588..bfd2be4 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :created_at, :updated_at +json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :remote_id, :created_at, :updated_at diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 38855a0..3dadbf7 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -24,26 +24,6 @@ <%= f.number_field :status %> </div> <div class="field"> - <%= f.label :min_players_per_team %><br> - <%= f.number_field :min_players_per_team %> - </div> - <div class="field"> - <%= f.label :max_players_per_team %><br> - <%= f.number_field :max_players_per_team %> - </div> - <div class="field"> - <%= f.label :min_teams_per_match %><br> - <%= f.number_field :min_teams_per_match %> - </div> - <div class="field"> - <%= f.label :max_teams_per_match %><br> - <%= f.number_field :max_teams_per_match %> - </div> - <div class="field"> - <%= f.label :set_rounds %><br> - <%= f.number_field :set_rounds %> - </div> - <div class="field"> <%= f.label :randomized_teams %><br> <%= f.check_box :randomized_teams %> </div> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index b7c9118..6a86955 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -43,7 +43,6 @@ </div> <% end %> - </div> <% else %> <p class="no-entries"> No tournaments going on right now... Why not start your own? </p> diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index 4038f04..32587df 100644 --- a/app/views/tournaments/index.json.jbuilder +++ b/app/views/tournaments/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@tournaments) do |tournament| - json.extract! tournament, :id, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams + json.extract! tournament, :id, :name, :game_id, :status, :randomized_teams json.url tournament_url(tournament, format: :json) end diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder index 27fd5c0..d543c76 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :name, :game_id, :status, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at +json.extract! @tournament, :id, :name, :game_id, :status, :randomized_teams, :created_at, :updated_at |