From f5956e949699e8db56774e0338d7228c3289ec1e Mon Sep 17 00:00:00 2001 From: tkimia Date: Thu, 24 Apr 2014 13:19:41 -0400 Subject: small visual fixes --- app/assets/stylesheets/custom.css.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss index 4104235..b456893 100644 --- a/app/assets/stylesheets/custom.css.scss +++ b/app/assets/stylesheets/custom.css.scss @@ -36,13 +36,14 @@ a, input[type="submit"] { } -input[type="text"], input[type="password"]{ +input[type="text"], input[type="password"], textarea{ -webkit-box-shadow: inset 0 0 8px rgba(0,0,0,0.1), 0 0 16px rgba(0,0,0,0.1); -moz-box-shadow: inset 0 0 8px rgba(0,0,0,0.1), 0 0 16px rgba(0,0,0,0.1); box-shadow: inset 0 0 8px rgba(0,0,0,0.1), 0 0 16px rgba(0,0,0,0.1); border: 3px inset #A5A5A5; padding: 8px; + color: $orange !important; background: rgba(0,0,0,0.5); margin: 0 0 5px 0; } -- cgit v1.2.3-2-g168b From ae9a64f4e2e7a654e28744f1c8ca98681bb70301 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 24 Apr 2014 16:28:14 -0400 Subject: run ./generate.sh --- app/models/api_request.rb | 2 ++ app/models/api_requests.rb | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 app/models/api_request.rb delete mode 100644 app/models/api_requests.rb (limited to 'app') diff --git a/app/models/api_request.rb b/app/models/api_request.rb new file mode 100644 index 0000000..ffb7267 --- /dev/null +++ b/app/models/api_request.rb @@ -0,0 +1,2 @@ +class ApiRequest < ActiveRecord::Base +end diff --git a/app/models/api_requests.rb b/app/models/api_requests.rb deleted file mode 100644 index 19c76e2..0000000 --- a/app/models/api_requests.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ApiRequests < ActiveRecord::Base -end -- cgit v1.2.3-2-g168b From 992dc06e50d74aca79ed58d868be6113e3ebe55c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 24 Apr 2014 16:58:57 -0400 Subject: do away with stages_ordered --- app/models/tournament.rb | 10 ---------- app/views/matches/index.html.erb | 7 +++---- 2 files changed, 3 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app/models/tournament.rb b/app/models/tournament.rb index e21ccb1..caa711c 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -5,16 +5,6 @@ class Tournament < ActiveRecord::Base has_and_belongs_to_many :players, class_name: "User", association_foreign_key: "player_id", join_table: "players_tournaments" has_and_belongs_to_many :hosts, class_name: "User", association_foreign_key: "host_id", join_table: "hosts_tournaments" - def stages_ordered - h = {} - i = 1 - self.tournament_stages.order(:id).each do |s| - h[i] = s - i += 1 - end - return h - end - def settings @settings ||= Settings.new(self) end diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 8a50fee..d8538df 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -12,8 +12,7 @@ - <% @tournament.stages_ordered.keys.sort.each do |stage_key| %> - <% stage = @tournament.stages_ordered[stage_key] %> + <% @tournament.tournament_stages.ordered(:id)each do |stage| %> <% stage.matches_ordered.keys.sort.reverse.each do |match_key| %> <% match = stage.matches_ordered[match_key] %> <%= "Match #{match.id}" %> @@ -36,6 +35,6 @@
-<% @tournament.stages_ordered.keys.sort.each do |stage_key| %> -
<%= raw @tournament.stages_ordered[stage_key].to_svg(current_user) %>
+<% @tournament.tournament_stages.ordered(:id).each do |stage| %> +
<%= raw stage.to_svg(current_user) %>
<% end %> -- cgit v1.2.3-2-g168b From 27c3e207b299e6c5a94a1ab81412bb9e11a0d92a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 24 Apr 2014 17:01:42 -0400 Subject: rename Tournament#tournament_stages to Tournament#stages --- app/controllers/tournaments_controller.rb | 4 ++-- app/models/tournament.rb | 2 +- app/views/matches/index.html.erb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index ebc54c1..1354ad6 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -116,8 +116,8 @@ class TournamentsController < ApplicationController success = true ActiveRecord::Base.transaction do success &= @tournament.save && - success &= @tournament.tournament_stages.create(scheduling: "elimination") - success &= @tournament.tournament_stages.first.create_matches + success &= @tournament.stages.create(scheduling: "elimination") + success &= @tournament.stages.first.create_matches end if success format.html { redirect_to @tournament, notice: 'You have started this tournament.' } diff --git a/app/models/tournament.rb b/app/models/tournament.rb index caa711c..861be6c 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -1,6 +1,6 @@ class Tournament < ActiveRecord::Base belongs_to :game - has_many :tournament_stages + has_many :stages, class_name: "TournamentStage" has_many :settings_raw, class_name: "TournamentSetting" has_and_belongs_to_many :players, class_name: "User", association_foreign_key: "player_id", join_table: "players_tournaments" has_and_belongs_to_many :hosts, class_name: "User", association_foreign_key: "host_id", join_table: "hosts_tournaments" diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index d8538df..761f12a 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -12,7 +12,7 @@ - <% @tournament.tournament_stages.ordered(:id)each do |stage| %> + <% @tournament.stages.ordered(:id)each do |stage| %> <% stage.matches_ordered.keys.sort.reverse.each do |match_key| %> <% match = stage.matches_ordered[match_key] %> <%= "Match #{match.id}" %> @@ -35,6 +35,6 @@
-<% @tournament.tournament_stages.ordered(:id).each do |stage| %> +<% @tournament.stages.ordered(:id).each do |stage| %>
<%= raw stage.to_svg(current_user) %>
<% end %> -- cgit v1.2.3-2-g168b From 976325f60e7706e480f3d45848897200734c8485 Mon Sep 17 00:00:00 2001 From: tkimia Date: Thu, 24 Apr 2014 17:46:09 -0400 Subject: luke's typo fix --- app/views/matches/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 761f12a..784d7db 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -12,7 +12,7 @@ - <% @tournament.stages.ordered(:id)each do |stage| %> + <% @tournament.stages.order(:id).each do |stage| %> <% stage.matches_ordered.keys.sort.reverse.each do |match_key| %> <% match = stage.matches_ordered[match_key] %> <%= "Match #{match.id}" %> @@ -35,6 +35,6 @@
-<% @tournament.stages.ordered(:id).each do |stage| %> +<% @tournament.stages.order(:id).each do |stage| %>
<%= raw stage.to_svg(current_user) %>
<% end %> -- cgit v1.2.3-2-g168b From bd1bfe729030312fc678a3705c881744aa650c63 Mon Sep 17 00:00:00 2001 From: tkimia Date: Thu, 24 Apr 2014 18:08:26 -0400 Subject: text in graph is a bit better --- app/assets/stylesheets/matches.css.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app') diff --git a/app/assets/stylesheets/matches.css.scss b/app/assets/stylesheets/matches.css.scss index 66da68e..ee43ab4 100644 --- a/app/assets/stylesheets/matches.css.scss +++ b/app/assets/stylesheets/matches.css.scss @@ -51,4 +51,19 @@ form { color: #333; } +} + +svg { + min-width: 600px; +} + +@media (max-width: 900px) { + svg text { + font-size: 200%; + } +} +@media (max-width: 700px) { + svg text { + font-size: 150%; + } } \ No newline at end of file -- cgit v1.2.3-2-g168b From c38a00c8fbc549d1ec45834ee05b19a38d2dd246 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Thu, 24 Apr 2014 18:41:53 -0400 Subject: TOMER WE ADDED YOUR DESIRED 5 TEAM SEED --- app/controllers/matches_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 1ad86d0..138cf28 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -23,8 +23,8 @@ class MatchesController < ApplicationController @match.teams.each do |team| team.users.each do |user| - players_id.push(user.remote_usernames[0]["json_value"]["id"]) - players.push(user.remote_usernames[0]["json_value"]["id"]) + players_id.push(user.remote_usernames[0].value["id"]) + players.push(user.remote_usernames[0].value["name"]) end end -- cgit v1.2.3-2-g168b