app/controllers/team_management_controller.rb
# View FIN Supermaster team score (status)
View FIN Supermaster team score (status)
View FIN Supermaster team score ( status )
def supermaster
    @tab_title = I18n.t('team_management.fin_supermaster')
    team_affiliation = @team.team_affiliations.includes(:season).where("season_id = 182").first
    tsc = TeamSupermasterCalculator.new(team_affiliation)
    tot_swimmers = tsc.parse_swimmer_results()
    @team_supermaster_scores = tsc.team_supermaster_dao.sort{|p,n| (n.get_results_count*10000 + n.get_total_score) <=> (p.get_results_count*10000 + p.get_total_score) }
    @full_events_swimmers = tsc.full_events_swimmers
    @ranking_min = 0
    @ranking_max = 9999
    @ranking_context = 9999
    @ranking_range = "A"
    case @full_events_swimmers
    when 1..30
      @ranking_min = 1
      @ranking_max = 30
      @ranking_context = 25
      @ranking_range = "F"
    when 31..55
      @ranking_min = 31
      @ranking_max = 55
      @ranking_context = 50
      @ranking_range = "E"
    when 56..85
      @ranking_min = 56
      @ranking_max = 85
      @ranking_context = 75
      @ranking_range = "D"
    when 86..110
      @ranking_min = 86
      @ranking_max = 110
      @ranking_context = 100
      @ranking_range = "C"
    when 111..140
      @ranking_min = 111
      @ranking_max = 140
      @ranking_context = 125
      @ranking_range = "B"
    else
      @ranking_min = 140
      @ranking_max = 9999
      @ranking_context = 9999
      @ranking_range = "A"
    end
  end
def supermaster @tab_title = I18n . t ( 'team_management.fin_supermaster' ) team_affiliation = @team . team_affiliations . includes ( :season ) . where ( "season_id = 182" ) . first tsc = TeamSupermasterCalculator . new ( team_affiliation ) tot_swimmers = tsc . parse_swimmer_results ( ) @team_supermaster_scores = tsc . team_supermaster_dao . sort { | p , n | ( n . get_results_count * 10000 + n . get_total_score ) <=> ( p . get_results_count * 10000 + p . get_total_score ) } @full_events_swimmers = tsc . full_events_swimmers @ranking_min = 0 @ranking_max = 9999 @ranking_context = 9999 @ranking_range = "A" case @full_events_swimmers when 1 .. 30 @ranking_min = 1 @ranking_max = 30 @ranking_context = 25 @ranking_range = "F" when 31 .. 55 @ranking_min = 31 @ranking_max = 55 @ranking_context = 50 @ranking_range = "E" when 56 .. 85 @ranking_min = 56 @ranking_max = 85 @ranking_context = 75 @ranking_range = "D" when 86 .. 110 @ranking_min = 86 @ranking_max = 110 @ranking_context = 100 @ranking_range = "C" when 111 .. 140 @ranking_min = 111 @ranking_max = 140 @ranking_context = 125 @ranking_range = "B" else @ranking_min = 140 @ranking_max = 9999 @ranking_context = 9999 @ranking_range = "A" end end
View FIN Supermaster team score (status)
View FIN Supermaster team score ( status )
# Find out steam affiliation. Fix-ME # Determines the ranking context based on full_events_swimmer count # TODO - Store range on DB # Range F 25 # Range E 50 # Range D 75 # Range C 100 # Range B 125 # Range A more than 125