From 4e754e04d6bd04267e5a55011aa9f4f2a2fc7859 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Tue, 25 Mar 2014 16:30:13 -0400 Subject: Tournament has a NAME now --- app/views/tournaments/_form.html.erb | 4 ++++ app/views/tournaments/index.html.erb | 2 ++ app/views/tournaments/index.json.jbuilder | 2 +- app/views/tournaments/show.html.erb | 5 +++++ app/views/tournaments/show.json.jbuilder | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) (limited to 'app/views') 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 @@ -11,6 +11,10 @@ <% end %> +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
<%= f.label :game_id %>
<%= f.text_field :game_id %> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index fb8b381..f8f21e7 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -3,6 +3,7 @@ + @@ -20,6 +21,7 @@ <% @tournaments.each do |tournament| %> + 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 208c6f4..3cb6179 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -1,5 +1,10 @@

<%= notice %>

+

+ Name: + <%= @tournament.name %> +

+

Game: <%= @tournament.game %> 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 -- cgit v1.2.3 From 0c22c4bd9a0b4a0b0ff5840c1af41c0b320e3529 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Tue, 25 Mar 2014 17:30:10 -0400 Subject: added match status --- app/views/alerts/show.html.erb | 2 + app/views/application/permission_denied.html.erb | 1 - app/views/common/_error_messages.html.erb | 11 ------ app/views/games/index.html.erb | 6 +-- app/views/games/show.html.erb | 2 + app/views/layouts/application.html.erb | 28 +------------- app/views/matches/_form.html.erb | 23 +++++++++++- app/views/matches/index.html.erb | 14 ++++--- app/views/matches/index.json.jbuilder | 2 +- app/views/matches/new.html.erb | 2 + app/views/matches/show.html.erb | 34 +++++++---------- app/views/matches/show.json.jbuilder | 2 +- app/views/pms/show.html.erb | 2 + app/views/servers/show.html.erb | 2 + app/views/sessions/_form.html.erb | 21 +++++++++++ app/views/sessions/edit.html.erb | 6 +++ app/views/sessions/index.html.erb | 27 ++++++++++++++ app/views/sessions/index.json.jbuilder | 4 ++ app/views/sessions/new.html.erb | 24 ++---------- app/views/sessions/show.html.erb | 9 +++++ app/views/sessions/show.json.jbuilder | 1 + app/views/static/homepage.html.erb | 18 --------- app/views/tournaments/_selected.html.erb | 21 ----------- app/views/tournaments/index.html.erb | 47 ++++++++---------------- app/views/tournaments/join.html.erb | 2 - app/views/tournaments/new.html.erb | 15 +------- app/views/tournaments/show.html.erb | 35 +----------------- app/views/users/already_signed_in.html.erb | 1 - app/views/users/index.html.erb | 6 +-- app/views/users/new.html.erb | 33 ++--------------- app/views/users/show.html.erb | 2 + 31 files changed, 156 insertions(+), 247 deletions(-) delete mode 100644 app/views/application/permission_denied.html.erb delete mode 100644 app/views/common/_error_messages.html.erb create mode 100644 app/views/sessions/_form.html.erb create mode 100644 app/views/sessions/edit.html.erb create mode 100644 app/views/sessions/index.html.erb create mode 100644 app/views/sessions/index.json.jbuilder create mode 100644 app/views/sessions/show.html.erb create mode 100644 app/views/sessions/show.json.jbuilder delete mode 100644 app/views/static/homepage.html.erb delete mode 100644 app/views/tournaments/_selected.html.erb delete mode 100644 app/views/tournaments/join.html.erb delete mode 100644 app/views/users/already_signed_in.html.erb (limited to 'app/views') diff --git a/app/views/alerts/show.html.erb b/app/views/alerts/show.html.erb index 5dda2c9..eeab7f7 100644 --- a/app/views/alerts/show.html.erb +++ b/app/views/alerts/show.html.erb @@ -1,3 +1,5 @@ +

<%= notice %>

+

Author: <%= @alert.author %> diff --git a/app/views/application/permission_denied.html.erb b/app/views/application/permission_denied.html.erb deleted file mode 100644 index 1ef883c..0000000 --- a/app/views/application/permission_denied.html.erb +++ /dev/null @@ -1 +0,0 @@ -

Permission denied

diff --git a/app/views/common/_error_messages.html.erb b/app/views/common/_error_messages.html.erb deleted file mode 100644 index 731f62c..0000000 --- a/app/views/common/_error_messages.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<%# http://railscasts.com/episodes/211-validations-in-rails-3 %> -<% if target.errors.any? %> -
-

<%= pluralize(target.errors.count, "error") %> prohibited this form from being submitted:

-
    - <% target.errors.full_messages.each do |msg| %> -
  • <%= msg %>
  • - <% end %> -
-
-<% end %> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index 79acd1e..27c5860 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -1,6 +1,6 @@

Listing games

