diff options
author | DavisLWebb <davislwebb@ymail.com> | 2014-03-04 16:27:11 -0500 |
---|---|---|
committer | DavisLWebb <davislwebb@ymail.com> | 2014-03-04 16:27:11 -0500 |
commit | 2eb8e1c090071abf3108828efc831f12128e17df (patch) | |
tree | a1410e2cc118db1b410808b7f339e4c5f52bd43c /app/views/games | |
parent | fb76b4db64583def6db3aac43e31c25d3bd489df (diff) | |
parent | aca85cf084702c29014a17eafb090421061fae8b (diff) |
Merge branch 'master' of http://github.com/LukeShu/leaguer
Conflicts:
app/assets/stylesheets/scaffolds.css.scss
app/views/games/index.html.erb
db/migrate/20140304043618_create_servers.rb
db/migrate/20140304043622_create_matches.rb
db/migrate/20140304043631_create_games.rb
Diffstat (limited to 'app/views/games')
-rw-r--r-- | app/views/games/_form.html.erb | 37 | ||||
-rw-r--r-- | app/views/games/edit.html.erb | 6 | ||||
-rw-r--r-- | app/views/games/index.html.erb | 4 | ||||
-rw-r--r-- | app/views/games/index.json.jbuilder | 4 | ||||
-rw-r--r-- | app/views/games/new.html.erb | 5 | ||||
-rw-r--r-- | app/views/games/show.html.erb | 27 | ||||
-rw-r--r-- | app/views/games/show.json.jbuilder | 1 |
7 files changed, 84 insertions, 0 deletions
diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb new file mode 100644 index 0000000..8941c59 --- /dev/null +++ b/app/views/games/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_for(@game) do |f| %> + <% if @game.errors.any? %> + <div id="error_explanation"> + <h2><%= pluralize(@game.errors.count, "error") %> prohibited this game from being saved:</h2> + + <ul> + <% @game.errors.full_messages.each do |msg| %> + <li><%= msg %></li> + <% end %> + </ul> + </div> + <% end %> + + <div class="field"> + <%= f.label :name %><br> + <%= f.text_area :name %> + </div> + <div class="field"> + <%= f.label :players_per_team %><br> + <%= f.number_field :players_per_team %> + </div> + <div class="field"> + <%= f.label :teams_per_match %><br> + <%= f.number_field :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.number_field :randomized_teams %> + </div> + <div class="actions"> + <%= f.submit %> + </div> +<% end %> diff --git a/app/views/games/edit.html.erb b/app/views/games/edit.html.erb new file mode 100644 index 0000000..d72bd2e --- /dev/null +++ b/app/views/games/edit.html.erb @@ -0,0 +1,6 @@ +<h1>Editing game</h1> + +<%= render 'form' %> + +<%= link_to 'Show', @game %> | +<%= link_to 'Back', games_path %> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index ccd0f63..ac362cd 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -32,4 +32,8 @@ <br> +<<<<<<< HEAD <%= link_to 'New Game', new_game_path %> +======= +<%= link_to 'New Game', new_game_path, {:class => "btn btn-warning"} %> +>>>>>>> aca85cf084702c29014a17eafb090421061fae8b diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder new file mode 100644 index 0000000..7e5c1a1 --- /dev/null +++ b/app/views/games/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@games) do |game| + json.extract! game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams + json.url game_url(game, format: :json) +end diff --git a/app/views/games/new.html.erb b/app/views/games/new.html.erb new file mode 100644 index 0000000..ab95f70 --- /dev/null +++ b/app/views/games/new.html.erb @@ -0,0 +1,5 @@ +<h1>New game</h1> + +<%= render 'form' %> + +<%= link_to 'Back', games_path %> diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb new file mode 100644 index 0000000..88bf91c --- /dev/null +++ b/app/views/games/show.html.erb @@ -0,0 +1,27 @@ +<p> + <strong>Name:</strong> + <%= @game.name %> +</p> + +<p> + <strong>Players per team:</strong> + <%= @game.players_per_team %> +</p> + +<p> + <strong>Teams per match:</strong> + <%= @game.teams_per_match %> +</p> + +<p> + <strong>Set rounds:</strong> + <%= @game.set_rounds %> +</p> + +<p> + <strong>Randomized teams:</strong> + <%= @game.randomized_teams %> +</p> + +<%= link_to 'Edit', edit_game_path(@game) %> | +<%= link_to 'Back', games_path %> diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder new file mode 100644 index 0000000..1a2d0c7 --- /dev/null +++ b/app/views/games/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at |