summaryrefslogtreecommitdiff
path: root/app/views/games
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-03 23:06:47 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-03 23:06:47 -0500
commit8b526eadfcb024a5e8ead4c5b63eacb554db0cf5 (patch)
treec96e10e0e0e48154430a4d733c6385433dbe2739 /app/views/games
parent3c9da1eee130d49f998016f8bad91f97f8bdf100 (diff)
parent423d0e5a440d8d66407522bc842ef273196173bc (diff)
Merge branch 'clean4'
Conflicts: app/assets/stylesheets/scaffolds.css.scss app/assets/stylesheets/static.css.scss app/controllers/sessions_controller.rb app/controllers/static_controller.rb app/controllers/tournaments_controller.rb app/controllers/users_controller.rb app/helpers/sessions_helper.rb app/models/game.rb app/models/user.rb app/views/games/index.html.erb app/views/tournaments/index.html.erb app/views/tournaments/new.html.erb app/views/users/_form.html.erb app/views/users/index.html.erb app/views/users/index.json.jbuilder app/views/users/new.html.erb app/views/users/show.html.erb app/views/users/show.json.jbuilder config/routes.rb generate.sh
Diffstat (limited to 'app/views/games')
-rw-r--r--app/views/games/_form.html.erb37
-rw-r--r--app/views/games/edit.html.erb6
-rw-r--r--app/views/games/index.json.jbuilder4
-rw-r--r--app/views/games/new.html.erb5
-rw-r--r--app/views/games/show.html.erb29
-rw-r--r--app/views/games/show.json.jbuilder1
6 files changed, 82 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.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..7986016
--- /dev/null
+++ b/app/views/games/show.html.erb
@@ -0,0 +1,29 @@
+<p id="notice"><%= notice %></p>
+
+<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