-
Name Game Status Min players per team
<%= tournament.name %> <%= tournament.game %> <%= tournament.status %> <%= tournament.min_players_per_team %>
+
@@ -36,6 +36,4 @@
- -<%= link_to 'New Game', new_game_path, {:class => "btn btn-warning"} %> - +<%= link_to 'New Game', new_game_path %> diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 39d4a97..1f1a154 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,3 +1,5 @@ +

<%= notice %>

+

Name: <%= @game.name %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 976ee85..cefd1be 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,36 +5,10 @@ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= csrf_meta_tags %> - <%= yield :head %> -

+<%= yield %> -<% if notice %>

<%= notice %>

<% end %> - -
<%= yield %>
- -
-

Leaguer © 2014, Tomer Kimia, Andrew Murrell, Luke Shumaker, Nathaniel Foy, Davis Webb, and Guntas Grewal

-
-<%= debug(params) if Rails.env.development? %> diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 015aed0..727c002 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -1,5 +1,20 @@ -<%= form_for([@tournament, @tournament.matches.build]) do |f| %> - +<%= form_for(@match) do |f| %> + <% if @match.errors.any? %> +
+

<%= pluralize(@match.errors.count, "error") %> prohibited this match from being saved:

+ +
    + <% @match.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :status %>
+ <%= f.number_field :status %> +
<%= f.label :tournament_id %>
<%= f.text_field :tournament_id %> @@ -8,6 +23,10 @@ <%= f.label :name %>
<%= f.text_field :name %>
+
+ <%= f.label :winner_id %>
+ <%= f.text_field :winner_id %> +
<%= f.submit %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 60df1b5..400efb4 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -3,6 +3,7 @@
Name
+ @@ -13,14 +14,15 @@ - <% @tournament.matches.each do |match| %> + <% @matches.each do |match| %> - + + - - - + + + <% end %> @@ -28,4 +30,4 @@
-<%= link_to 'New Match', new_tournament_match_path %> +<%= link_to 'New Match', new_match_path %> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 0b2bfcd..1a63f5f 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :tournament_id, :name, :winner_id + json.extract! match, :id, :status, :tournament_id, :name, :winner_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/new.html.erb b/app/views/matches/new.html.erb index 74e7e3a..bd4c78c 100644 --- a/app/views/matches/new.html.erb +++ b/app/views/matches/new.html.erb @@ -1,3 +1,5 @@

New match

<%= render 'form' %> + +<%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index b6930ea..f3fc822 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,6 +1,13 @@ +

<%= notice %>

+ +

+ Status: + <%= @match.status %> +

+

Tournament: - <%= @match.tournament.id %> + <%= @match.tournament %>

@@ -8,23 +15,10 @@ <%= @match.name %>

-<% if (@tournament.hosts.include?(current_user) and @match.winner.nil?) %> - <%= form_for([@tournament, @match], method: "put") do |f| %> - - <%= f.submit("Select winner") %> - <% end %> -<% end %> - -<% unless @match.winner.nil? %> -

- Winner: - <%= @match.winner.users.collect{|u| u.user_name}.join(", ") %> -

-<% end %> +

+ Winner: + <%= @match.winner %> +

-<%= link_to 'Back', tournament_matches_path %> +<%= link_to 'Edit', edit_match_path(@match) %> | +<%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index fe14010..a3ef588 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :tournament_id, :name, :winner_id, :created_at, :updated_at +json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :created_at, :updated_at diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb index 2a03716..5ee483f 100644 --- a/app/views/pms/show.html.erb +++ b/app/views/pms/show.html.erb @@ -1,3 +1,5 @@ +

<%= notice %>

+

Author: <%= @pm.author %> diff --git a/app/views/servers/show.html.erb b/app/views/servers/show.html.erb index 67f7647..039cd8f 100644 --- a/app/views/servers/show.html.erb +++ b/app/views/servers/show.html.erb @@ -1,2 +1,4 @@ +

<%= notice %>

+ <%= link_to 'Edit', edit_server_path(@server) %> | <%= link_to 'Back', servers_path %> diff --git a/app/views/sessions/_form.html.erb b/app/views/sessions/_form.html.erb new file mode 100644 index 0000000..1b94e77 --- /dev/null +++ b/app/views/sessions/_form.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@session) do |f| %> + <% if @session.errors.any? %> +
+

<%= pluralize(@session.errors.count, "error") %> prohibited this session from being saved:

+ +
    + <% @session.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :user_id %>
+ <%= f.text_field :user_id %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/sessions/edit.html.erb b/app/views/sessions/edit.html.erb new file mode 100644 index 0000000..bbd8407 --- /dev/null +++ b/app/views/sessions/edit.html.erb @@ -0,0 +1,6 @@ +

Editing session

+ +<%= render 'form' %> + +<%= link_to 'Show', @session %> | +<%= link_to 'Back', sessions_path %> diff --git a/app/views/sessions/index.html.erb b/app/views/sessions/index.html.erb new file mode 100644 index 0000000..707a47d --- /dev/null +++ b/app/views/sessions/index.html.erb @@ -0,0 +1,27 @@ +

