diff options
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_form.html.erb | 4 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 3 | ||||
-rw-r--r-- | app/views/tournaments/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 5 | ||||
-rw-r--r-- | app/views/tournaments/show.json.jbuilder | 2 |
5 files changed, 13 insertions, 3 deletions
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index d098cbb..38855a0 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -12,6 +12,10 @@ <% end %> <div class="field"> + <%= f.label :name %><br> + <%= f.text_field :name %> + </div> + <div class="field"> <%= f.label :game_id %><br> <%= f.text_field :game_id %> </div> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 7fb4a1d..90c3d7a 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -4,6 +4,7 @@ <table class="table table-hover"> <thead> <tr> + <th>Name</th> <th>Game</th> <th>Status</th> <th>Players per team</th> @@ -18,7 +19,7 @@ <tbody> <% @tournaments.each do |tournament| %> <tr> - <td><%= tournament.id %></td> + <td><%= tournament.name %></td> <td><% case tournament.status when 0 %> <%= form_tag(tournament_path(tournament), method: "put") do %> diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index e95c6a7..4038f04 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, :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, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams 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 1f24f39..3de0623 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -15,6 +15,11 @@ <% if current_user.in_group?(:host) %> <p> + <strong>Name:</strong> + <%= @tournament.name %> +</p> + +<p> <strong>Game:</strong> <%= @tournament.id %> </p> diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder index de2fbe0..27fd5c0 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :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, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at |