summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-03-06 17:45:22 -0500
committerDavisLWebb <davislwebb@ymail.com>2014-03-06 17:45:22 -0500
commit0c1299795a492e6296eb8e15bca576ea5139be6b (patch)
tree3921daf8c26d656b12b20ee22be63c97fa20f6fa /app/views
parent110d67f433c091a3b739c5bbebe110d963efaa73 (diff)
parentfe7d5ad458b4cabd8fd57b47f81abc56dd8532ad (diff)
Merge branch 'master' of http://github.com/LukeShu/leaguer
Conflicts: app/controllers/sessions_controller.rb app/views/sessions/new.html.erb
Diffstat (limited to 'app/views')
-rw-r--r--app/views/games/_form.html.erb18
-rw-r--r--app/views/games/index.html.erb14
-rw-r--r--app/views/games/index.json.jbuilder2
-rw-r--r--app/views/games/show.html.erb18
-rw-r--r--app/views/games/show.json.jbuilder2
-rw-r--r--app/views/sessions/new.html.erb1
-rw-r--r--app/views/teams/_form.html.erb4
-rw-r--r--app/views/teams/index.html.erb2
-rw-r--r--app/views/teams/index.json.jbuilder2
-rw-r--r--app/views/teams/show.html.erb7
-rw-r--r--app/views/teams/show.json.jbuilder2
-rw-r--r--app/views/tournaments/_form.html.erb28
-rw-r--r--app/views/tournaments/_selected.html.erb2
-rw-r--r--app/views/tournaments/index.html.erb33
-rw-r--r--app/views/tournaments/index.json.jbuilder2
-rw-r--r--app/views/tournaments/show.html.erb35
-rw-r--r--app/views/tournaments/show.json.jbuilder2
-rw-r--r--app/views/users/new.html.erb6
18 files changed, 148 insertions, 32 deletions
diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb
index 8941c59..f68e28f 100644
--- a/app/views/games/_form.html.erb
+++ b/app/views/games/_form.html.erb
@@ -16,12 +16,20 @@
<%= f.text_area :name %>
</div>
<div class="field">
- <%= f.label :players_per_team %><br>
- <%= f.number_field :players_per_team %>
+ <%= f.label :min_players_per_team %><br>
+ <%= f.number_field :min_players_per_team %>
</div>
<div class="field">
- <%= f.label :teams_per_match %><br>
- <%= f.number_field :teams_per_match %>
+ <%= 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>
@@ -29,7 +37,7 @@
</div>
<div class="field">
<%= f.label :randomized_teams %><br>
- <%= f.number_field :randomized_teams %>
+ <%= f.check_box :randomized_teams %>
</div>
<div class="actions">
<%= f.submit %>
diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb
index 7ee69d1..79acd1e 100644
--- a/app/views/games/index.html.erb
+++ b/app/views/games/index.html.erb
@@ -1,11 +1,13 @@
<h1>Listing games</h1>
-<table>
+<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
- <th>Players per team</th>
- <th>Teams per match</th>
+ <th>Min players per team</th>
+ <th>Max players per team</th>
+ <th>Min teams per match</th>
+ <th>Max teams per match</th>
<th>Set rounds</th>
<th>Randomized teams</th>
<th></th>
@@ -18,8 +20,10 @@
<% @games.each do |game| %>
<tr>
<td><%= game.name %></td>
- <td><%= game.players_per_team %></td>
- <td><%= game.teams_per_match %></td>
+ <td><%= game.min_players_per_team %></td>
+ <td><%= game.max_players_per_team %></td>
+ <td><%= game.min_teams_per_match %></td>
+ <td><%= game.max_teams_per_match %></td>
<td><%= game.set_rounds %></td>
<td><%= game.randomized_teams %></td>
<td><%= link_to 'Show', game %></td>
diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder
index 7e5c1a1..f8b3e96 100644
--- a/app/views/games/index.json.jbuilder
+++ b/app/views/games/index.json.jbuilder
@@ -1,4 +1,4 @@
json.array!(@games) do |game|
- json.extract! game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams
+ json.extract! game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams
json.url game_url(game, format: :json)
end
diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb
index 88bf91c..39d4a97 100644
--- a/app/views/games/show.html.erb
+++ b/app/views/games/show.html.erb
@@ -4,13 +4,23 @@
</p>
<p>
- <strong>Players per team:</strong>
- <%= @game.players_per_team %>
+ <strong>Min players per team:</strong>
+ <%= @game.min_players_per_team %>
</p>
<p>
- <strong>Teams per match:</strong>
- <%= @game.teams_per_match %>
+ <strong>Max players per team:</strong>
+ <%= @game.max_players_per_team %>
+</p>
+
+<p>
+ <strong>Min teams per match:</strong>
+ <%= @game.min_teams_per_match %>
+</p>
+
+<p>
+ <strong>Max teams per match:</strong>
+ <%= @game.max_teams_per_match %>
</p>
<p>
diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder
index 1a2d0c7..e689e7b 100644
--- a/app/views/games/show.json.jbuilder
+++ b/app/views/games/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at
+json.extract! @game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index 2b40ed9..b4acf77 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -20,3 +20,4 @@
<p>New user? <%= link_to("Sign up now!", new_user_path) %></p>
</div>
+
diff --git a/app/views/teams/_form.html.erb b/app/views/teams/_form.html.erb
index fd10129..cdd4299 100644
--- a/app/views/teams/_form.html.erb
+++ b/app/views/teams/_form.html.erb
@@ -11,6 +11,10 @@
</div>
<% end %>
+ <div class="field">
+ <%= f.label :match_id %><br>
+ <%= f.text_field :match_id %>
+ </div>
<div class="actions">
<%= f.submit %>
</div>
diff --git a/app/views/teams/index.html.erb b/app/views/teams/index.html.erb
index b077e10..6a3188d 100644
--- a/app/views/teams/index.html.erb
+++ b/app/views/teams/index.html.erb
@@ -3,6 +3,7 @@
<table>
<thead>
<tr>
+ <th>Match</th>
<th></th>
<th></th>
<th></th>
@@ -12,6 +13,7 @@
<tbody>
<% @teams.each do |team| %>
<tr>
+ <td><%= team.match %></td>
<td><%= link_to 'Show', team %></td>
<td><%= link_to 'Edit', edit_team_path(team) %></td>
<td><%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %></td>
diff --git a/app/views/teams/index.json.jbuilder b/app/views/teams/index.json.jbuilder
index b29428b..ca0ec8b 100644
--- a/app/views/teams/index.json.jbuilder
+++ b/app/views/teams/index.json.jbuilder
@@ -1,4 +1,4 @@
json.array!(@teams) do |team|
- json.extract! team, :id
+ json.extract! team, :id, :match_id
json.url team_url(team, format: :json)
end
diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb
index ab49d65..e41692a 100644
--- a/app/views/teams/show.html.erb
+++ b/app/views/teams/show.html.erb
@@ -1,2 +1,9 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+ <strong>Match:</strong>
+ <%= @team.match %>
+</p>
+
<%= link_to 'Edit', edit_team_path(@team) %> |
<%= link_to 'Back', teams_path %>
diff --git a/app/views/teams/show.json.jbuilder b/app/views/teams/show.json.jbuilder
index 1538019..8a85dcc 100644
--- a/app/views/teams/show.json.jbuilder
+++ b/app/views/teams/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @team, :id, :created_at, :updated_at
+json.extract! @team, :id, :match_id, :created_at, :updated_at
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb
index 1fd63e9..c2c0ba7 100644
--- a/app/views/tournaments/_form.html.erb
+++ b/app/views/tournaments/_form.html.erb
@@ -15,6 +15,34 @@
<%= f.label :game_id %><br>
<%= f.text_field :game_id %>
</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>
+ <div class="field">
+ <%= f.label :status %><br>
+ <%= f.number_field :status %>
+ </div>
<div class="actions">
<%= f.submit %>
</div>
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb
index 4277d8e..5058c56 100644
--- a/app/views/tournaments/_selected.html.erb
+++ b/app/views/tournaments/_selected.html.erb
@@ -18,7 +18,7 @@
<% next %>
<% end %>
<% if name == "created_at" %>
- <% break %>
+ <% break %>
<% end %>
<p>
<label for=<%= name %>><%= name.capitalize.gsub('_', ' ') %></label>
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb
index 26d0643..80d68a3 100644
--- a/app/views/tournaments/index.html.erb
+++ b/app/views/tournaments/index.html.erb
@@ -1,19 +1,34 @@
-<h1>Listing tournaments</h1>
+<h1>Listing Tournaments</h1>
-<table>
+<% if @tournaments.length > 0 %>
+<table class="table table-hover">
<thead>
<tr>
- <th>Tournament ID</th>
- <th>Show Tournament</th>
- <th>Edit Tournament</th>
- <th>Delete Tournament</th>
+ <th>Game</th>
+ <th>Min players per team</th>
+ <th>Max players per team</th>
+ <th>Min teams per match</th>
+ <th>Max teams per match</th>
+ <th>Set rounds</th>
+ <th>Randomized teams</th>
+ <th>Status</th>
+ <th></th>
+ <th></th>
+ <th></th>
</tr>
</thead>
<tbody>
<% @tournaments.each do |tournament| %>
<tr>
- <td><%= tournament.id %></td>
+ <td><%= tournament.game %></td>
+ <td><%= tournament.min_players_per_team %></td>
+ <td><%= tournament.max_players_per_team %></td>
+ <td><%= tournament.min_teams_per_match %></td>
+ <td><%= tournament.max_teams_per_match %></td>
+ <td><%= tournament.set_rounds %></td>
+ <td><%= tournament.randomized_teams %></td>
+ <td><%= tournament.status %></td>
<td><%= link_to 'Show', tournament %></td>
<td><%= link_to 'Edit', edit_tournament_path(tournament) %></td>
<td><%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %></td>
@@ -21,7 +36,9 @@
<% end %>
</tbody>
</table>
-
+<% else %>
+ <p class="no-entries"> No tournaments going on right now... Why not start your own? </p>
+<% end %>
<br>
<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %>
diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder
index e6f3b49..df8eee4 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, :game_id
+ json.extract! tournament, :id, :game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status
json.url tournament_url(tournament, format: :json)
end
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index 0d9dd10..4f97c7c 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -3,5 +3,40 @@
<%= @tournament.game %>
</p>
+<p>
+ <strong>Min players per team:</strong>
+ <%= @tournament.min_players_per_team %>
+</p>
+
+<p>
+ <strong>Max players per team:</strong>
+ <%= @tournament.max_players_per_team %>
+</p>
+
+<p>
+ <strong>Min teams per match:</strong>
+ <%= @tournament.min_teams_per_match %>
+</p>
+
+<p>
+ <strong>Max teams per match:</strong>
+ <%= @tournament.max_teams_per_match %>
+</p>
+
+<p>
+ <strong>Set rounds:</strong>
+ <%= @tournament.set_rounds %>
+</p>
+
+<p>
+ <strong>Randomized teams:</strong>
+ <%= @tournament.randomized_teams %>
+</p>
+
+<p>
+ <strong>Status:</strong>
+ <%= @tournament.status %>
+</p>
+
<%= link_to 'Edit', edit_tournament_path(@tournament) %> |
<%= link_to 'Back', tournaments_path %>
diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder
index 0fe65a6..7bedd4b 100644
--- a/app/views/tournaments/show.json.jbuilder
+++ b/app/views/tournaments/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @tournament, :id, :game_id, :created_at, :updated_at
+json.extract! @tournament, :id, :game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status, :created_at, :updated_at
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
index 704aa10..c23f76d 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -19,14 +19,14 @@
<%= f.password_field :password %>
</p>
<p>
- <%= f.label :password_confirm %><br>
+ <%= f.label(:password_confirmation, "Confirm Password") %><br>
<%= f.password_field :password_confirmation %>
</p>
<p>
- <%= f.submit %>
+ <%= f.submit("Be a Leaguer", :class => "signup") %>
</p>
<% end %>
-<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "btn btn-warning btn-lg" %>
+<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "signin" %>