Listing sessions

+ +
Status Tournament Name Winner
<%= match.tournament.id %><%= match.status %><%= match.tournament %> <%= match.name %> <%= match.winner %><%= link_to 'Show', tournament_match_path(@tournament, match) %><%= link_to 'Edit', edit_tournament_match_path(@tournament, match) %><%= link_to 'Destroy', tournament_match_path(@tournament, match), method: :delete, data: { confirm: 'Are you sure?' } %><%= link_to 'Show', match %><%= link_to 'Edit', edit_match_path(match) %><%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %>
+ + + + + + + + + + + <% @sessions.each do |session| %> + + + + + + + <% end %> + +
User
<%= session.user %><%= link_to 'Show', session %><%= link_to 'Edit', edit_session_path(session) %><%= link_to 'Destroy', session, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Session', new_session_path %> diff --git a/app/views/sessions/index.json.jbuilder b/app/views/sessions/index.json.jbuilder new file mode 100644 index 0000000..18fd4fa --- /dev/null +++ b/app/views/sessions/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@sessions) do |session| + json.extract! session, :id, :user_id + json.url session_url(session, format: :json) +end diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index b4acf77..55c9eca 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,23 +1,5 @@ -

Sign in

-<% if @user.nil? %> -

The email/username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email/username and password.

-<% end %> +

New session

-
- <%= form_for(:session, url: sessions_path) do |f| %> -

- <%= f.label(:username_or_email, "Username/Email") %>
- <%= f.text_field :username_or_email%> -

-

- <%= f.label :password %>
- <%= f.password_field :password %> -

-

- <%= f.submit "Sign in", class: "btn btn-large btn-primary" %> -

- <% end %> - -

New user? <%= link_to("Sign up now!", new_user_path) %>

-
+<%= render 'form' %> +<%= link_to 'Back', sessions_path %> diff --git a/app/views/sessions/show.html.erb b/app/views/sessions/show.html.erb new file mode 100644 index 0000000..5176869 --- /dev/null +++ b/app/views/sessions/show.html.erb @@ -0,0 +1,9 @@ +

<%= notice %>

+ +

+ User: + <%= @session.user %> +

+ +<%= link_to 'Edit', edit_session_path(@session) %> | +<%= link_to 'Back', sessions_path %> diff --git a/app/views/sessions/show.json.jbuilder b/app/views/sessions/show.json.jbuilder new file mode 100644 index 0000000..4ebf936 --- /dev/null +++ b/app/views/sessions/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @session, :id, :user_id, :created_at, :updated_at diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb deleted file mode 100644 index 3ca8176..0000000 --- a/app/views/static/homepage.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -
- -
-

Welcome to Leaguer

-

This is a tournment management system designed to be used for any team sport. Our peer review system ensures that the best players move on to the next round! Try creating a new tournament and having people sign up for it.

-

- <% if !signed_in? %> - <%= link_to 'Log In', new_session_path, :class => "btn btn-warning btn-lg", :role => "button" %> - <%= link_to 'Sign Up', new_user_path, :class => "btn btn-warning btn-lg", :role => "button" %> - <% else %> - <%= link_to 'Start a Tournament', new_tournament_path, :class => "btn btn-warning btn-lg", :role => "button" %> - <% end %> - <%= link_to 'See Ongoing Tournaments', tournaments_path, :class => "btn btn-warning btn-lg", :role => "button" %> - -

-
- -
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb deleted file mode 100644 index 8734b14..0000000 --- a/app/views/tournaments/_selected.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= form_for(@tournament) do |f| %> - <%= 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$/) or (name == "game_id") or (name == "status") %> - <% next %> - <% end %> -

- <%= f.label name %>
- <% if !@chosen.attributes[name].nil? %> - <%= f.text_field(name, :value => @chosen.attributes[name] ) %> - <% else %> - <%= f.text_field name %> - <% end %> -

- <% end %> - - <%= f.submit %> -<% end %> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 90c3d7a..f8f21e7 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -1,14 +1,16 @@ -

Listing Tournaments

+

Listing tournaments

-<% if @tournaments.length > 0 %> - +
- - + + + + + @@ -20,28 +22,13 @@ <% @tournaments.each do |tournament| %> - - - + + + + + + + @@ -50,9 +37,7 @@ <% end %>
Name Game StatusPlayers per teamTeams per matchMin players per teamMax players per teamMin teams per matchMax teams per matchSet rounds Randomized teams
<%= tournament.name %><% case tournament.status - when 0 %> - <%= form_tag(tournament_path(tournament), method: "put") do %> - - <%= submit_tag("Join") %> - <% end %> - <% when 1 %> - Ongoing - <% else %> - Closed - <%end %> - <%= tournament.min_players_per_team %> - <% if tournament.min_players_per_team != tournament.max_players_per_team %> - to <%= tournament.max_players_per_team %> - <% end %> - <%= tournament.min_teams_per_match %> - <% if tournament.min_teams_per_match != tournament.max_teams_per_match %> - to <%= tournament.max_teams_per_match %> - <% end %> - <%= tournament.game %><%= tournament.status %><%= tournament.min_players_per_team %><%= tournament.max_players_per_team %><%= tournament.min_teams_per_match %><%= tournament.max_teams_per_match %><%= tournament.set_rounds %> <%= tournament.randomized_teams %> <%= link_to 'Show', tournament %> <%= link_to 'Edit', edit_tournament_path(tournament) %>
-<% else %> -

