diff options
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 13 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 9 | ||||
-rw-r--r-- | app/views/tournaments/new.html.erb | 8 |
3 files changed, 20 insertions, 10 deletions
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 551dc40..9b1b7f8 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -2,14 +2,21 @@ <%= render "common/error_messages", :target => @tournament %> <%= f.hidden_field(:game_id) %> + <% @chosen = Game.find_by(params[:game]) %> <% @tournament.attributes.each do |name, value| %> - <% if (name == "id") or (name =~ /.*_at$/) %> + <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") %> <% next %> <% end %> <p> - <%= f.label name %><br> - <%= f.text_field name %> + <%= f.label name %><br> + <% if !@chosen.attributes[name].nil? %> + <%= f.text_field(name, :value => @chosen.attributes[name] ) %> + <% else %> + <%= f.text_field name %> + <% end %> + </p> + <% end %> <%= f.submit %> <% end %> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 3d54b8c..80d68a3 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -1,6 +1,7 @@ -<h1>Listing tournaments</h1> +<h1>Listing Tournaments</h1> -<table> +<% if @tournaments.length > 0 %> +<table class="table table-hover"> <thead> <tr> <th>Game</th> @@ -35,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/new.html.erb b/app/views/tournaments/new.html.erb index e007e31..8c74068 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -2,13 +2,13 @@ <%= form_tag(new_tournament_path, method: "get") do %> <%= select_tag('game', - options_from_collection_for_select(@games, 'id', 'name', @tournament.game.nil? || @tournament.game.id), - :prompt => "Select a Game Type") %> - <%= submit_tag("Select", :class => "btn-warning btn-lg") %> + options_from_collection_for_select(@games, 'id', 'name', @tournament.game.nil? || @tournament.game.id), + :prompt => "Select a Game Type") %> + <%= submit_tag("Select", :class => "btn btn-success btn-xs") %> <% end %> <div id='ajax-form'> - <% unless @tournament.game.nil? %> + <% if not @tournament.game.nil? %> <%= render 'selected' %> <% end %> </div> |