         opponent = match.opponents[0]
         opponent.userName = @nameMap[opponent.userID]
       @finishRendering()
-      
+
     $.ajax('/db/user/-/names', {
       data: {ids: ids}
       type: 'POST'
       success: success
     })
-    
+
   # PART 4: Rendering
 
   finishRendering: ->

        when: moment(match.date).fromNow()
        sessionID: opponent.sessionID
      }
    
    ctx.matches = (convertMatch(match) for match in @session.get('matches') or [])
    ctx
    
  afterRender: ->
    super()
    @setRankingButtonText(if @readyToRank() then 'rank' else 'unavailable')
    
  readyToRank: ->
    c1 = @session.get('code')
    c2 = @session.get('submittedCode')

    @level = new Level(_id:@levelID)
    @level.fetch()
    @level.once 'sync', @onLevelLoaded, @

    url = "/db/level/#{@levelID}/session?team=#{@team}"
    @session = new LevelSession()
    @session.url = -> url