No tournaments going on right now... Why not start your own?

-<% end %> +
-<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %> +<%= link_to 'New Tournament', new_tournament_path %> diff --git a/app/views/tournaments/join.html.erb b/app/views/tournaments/join.html.erb deleted file mode 100644 index 1d38d68..0000000 --- a/app/views/tournaments/join.html.erb +++ /dev/null @@ -1,2 +0,0 @@ - <%= @user.name %> - diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 8c74068..2a60539 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -1,16 +1,5 @@ -

New Tournament

+

New tournament

-<%= 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 btn-success btn-xs") %> -<% end %> - -
- <% if not @tournament.game.nil? %> - <%= render 'selected' %> - <% end %> -
+<%= render 'form' %> <%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index 3de0623..3cb6179 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -1,19 +1,5 @@ -<% if @tournament.joinable_by?(current_user) %> - <%= form_tag(tournament_path(@tournament), method: "put") do %> - - <%= current_user.name %><%= submit_tag("Join") %> - <% end %> -<% end %> +

<%= notice %>

- -
- <%= tag("div", {:class => "progress-bar progress-bar-warning", :style => "width: " +(@tournament.players.count * 100 / (@tournament.min_players_per_team * @tournament.min_teams_per_match)).to_s + "%", "aria-valuemax" => "100", "aria-valuemin" => "0", "aria-valuenow" => (@tournament.players.count * 100 / (@tournament.min_players_per_team * @tournament.min_teams_per_match)).to_s, "role" => "progressbar"}) %> - 60% Complete (warning) -
-
-

<%= @tournament.players.count %> have signed up. <%= @tournament.min_players_per_team * @tournament.min_teams_per_match %> needed.

- -<% if current_user.in_group?(:host) %>

Name: <%= @tournament.name %> @@ -21,7 +7,7 @@

Game: - <%= @tournament.id %> + <%= @tournament.game %>

@@ -59,22 +45,5 @@ <%= @tournament.randomized_teams %>

-

- Status: - <%= @tournament.status %> -

- -<%= form_tag(tournaments_path.to_s + "/" + @tournament.id.to_s + "/edit", method: "get") do %> - - <% if @tournament.players.count >= @tournament.min_players_per_team * @tournament.min_teams_per_match %> - <%= submit_tag("Close Tournament Registration") %> - <% else %> - <%= submit_tag("Close Tournament Registration", disabled: true) %> - <% end %> -<% end %> - <%= link_to 'Edit', edit_tournament_path(@tournament) %> | <%= link_to 'Back', tournaments_path %> - -<% end %> - diff --git a/app/views/users/already_signed_in.html.erb b/app/views/users/already_signed_in.html.erb deleted file mode 100644 index 04b4248..0000000 --- a/app/views/users/already_signed_in.html.erb +++ /dev/null @@ -1 +0,0 @@ -

You are currently signed in

diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 89e369a..3692112 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,9 +1,8 @@

Listing users

- +
- @@ -16,9 +15,8 @@ <% @users.each do |user| %> - - + diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index c23f76d..efc0404 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,32 +1,5 @@ -

Sign Up

+

New user

-<%= form_for @user do |f| %> - <%= render "common/error_messages", :target => @user %> -

- <%= f.label :name %>
- <%= f.text_field :name %> -

-

- <%= f.label :email %>
- <%= f.text_field :email %> -

-

- <%= f.label :user_name %>
- <%= f.text_field :user_name %> -

-

- <%= f.label :password %>
- <%= f.password_field :password %> -

-

- <%= f.label(:password_confirmation, "Confirm Password") %>
- <%= f.password_field :password_confirmation %> -

-

- <%= f.submit("Be a Leaguer", :class => "signup") %> -

-<% end %> - - -<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "signin" %> +<%= render 'form' %> +<%= link_to 'Back', users_path %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index d8cc82b..9455a3c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,3 +1,5 @@ +

<%= notice %>

+

