diff options
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 25 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 8 | ||||
-rw-r--r-- | app/views/tournaments/new.html.erb | 12 |
3 files changed, 41 insertions, 4 deletions
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb new file mode 100644 index 0000000..302283d --- /dev/null +++ b/app/views/tournaments/_selected.html.erb @@ -0,0 +1,25 @@ +<form accept-charset="UTF-8" action="/users" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="6WQoPLFISlDYCsi4LhAgT0hgrht19yydD3w5TlKfb7I=" /></div> + <p> + <label for="GameType">Game</label><br> + <input id="GameType" name="League of Legends" type="text" /> + </p> + <p> + <label for="players_per_team">Number of Players</label><br> + <input id="players_per_team" name="5" type="text" /> + </p> + <p> + <label for="teams_per_match">Teams per Match</label><br> + <input id="teams_per_match" name="2" type="text" /> + </p> + <p> + <label for="set_rounds">Set Number of Rounds?</label><br> + <input id="set_rounds" name="1" type="text" /> + </p> + <p> + <label for="randomized_teams">Randomized Teams?</label><br> + <input id="randomized_teams" name="0" type="text" /> + </p> + <p> + <input name="create" type="submit" value="Create Tournament" /> + </p> +</form>
\ No newline at end of file diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 8ab3c15..6006cad 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -1,9 +1,9 @@ <h1>Listing tournaments</h1> -<table class="table table-hover"> +<table> <thead> <tr> - <th>Game</th> + <th></th> <th></th> <th></th> <th></th> @@ -13,7 +13,7 @@ <tbody> <% @tournaments.each do |tournament| %> <tr> - <td><%= %></td> + <td><%= tournament.game %></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> @@ -24,4 +24,4 @@ <br> -<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning" %> +<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %> diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb new file mode 100644 index 0000000..a47f643 --- /dev/null +++ b/app/views/tournaments/new.html.erb @@ -0,0 +1,12 @@ +<h1>New tournament</h1> + +<%= select_tag 'tournament_id', options_for_select(["Select a Game Type"] + Game.all.collect {|game| game.name}), :onchange => 'populate()' %> + +<br /> +<div id='ajax-form'> + <% render :partial => "selected" %> +</div> +<br /><br /> + + +<%= link_to 'Back', tournaments_path %> |