From d0cf5301e20e067fc1a020ef9800afc8b096dbd6 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Fri, 1 Feb 2019 15:36:37 +0000 Subject: [PATCH] Put win type on bracket and made bracket text smaller --- app/models/match.rb | 11 ++++++----- app/views/matches/_form.html.erb | 2 +- app/views/tournaments/bracket.html.erb | 6 ++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/models/match.rb b/app/models/match.rb index a151f52..8a8f875 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -63,15 +63,16 @@ class Match < ActiveRecord::Base end if self.finished == 1 if self.win_type == "Default" - return "Def" + return "(Def)" elsif self.win_type == "Injury Default" - return "Inj" + return "(Inj)" elsif self.win_type == "DQ" - return "DQ" + return "(DQ)" elsif self.win_type == "Forfeit" - return "For" + return "(For)" else - return "(#{self.score})" + win_type_abbreviation = "#{self.win_type.chars.to_a[0..2].join('')}" + return "(#{win_type_abbreviation} #{self.score})" end end end diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index c9b834d..af5e920 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -19,7 +19,7 @@
School: <%= @w1.school.name %> -
Last Match: <%= if @w1.last_match != nil then time_ago_in_words(@w2.last_match.updated_at) else "N/A" end%> +
Last Match: <%= if @w1.last_match != nil then time_ago_in_words(@w1.last_match.updated_at) else "N/A" end%> Name: <%= @w2.name %>