Name: <%= @user.name %> -- cgit v1.2.3 From 53b4f8028fc987b0cf26a7a073fec7064b4b6d8a Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 25 Mar 2014 17:38:38 -0400 Subject: revert Guntas --- app/views/alerts/show.html.erb | 2 - app/views/application/permission_denied.html.erb | 1 + app/views/common/_error_messages.html.erb | 11 ++++++ app/views/games/index.html.erb | 6 ++- app/views/games/show.html.erb | 2 - app/views/layouts/application.html.erb | 28 +++++++++++++- app/views/matches/_form.html.erb | 23 +----------- app/views/matches/index.html.erb | 14 +++---- app/views/matches/index.json.jbuilder | 2 +- app/views/matches/new.html.erb | 2 - app/views/matches/show.html.erb | 34 ++++++++++------- app/views/matches/show.json.jbuilder | 2 +- app/views/pms/show.html.erb | 2 - app/views/servers/show.html.erb | 2 - app/views/sessions/_form.html.erb | 21 ----------- app/views/sessions/edit.html.erb | 6 --- app/views/sessions/index.html.erb | 27 -------------- app/views/sessions/index.json.jbuilder | 4 -- app/views/sessions/new.html.erb | 24 ++++++++++-- app/views/sessions/show.html.erb | 9 ----- app/views/sessions/show.json.jbuilder | 1 - app/views/static/homepage.html.erb | 18 +++++++++ app/views/tournaments/_selected.html.erb | 21 +++++++++++ app/views/tournaments/index.html.erb | 47 ++++++++++++++++-------- app/views/tournaments/join.html.erb | 2 + app/views/tournaments/new.html.erb | 15 +++++++- app/views/tournaments/show.html.erb | 35 +++++++++++++++++- app/views/users/already_signed_in.html.erb | 1 + app/views/users/index.html.erb | 6 ++- app/views/users/new.html.erb | 33 +++++++++++++++-- app/views/users/show.html.erb | 2 - 31 files changed, 247 insertions(+), 156 deletions(-) create mode 100644 app/views/application/permission_denied.html.erb create mode 100644 app/views/common/_error_messages.html.erb delete mode 100644 app/views/sessions/_form.html.erb delete mode 100644 app/views/sessions/edit.html.erb delete mode 100644 app/views/sessions/index.html.erb delete mode 100644 app/views/sessions/index.json.jbuilder delete mode 100644 app/views/sessions/show.html.erb delete mode 100644 app/views/sessions/show.json.jbuilder create mode 100644 app/views/static/homepage.html.erb create mode 100644 app/views/tournaments/_selected.html.erb create mode 100644 app/views/tournaments/join.html.erb create mode 100644 app/views/users/already_signed_in.html.erb (limited to 'app/views') diff --git a/app/views/alerts/show.html.erb b/app/views/alerts/show.html.erb index eeab7f7..5dda2c9 100644 --- a/app/views/alerts/show.html.erb +++ b/app/views/alerts/show.html.erb @@ -1,5 +1,3 @@ -

<%= notice %>

-

Author: <%= @alert.author %> diff --git a/app/views/application/permission_denied.html.erb b/app/views/application/permission_denied.html.erb new file mode 100644 index 0000000..1ef883c --- /dev/null +++ b/app/views/application/permission_denied.html.erb @@ -0,0 +1 @@ +

Permission denied

diff --git a/app/views/common/_error_messages.html.erb b/app/views/common/_error_messages.html.erb new file mode 100644 index 0000000..731f62c --- /dev/null +++ b/app/views/common/_error_messages.html.erb @@ -0,0 +1,11 @@ +<%# http://railscasts.com/episodes/211-validations-in-rails-3 %> +<% if target.errors.any? %> +
+

<%= pluralize(target.errors.count, "error") %> prohibited this form from being submitted:

+ +
+<% end %> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index 27c5860..79acd1e 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -1,6 +1,6 @@

Listing games

-
Username Name Email User name
<%= link_to("#{user.user_name}", user, nil) %> <%= user.name %> ******* <%= user.email %> <%= user.user_name %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %>
+
@@ -36,4 +36,6 @@
-<%= link_to 'New Game', new_game_path %> + +<%= link_to 'New Game', new_game_path, {:class => "btn btn-warning"} %> + diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 1f1a154..39d4a97 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,5 +1,3 @@ -

<%= notice %>

-

Name: <%= @game.name %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index cefd1be..976ee85 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,10 +5,36 @@ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= csrf_meta_tags %> + <%= yield :head %> +

+<% if notice %>

<%= notice %>

<% end %> + +
<%= yield %>
+ + +<%= debug(params) if Rails.env.development? %> diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 727c002..015aed0 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -1,20 +1,5 @@ -<%= form_for(@match) do |f| %> - <% if @match.errors.any? %> -
-

<%= pluralize(@match.errors.count, "error") %> prohibited this match from being saved:

- - -
- <% end %> - -
- <%= f.label :status %>
- <%= f.number_field :status %> -
+<%= form_for([@tournament, @tournament.matches.build]) do |f| %> +
<%= f.label :tournament_id %>
<%= f.text_field :tournament_id %> @@ -23,10 +8,6 @@ <%= f.label :name %>
<%= f.text_field :name %>
-
- <%= f.label :winner_id %>
- <%= f.text_field :winner_id %> -
<%= f.submit %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 400efb4..60df1b5 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -3,7 +3,6 @@
Name
- @@ -14,15 +13,14 @@ - <% @matches.each do |match| %> + <% @tournament.matches.each do |match| %> - - + - - - + + + <% end %> @@ -30,4 +28,4 @@
-<%= link_to 'New Match', new_match_path %> +<%= link_to 'New Match', new_tournament_match_path %> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 1a63f5f..0b2bfcd 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :status, :tournament_id, :name, :winner_id + json.extract! match, :id, :tournament_id, :name, :winner_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/new.html.erb b/app/views/matches/new.html.erb index bd4c78c..74e7e3a 100644 --- a/app/views/matches/new.html.erb +++ b/app/views/matches/new.html.erb @@ -1,5 +1,3 @@

New match

<%= render 'form' %> - -<%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index f3fc822..b6930ea 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,13 +1,6 @@ -

<%= notice %>

- -

- Status: - <%= @match.status %> -

-

Tournament: - <%= @match.tournament %> + <%= @match.tournament.id %>

@@ -15,10 +8,23 @@ <%= @match.name %>

-

- Winner: - <%= @match.winner %> -

+<% if (@tournament.hosts.include?(current_user) and @match.winner.nil?) %> + <%= form_for([@tournament, @match], method: "put") do |f| %> + + <%= f.submit("Select winner") %> + <% end %> +<% end %> + +<% unless @match.winner.nil? %> +

+ Winner: + <%= @match.winner.users.collect{|u| u.user_name}.join(", ") %> +

+<% end %> -<%= link_to 'Edit', edit_match_path(@match) %> | -<%= link_to 'Back', matches_path %> +<%= link_to 'Back', tournament_matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index a3ef588..fe14010 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :created_at, :updated_at +json.extract! @match, :id, :tournament_id, :name, :winner_id, :created_at, :updated_at diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb index 5ee483f..2a03716 100644 --- a/app/views/pms/show.html.erb +++ b/app/views/pms/show.html.erb @@ -1,5 +1,3 @@ -

<%= notice %>

-

Author: <%= @pm.author %> diff --git a/app/views/servers/show.html.erb b/app/views/servers/show.html.erb index 039cd8f..67f7647 100644 --- a/app/views/servers/show.html.erb +++ b/app/views/servers/show.html.erb @@ -1,4 +1,2 @@ -

<%= notice %>

- <%= link_to 'Edit', edit_server_path(@server) %> | <%= link_to 'Back', servers_path %> diff --git a/app/views/sessions/_form.html.erb b/app/views/sessions/_form.html.erb deleted file mode 100644 index 1b94e77..0000000 --- a/app/views/sessions/_form.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= form_for(@session) do |f| %> - <% if @session.errors.any? %> -
-

<%= pluralize(@session.errors.count, "error") %> prohibited this session from being saved:

- - -
- <% end %> - -
- <%= f.label :user_id %>
- <%= f.text_field :user_id %> -
-
- <%= f.submit %> -
-<% end %> diff --git a/app/views/sessions/edit.html.erb b/app/views/sessions/edit.html.erb deleted file mode 100644 index bbd8407..0000000 --- a/app/views/sessions/edit.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -

Editing session

- -<%= render 'form' %> - -<%= link_to 'Show', @session %> | -<%= link_to 'Back', sessions_path %> diff --git a/app/views/sessions/index.html.erb b/app/views/sessions/index.html.erb deleted file mode 100644 index 707a47d..0000000 --- a/app/views/sessions/index.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -

Listing sessions

- -
Status Tournament Name Winner
<%= match.status %><%= match.tournament %><%= match.tournament.id %> <%= match.name %> <%= match.winner %><%= link_to 'Show', match %><%= link_to 'Edit', edit_match_path(match) %><%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %><%= link_to 'Show', tournament_match_path(@tournament, match) %><%= link_to 'Edit', edit_tournament_match_path(@tournament, match) %><%= link_to 'Destroy', tournament_match_path(@tournament, match), method: :delete, data: { confirm: 'Are you sure?' } %>
- - - - - - - - - - - <% @sessions.each do |session| %> - - - - - - - <% end %> - -
User
<%= session.user %><%= link_to 'Show', session %><%= link_to 'Edit', edit_session_path(session) %><%= link_to 'Destroy', session, method: :delete, data: { confirm: 'Are you sure?' } %>
- -
- -<%= link_to 'New Session', new_session_path %> diff --git a/app/views/sessions/index.json.jbuilder b/app/views/sessions/index.json.jbuilder deleted file mode 100644 index 18fd4fa..0000000 --- a/app/views/sessions/index.json.jbuilder +++ /dev/null @@ -1,4 +0,0 @@ -json.array!(@sessions) do |session| - json.extract! session, :id, :user_id - json.url session_url(session, format: :json) -end diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 55c9eca..b4acf77 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,5 +1,23 @@ -

New session

+

Sign in

+<% if @user.nil? %> +

The email/username or password is incorrect. Verify that CAPS LOCK is not on, and then retype the current email/username and password.

+<% end %> -<%= render 'form' %> +
+ <%= form_for(:session, url: sessions_path) do |f| %> +

+ <%= f.label(:username_or_email, "Username/Email") %>
+ <%= f.text_field :username_or_email%> +

+

+ <%= f.label :password %>
+ <%= f.password_field :password %> +

+

+ <%= f.submit "Sign in", class: "btn btn-large btn-primary" %> +

+ <% end %> + +

New user? <%= link_to("Sign up now!", new_user_path) %>

+
-<%= link_to 'Back', sessions_path %> diff --git a/app/views/sessions/show.html.erb b/app/views/sessions/show.html.erb deleted file mode 100644 index 5176869..0000000 --- a/app/views/sessions/show.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -

<%= notice %>

- -

- User: - <%= @session.user %> -

- -<%= link_to 'Edit', edit_session_path(@session) %> | -<%= link_to 'Back', sessions_path %> diff --git a/app/views/sessions/show.json.jbuilder b/app/views/sessions/show.json.jbuilder deleted file mode 100644 index 4ebf936..0000000 --- a/app/views/sessions/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.extract! @session, :id, :user_id, :created_at, :updated_at diff --git a/app/views/static/homepage.html.erb b/app/views/static/homepage.html.erb new file mode 100644 index 0000000..3ca8176 --- /dev/null +++ b/app/views/static/homepage.html.erb @@ -0,0 +1,18 @@ +
+ +
+

Welcome to Leaguer

+

This is a tournment management system designed to be used for any team sport. Our peer review system ensures that the best players move on to the next round! Try creating a new tournament and having people sign up for it.

+

+ <% if !signed_in? %> + <%= link_to 'Log In', new_session_path, :class => "btn btn-warning btn-lg", :role => "button" %> + <%= link_to 'Sign Up', new_user_path, :class => "btn btn-warning btn-lg", :role => "button" %> + <% else %> + <%= link_to 'Start a Tournament', new_tournament_path, :class => "btn btn-warning btn-lg", :role => "button" %> + <% end %> + <%= link_to 'See Ongoing Tournaments', tournaments_path, :class => "btn btn-warning btn-lg", :role => "button" %> + +

+
+ +
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb new file mode 100644 index 0000000..8734b14 --- /dev/null +++ b/app/views/tournaments/_selected.html.erb @@ -0,0 +1,21 @@ +<%= form_for(@tournament) do |f| %> + <%= 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$/) or (name == "game_id") or (name == "status") %> + <% next %> + <% end %> +

+ <%= f.label name %>
+ <% if !@chosen.attributes[name].nil? %> + <%= f.text_field(name, :value => @chosen.attributes[name] ) %> + <% else %> + <%= f.text_field name %> + <% end %> +

+ <% end %> + + <%= f.submit %> +<% end %> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index f8f21e7..90c3d7a 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -1,16 +1,14 @@ -

Listing tournaments

+

Listing Tournaments

- +<% if @tournaments.length > 0 %> +
- - - - - + + @@ -22,13 +20,28 @@ <% @tournaments.each do |tournament| %> - - - - - - - + + + @@ -37,7 +50,9 @@ <% end %>
Name Game StatusMin players per teamMax players per teamMin teams per matchMax teams per matchSet roundsPlayers per teamTeams per match Randomized teams
<%= tournament.name %><%= tournament.game %><%= tournament.status %><%= tournament.min_players_per_team %><%= tournament.max_players_per_team %><%= tournament.min_teams_per_match %><%= tournament.max_teams_per_match %><%= tournament.set_rounds %><% case tournament.status + when 0 %> + <%= form_tag(tournament_path(tournament), method: "put") do %> + + <%= submit_tag("Join") %> + <% end %> + <% when 1 %> + Ongoing + <% else %> + Closed + <%end %> + <%= tournament.min_players_per_team %> + <% if tournament.min_players_per_team != tournament.max_players_per_team %> + to <%= tournament.max_players_per_team %> + <% end %> + <%= tournament.min_teams_per_match %> + <% if tournament.min_teams_per_match != tournament.max_teams_per_match %> + to <%= tournament.max_teams_per_match %> + <% end %> + <%= tournament.randomized_teams %> <%= link_to 'Show', tournament %> <%= link_to 'Edit', edit_tournament_path(tournament) %>
- +<% else %> +

No tournaments going on right now... Why not start your own?

+<% end %>
-<%= link_to 'New Tournament', new_tournament_path %> +<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %> diff --git a/app/views/tournaments/join.html.erb b/app/views/tournaments/join.html.erb new file mode 100644 index 0000000..1d38d68 --- /dev/null +++ b/app/views/tournaments/join.html.erb @@ -0,0 +1,2 @@ + <%= @user.name %> + diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb index 2a60539..8c74068 100644 --- a/app/views/tournaments/new.html.erb +++ b/app/views/tournaments/new.html.erb @@ -1,5 +1,16 @@ -

New tournament

+

New Tournament

-<%= render 'form' %> +<%= 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 btn-success btn-xs") %> +<% end %> + +
+ <% if not @tournament.game.nil? %> + <%= render 'selected' %> + <% end %> +
<%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index 3cb6179..3de0623 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -1,5 +1,19 @@ -

<%= notice %>

+<% if @tournament.joinable_by?(current_user) %> + <%= form_tag(tournament_path(@tournament), method: "put") do %> + + <%= current_user.name %><%= submit_tag("Join") %> + <% end %> +<% end %> + +
+ <%= tag("div", {:class => "progress-bar progress-bar-warning", :style => "width: " +(@tournament.players.count * 100 / (@tournament.min_players_per_team * @tournament.min_teams_per_match)).to_s + "%", "aria-valuemax" => "100", "aria-valuemin" => "0", "aria-valuenow" => (@tournament.players.count * 100 / (@tournament.min_players_per_team * @tournament.min_teams_per_match)).to_s, "role" => "progressbar"}) %> + 60% Complete (warning) +
+ +

<%= @tournament.players.count %> have signed up. <%= @tournament.min_players_per_team * @tournament.min_teams_per_match %> needed.

+ +<% if current_user.in_group?(:host) %>

Name: <%= @tournament.name %> @@ -7,7 +21,7 @@

Game: - <%= @tournament.game %> + <%= @tournament.id %>

@@ -45,5 +59,22 @@ <%= @tournament.randomized_teams %>

+

+ Status: + <%= @tournament.status %> +

+ +<%= form_tag(tournaments_path.to_s + "/" + @tournament.id.to_s + "/edit", method: "get") do %> + + <% if @tournament.players.count >= @tournament.min_players_per_team * @tournament.min_teams_per_match %> + <%= submit_tag("Close Tournament Registration") %> + <% else %> + <%= submit_tag("Close Tournament Registration", disabled: true) %> + <% end %> +<% end %> + <%= link_to 'Edit', edit_tournament_path(@tournament) %> | <%= link_to 'Back', tournaments_path %> + +<% end %> + diff --git a/app/views/users/already_signed_in.html.erb b/app/views/users/already_signed_in.html.erb new file mode 100644 index 0000000..04b4248 --- /dev/null +++ b/app/views/users/already_signed_in.html.erb @@ -0,0 +1 @@ +

You are currently signed in

diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 3692112..89e369a 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,8 +1,9 @@

Listing users

- +
+ @@ -15,8 +16,9 @@ <% @users.each do |user| %> + - + diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index efc0404..c23f76d 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,5 +1,32 @@ -

New user

+

Sign Up

-<%= render 'form' %> +<%= form_for @user do |f| %> + <%= render "common/error_messages", :target => @user %> +

+ <%= f.label :name %>
+ <%= f.text_field :name %> +

+

+ <%= f.label :email %>
+ <%= f.text_field :email %> +

+

+ <%= f.label :user_name %>
+ <%= f.text_field :user_name %> +

+

+ <%= f.label :password %>
+ <%= f.password_field :password %> +

+

+ <%= f.label(:password_confirmation, "Confirm Password") %>
+ <%= f.password_field :password_confirmation %> +

+

+ <%= f.submit("Be a Leaguer", :class => "signup") %> +

+<% end %> + + +<%= link_to 'Already Have an Account? Log in', new_session_path, :class => "signin" %> -<%= link_to 'Back', users_path %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 9455a3c..d8cc82b 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,5 +1,3 @@ -

<%= notice %>

-

Name: <%= @user.name %> -- cgit v1.2.3 From 433fc302fe2943e89a36657affea39d578475d20 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Tue, 25 Mar 2014 17:47:32 -0400 Subject: Match Status added --- app/views/matches/_form.html.erb | 4 ++++ app/views/matches/index.html.erb | 2 ++ app/views/matches/index.json.jbuilder | 2 +- app/views/matches/show.html.erb | 5 +++++ app/views/matches/show.json.jbuilder | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index f1e6047..727c002 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -11,6 +11,10 @@ <% end %> +

+ <%= f.label :status %>
+ <%= f.number_field :status %> +
<%= f.label :tournament_id %>
<%= f.text_field :tournament_id %> diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 71db08c..400efb4 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -3,6 +3,7 @@
Username Name Email User name
<%= link_to("#{user.user_name}", user, nil) %> <%= user.name %><%= user.email %> ******* <%= user.user_name %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %>
+ @@ -15,6 +16,7 @@ <% @matches.each do |match| %> + diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 0b2bfcd..1a63f5f 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :tournament_id, :name, :winner_id + json.extract! match, :id, :status, :tournament_id, :name, :winner_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 3abb1f7..f3fc822 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,5 +1,10 @@

<%= notice %>

+

+ Status: + <%= @match.status %> +

+

Tournament: <%= @match.tournament %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index fe14010..a3ef588 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :tournament_id, :name, :winner_id, :created_at, :updated_at +json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :created_at, :updated_at -- cgit v1.2.3

Status Tournament Name Winner
<%= match.status %> <%= match.tournament %> <%= match.name %> <%= match.winner %>